MM: restore the download of the GeoIP DB

Signed-off-by: Aurélien Bompard <aurelien@bompard.org>
This commit is contained in:
Aurélien Bompard 2024-02-23 13:50:07 +01:00
parent 2bdda44feb
commit c7e3a33aa0
No known key found for this signature in database
GPG key ID: 31584CFEB9BF64AD
4 changed files with 60 additions and 76 deletions

View file

@ -111,10 +111,6 @@
objectname: deploymentconfig.yml
# Cron jobs
# - role: openshift/object
# app: mirrormanager
# file: cron.yml
# objectname: cron.yml
- role: openshift/object
app: mirrormanager
template: cron-crawler.yml

View file

@ -1,72 +0,0 @@
#
# Propagation
#
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: propagation-check
spec:
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
concurrencyPolicy: Forbid
schedule: "27 */2 * * *"
startingDeadlineSeconds: 500
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: mirrormanager
image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest
command:
- "mm2_crawler"
- "--create-dirs"
- "--output-dir"
- "/var/lib/mirrormanager/geoip"
- "-O"
- "https://infrastructure.fedoraproject.org/infra/bigfiles/geoip/GeoLite2-City.mmdb"
volumeMounts:
- name: data
mountPath: "/var/lib/mirrormanager"
volumes:
- name: data
persistentVolumeClaim:
claimName: data
securityContext:
supplementalGroups: [1001280000]
# ---
# apiVersion: batch/v1
# kind: CronJob
# metadata:
# name: sync-crawler-logs
# spec:
# successfulJobsHistoryLimit: 3
# failedJobsHistoryLimit: 3
# concurrencyPolicy: Forbid
# schedule: "55 * * * *"
# startingDeadlineSeconds: 500
# jobTemplate:
# spec:
# template:
# spec:
# restartPolicy: Never
# containers:
# - name: mirrormanager
# image: mirrormanager2:latest
# command: ["bash", "/opt/scripts/sync-crawler-logs.sh"]
# volumeMounts:
# - name: config
# mountPath: "/etc/mirrormanager"
# readOnly: true
# - name: scripts
# mountPath: "/opt/scripts"
# readOnly: true
# volumes:
# - name: config
# configMap:
# name: config
# - name: scripts
# configMap:
# name: scripts

View file

@ -1,4 +1,21 @@
---
# Right now this only contains the downloaded GeoIP database, less than 100Mb. Feel free to downsize if needed.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: ocs-storagecluster-cephfs
---
# This contains:
# - the extracted netblocks, around 30Mb
# - the mirrorlist cache, around 300Mb
# - the previous version of all that in an old/ directory
apiVersion: v1
kind: PersistentVolumeClaim
metadata:

View file

@ -35,8 +35,51 @@ spec:
- name: config
mountPath: "/etc/mirrormanager"
readOnly: true
- name: data
mountPath: "/var/lib/mirrormanager"
volumes:
- name: config
configMap:
name: config
- name: data
persistentVolumeClaim:
claimName: data
{% endfor %}
#
### Download GeoIP database
#
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: download-geoip-db
spec:
successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 3
concurrencyPolicy: Forbid
schedule: "48 * * * *"
startingDeadlineSeconds: 500
jobTemplate:
spec:
template:
spec:
restartPolicy: Never
containers:
- name: mirrormanager
image: image-registry.openshift-image-registry.svc:5000/mirrormanager/mirrormanager2:latest
command:
- "curl"
- "--create-dirs"
- "--output-dir"
- "/var/lib/mirrormanager/geoip"
- "-O"
- "https://infrastructure.fedoraproject.org/infra/bigfiles/geoip/GeoLite2-City.mmdb"
volumeMounts:
- name: data
mountPath: "/var/lib/mirrormanager"
volumes:
- name: data
persistentVolumeClaim:
claimName: data
securityContext:
supplementalGroups: [1001280000]