Skip to content

Instantly share code, notes, and snippets.

@alexei-led
Created December 26, 2019 12:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexei-led/6ae6d57ed08b26c64f534f87fc1872df to your computer and use it in GitHub Desktop.
Save alexei-led/6ae6d57ed08b26c64f534f87fc1872df to your computer and use it in GitHub Desktop.
Markdium-Kubernetes and Secrets Management in Cloud
apiVersion: batch/v1
kind: Job
metadata:
name: printenv-job
spec:
template:
spec:
restartPolicy: Never
serviceAccountName: iam-secrets-manager-ro
initContainers:
- name: secrets-init
image: doitintl/secrets-init:v0.2.1
command:
- sh
args:
- -c
- "cp /usr/local/bin/secrets-init /secrets-init/bin/"
volumeMounts:
- mountPath: /secrets-init/bin
name: secrets-init-volume
containers:
- image: alpine:3
name: print-env
env:
- name: AWS_REGION
value: us-west-2
- name: TOP_SECRET
value: arn:aws:secretsmanager:us-west-2:906364353610:secret:topsecret-Acdaq8
command:
- /secrets-init/bin/secrets-init
args:
- sh
- -c
- 'echo $TOP_SECRET'
volumeMounts:
- mountPath: /secrets-init/bin
name: secrets-init-volume
volumes:
- name: secrets-init-volume
emptyDir: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment