0

I have a python docker image that I want to deploy in the Kubernetes cluster in every 2-minute interval. Same time it mount azure key vault secret volume. Its failed with an error while creating the pod.

failed to get keyvaultClient: failed to get key vault token Below is my YAML for Cron job deployment. Any idea about error?

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: vct-cron
spec:
  schedule: "*/2 * * * *"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: your-periodic-batch-job
        spec:
          containers:
          - name: redmine-cron
            image: test.azurecr.io/py-app:v3
            imagePullPolicy: IfNotPresent
            volumeMounts:
              - name: secrets-store01-inline
                mountPath: "/mnt/secrets-store"
                readOnly: true            
          restartPolicy: OnFailure
          volumes:
            - name: secrets-store01-inline
              csi:
                driver: secrets-store.csi.k8s.io
                readOnly: true
                volumeAttributes:
                  secretProviderClass: "azure-kvname-podid"

The secret store is already created and its can accessed by another pod.

leo Martin
  • 180
  • 1
  • 3
  • 15

0 Answers0