-
-
Save asrail/7c72257ab34ba68002b416238e57206b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
stringData: | |
AWS_ACCESS_KEY_ID: put your access key ID here | |
AWS_SECRET_ACCESS_KEY: put your secret access key here. You can use any "safe" form for secret management | |
kind: Secret | |
metadata: | |
name: aws-creds | |
type: Opaque | |
--- | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ecr-cred-helper | |
spec: | |
containers: | |
- command: | |
- /bin/sh | |
- -c | |
- |- | |
kubectl delete secret --ignore-not-found $SECRET_NAME | |
kubectl create secret docker-registry $SECRET_NAME \ | |
--docker-server=https://${ACCOUNT}.dkr.ecr.${AWS_REGION}.amazonaws.com \ | |
--docker-username=AWS \ | |
--docker-password=$(aws ecr get-login-password --region $AWS_REGION) | |
env: | |
- name: AWS_REGION | |
value: us-east-1 | |
- name: SECRET_NAME | |
value: regcred | |
- name: ACCOUNT | |
value: "##############" | |
envFrom: | |
- secretRef: | |
name: aws-creds | |
image: place your **public** image with kubectl and AWS CLI v2 | |
imagePullPolicy: IfNotPresent | |
name: ecr-cred-helper | |
restartPolicy: Never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment