apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: charts-syncer
spec:
  schedule: "*/30 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: c3styncer
            imagePullPolicy: Always
            image: gcr.io/bitnami-labs/charts-syncer:TAG
            args: ["sync", "--config", "/charts-syncer.yaml", "-v", "4"]
            # env:
            #   - name: SOURCE_AUTH_USERNAME
            #     valueFrom:
            #       secretKeyRef:
            #         name: charts-syncer-credentials
            #         key: source-username
            #   - name: SOURCE_AUTH_PASSWORD
            #     valueFrom:
            #       secretKeyRef:
            #         name: charts-syncer-credentials
            #         key: source-password
            #   - name: TARGET_AUTH_USERNAME
            #     valueFrom:
            #       secretKeyRef:
            #         name: charts-syncer-credentials
            #         key: target-username
            #   - name: TARGET_AUTH_PASSWORD
            #     valueFrom:
            #       secretKeyRef:
            #         name: charts-syncer-credentials
            #         key: target-password
            volumeMounts:
              - name: config
                mountPath: /charts-syncer.yaml
                subPath: charts-syncer.yaml
          restartPolicy: OnFailure
          volumes:
            - name: config
              configMap:
                name: charts-syncer-config
