apiVersion: batch/v1
kind: CronJob
metadata:
  name: etcd-defrag-defrag-3
  labels:
    app.kubernetes.io/controller: defrag-3
    app.kubernetes.io/instance: talos
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: talos
    helm.sh/chart: etcd-defrag-4.5.0
  namespace: talos
spec:
  suspend: false
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 90
  timeZone: US/Central
  schedule: "20 0 * * 0"
  successfulJobsHistoryLimit: 1
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      parallelism: 1
      backoffLimit: 3
      template:
        metadata:
          labels:
            app.kubernetes.io/controller: defrag-3
            app.kubernetes.io/instance: talos
            app.kubernetes.io/name: talos
        spec:
          enableServiceLinks: false
          serviceAccountName: default
          automountServiceAccountToken: true
          hostIPC: false
          hostNetwork: false
          hostPID: false
          dnsPolicy: ClusterFirst
          restartPolicy: Never
          nodeSelector:
            node-role.kubernetes.io/control-plane: ""
          tolerations:
            - effect: NoSchedule
              key: node-role.kubernetes.io/control-plane
              operator: Exists
          containers:
            - args:
                - etcd
                - defrag
                - -n
                - 10.232.1.13
              env:
                - name: TALOSCONFIG
                  value: /tmp/.talos/config
              image: ghcr.io/siderolabs/talosctl:v1.11.6
              imagePullPolicy: IfNotPresent
              name: main
              volumeMounts:
                - mountPath: /tmp/.talos/config
                  mountPropagation: None
                  name: talos-config-3
                  readOnly: true
                  subPath: config
          volumes:
            - name: talos-config-3
              secret:
                secretName: talos-etcd-defrag-secret
