apiVersion: batch/v1 kind: CronJob metadata: name: registry-keep-last-3-builds namespace: registry spec: schedule: "*/15 * * * *" concurrencyPolicy: Forbid successfulJobsHistoryLimit: 2 failedJobsHistoryLimit: 3 jobTemplate: spec: backoffLimit: 1 template: spec: restartPolicy: Never containers: - name: prune image: python:3.12-alpine command: ["python", "/scripts/prune.py"] volumeMounts: - name: script mountPath: /scripts - name: auth mountPath: /auth readOnly: true volumes: - name: script configMap: name: registry-retention-script - name: auth secret: secretName: registry-regcred