diff --git a/playbooks/openshift-apps/mirrormanager.yml b/playbooks/openshift-apps/mirrormanager.yml index ea0f1d507a..588ca52b75 100644 --- a/playbooks/openshift-apps/mirrormanager.yml +++ b/playbooks/openshift-apps/mirrormanager.yml @@ -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 diff --git a/roles/openshift-apps/mirrormanager/files/cron.yml b/roles/openshift-apps/mirrormanager/files/cron.yml deleted file mode 100644 index 3d72f0232b..0000000000 --- a/roles/openshift-apps/mirrormanager/files/cron.yml +++ /dev/null @@ -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 diff --git a/roles/openshift-apps/mirrormanager/files/storage.yml b/roles/openshift-apps/mirrormanager/files/storage.yml index 27a1848f59..b0fea82098 100644 --- a/roles/openshift-apps/mirrormanager/files/storage.yml +++ b/roles/openshift-apps/mirrormanager/files/storage.yml @@ -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: diff --git a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml index bb4f4c3b8d..f400e2c2cd 100644 --- a/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml +++ b/roles/openshift-apps/mirrormanager/templates/cron-crawler.yml @@ -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]