---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: ecr-public-creds-helper
  namespace: ecr-public-creds-helper
spec:
  schedule: "0 */8 * * *" # Every 8 hours, Note: An auth token for ECR Public is valid for 12 hours
  successfulJobsHistoryLimit: 2
  failedJobsHistoryLimit: 2  
  jobTemplate:
    spec:
      backoffLimit: 3
      template:
        spec:
          serviceAccountName: sa-secrets-editor
          terminationGracePeriodSeconds: 0
          restartPolicy: Never
          containers:
          - name: kubectl
            imagePullPolicy: Always
            image: ${CREDS_HELPER_CONTAINER_IMAGE} ### <- 1. EDIT HERE !!!
            env:
            # Specify "existing" namespaces as a space-delimited list where you want to create Kubernetes secrets with auth token for ECR Public
            - name: TARGET_NAMESPACES
              value: "default foo bar" ### <- 2. EDIT HERE !!!
