Skip to content

Instantly share code, notes, and snippets.

View VesperDev's full-sized avatar
🎯
Focusing

Edgar Mendoza VesperDev

🎯
Focusing
View GitHub Profile
@VesperDev
VesperDev / gist:f40ce1c720fd8e43f39d2cf65885f241
Created April 17, 2024 00:11 — forked from t2wu/gist:ce286e0883fe10cd54b664be17bf63fe
Create secret for K8S to access AWS ECR
kubectl create secret docker-registry regcred \
--docker-server=<aws-account-id>.dkr.ecr.<aws-region>.amazonaws.com \
--docker-username=AWS \
--docker-password=$(aws ecr get-login-password) \
-o yaml
# This creates the regcred secret and at the same time output YAML to standard output which you
# can store elsewhere. In my case I have two machines, one having aws and the other having kubectl.
# So I run "aws ecr get-login-password" on one machine and paste the result to replace
# $(aws ecr get-login-password).