apiVersion: batch/v1 kind: CronJob metadata: name: cri-prune spec: schedule: "0 16 * * 0" #every sunday at 4pm jobTemplate: spec: backoffLimit: 1 template: spec: restartPolicy: Never initContainers: - name: fix-ssh image: alpine command: - sh - -c - | mkdir -p /home/ansible/.ssh cp /tmp/ssh/* /home/ansible/.ssh/ chown 1000:1000 /home/ansible/.ssh/* chmod 600 /home/ansible/.ssh/id_rsa chmod 644 /home/ansible/.ssh/id_rsa.pub chmod 644 /home/ansible/.ssh/known_hosts volumeMounts: - name: icarus-ssh mountPath: /tmp/ssh - name: home mountPath: /home/ansible containers: - name: cri-prune image: oci.limbosolutions.com/public/mylimbo.ansible.collections.global:latest imagePullPolicy: IfNotPresent resources: limits: memory: "512Mi" cpu: "500m" requests: memory: "256Mi" cpu: "250m" # command: ["tail", "-f", "/dev/null"] args: - ansible-playbook mylimbo.globals.k3s.crictl_prune volumeMounts: - name: home mountPath: /home/ansible - name: ansible-inventory mountPath: /workspace/inventory subPath: inventory - name: ansible-all-group-vars mountPath: /workspace/group_vars/all - name: ansible-icarus-host-vars mountPath: /workspace/host_vars/icarus volumes: - name: home emptyDir: {} - name: icarus-ssh secret: secretName: icarus-ssh defaultMode: 0400 - name: ansible-inventory secret: secretName: ansible-inventory - name: ansible-all-group-vars secret: secretName: ansible-group-vars - name: ansible-icarus-host-vars secret: secretName: ansible-icarus-host-vars