This file contains 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
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). |