aws-cli-docker icon indicating copy to clipboard operation
aws-cli-docker copied to clipboard

Using aws-cli in Kubernetes pod

Open idgdmg opened this issue 6 years ago • 0 comments

Trying to use the aws-cli container in Kubernets pod - I have the below config, but it does NOT work

Essentially I am trying to pass the environment credentials from Kubernetes secrets and run the aws cli commands from within the Kubernetes pod

apiVersion: batch/v1beta1 kind: CronJob metadata: name: "pcwlog" namespace: owaspzapscanner spec: schedule: "*/5 * * * *" concurrencyPolicy: Forbid jobTemplate: spec: template: spec: volumes: - name: owasp-zap-volume persistentVolumeClaim: claimName: efs containers: - name: aws-cli image: mikesir87/aws-cli:latest env: - name: AWS_ACCESS_KEY_ID valueFrom: secretKeyRef: name: aws-fastly-secret key: aws_access_key_id - name: AWS_SECRET_ACCESS_KEY valueFrom: secretKeyRef: name: aws-fastly-secret key: aws_secret_access_key command: ["/bin/sh", "-c"] args: ["aws s3 ls"] imagePullPolicy: Always name: "pcwlog" resources: {} volumeMounts: - name: owasp-zap-volume mountPath: /zap/wrk restartPolicy: Never securityContext: fsGroup: 1000

idgdmg avatar Nov 27 '19 20:11 idgdmg