Created
July 10, 2019 13:43
-
-
Save dmage/cfcb78744949c2da3d728989fb33152e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind: List | |
apiVersion: v1 | |
items: | |
- apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: pruner | |
namespace: openshift-image-registry | |
- apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: openshift-image-registry-pruner | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: system:image-pruner | |
subjects: | |
- kind: ServiceAccount | |
name: pruner | |
namespace: openshift-image-registry | |
- apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: image-pruner | |
namespace: openshift-image-registry | |
spec: | |
schedule: "0 0 * * *" | |
concurrencyPolicy: Forbid | |
successfulJobsHistoryLimit: 1 | |
failedJobsHistoryLimit: 3 | |
jobTemplate: | |
spec: | |
template: | |
spec: | |
restartPolicy: OnFailure | |
containers: | |
- image: "quay.io/openshift/origin-cli:4.1" | |
resources: | |
requests: | |
cpu: 1 | |
memory: 1Gi | |
terminationMessagePolicy: FallbackToLogsOnError | |
command: | |
- oc | |
args: | |
- adm | |
- prune | |
- images | |
- --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt | |
- --keep-tag-revisions=5 | |
- --keep-younger-than=96h | |
- --confirm=true | |
name: image-pruner | |
serviceAccountName: pruner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment