简体   繁体   中英

`no basic auth credentials` Github to AWS ECR deployment on git events

I have done setup of Flux for k8s deployment to AWS EKS, for it I have configured Github and k8S with the following:

https://www.weave.works/blog/gitops-with-github-actions-eks

but getting no basic auth credentials

Thanks in advance

You need to login into the ECR Repo using the below command:

aws ecr get-login-password \
        --region <region> \
    | docker login \
        --username AWS \
        --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com

ECR Repository URL: <aws_account_id>.dkr.ecr.region.amazonaws.com

Example:

sh "aws ecr get-login-password --region us-west-1 | docker login --username AWS --password-stdin 09xxxxxxxxxx.dkr.ecr.us-west-1.amazonaws.com"

This command retrieves and displays an authentication token using the GetAuthorizationToken API that you can use to authenticate to an Amazon ECR registry. ~ (Quoted from Amazon Docs)

Reference: https://docs.aws.amazon.com/cli/latest/reference/ecr/get-login-password.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM