apiVersion: batch/v1beta1
kind: CronJob
metadata:
  labels:
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: cockroachdb
    helm.sh/chart: cockroachdb-7.0.0
  name: RELEASE-NAME-cockroachdb-rotate-self-signer
  namespace: default
spec:
  jobTemplate:
    spec:
      backoffLimit: 1
      template:
        spec:
          containers:
          - args:
            - rotate
            - --ca
            - --ca-duration=43800h
            - --ca-expiry=648h
            - --ca-cron=0 0 1 */11 *
            - --readiness-wait=30s
            - --pod-update-timeout=2m
            env:
            - name: STATEFULSET_NAME
              value: RELEASE-NAME-cockroachdb
            - name: NAMESPACE
              value: default
            - name: CLUSTER_DOMAIN
              value: cluster.local
            image: gcr.io/cockroachlabs-helm-charts/cockroach-self-signer-cert:1.3
            imagePullPolicy: IfNotPresent
            name: cert-rotate-job
          restartPolicy: Never
          serviceAccountName: RELEASE-NAME-cockroachdb-rotate-self-signer
  schedule: 0 0 1 */11 *
