Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

knctl deploy command fails when using image from AWS ECR registry #60

Open
ajay-kumar-1 opened this issue Mar 18, 2019 · 4 comments
Open

Comments

@ajay-kumar-1
Copy link

Hello All,

I had build an image of a sample application from github [https://github.com/cppforlife/simple-app] with knctl command.

Image is successfully build and I had stored this image of AWS ECR.

Now when I try to deploy the image on EKS cluster, it gets fails with below messages:

root@jenkins-5749546fc5-xq82z:/# knctl deploy --service deploy --image 631963551282.dkr.ecr.us-east-2.amazonaws.com/nginx:latest
Name deploy
Waiting for new revision to be created...
Tagging new revision 'deploy-00001' as 'latest'
Tagging new revision 'deploy-00001' as 'previous'
Annotating new revision 'deploy-00001'
Waiting for new revision 'deploy-00001' to be ready for up to 5m0s (logs below)...
Revision 'deploy-00001' did not became ready ----->>>>> ISSUE
Continuing to watch logs for 5s before exiting

Succeeded
root@jenkins-5749546fc5-xq82z:/#

Can you help me on this?

@cppforlife
Copy link
Owner

@ajaykumar333 i would look at knctl service show -s deploy

@ajay-kumar-1
Copy link
Author

ajay-kumar-1 commented Mar 24, 2019

Hello,

Below is the required output:


root@jenkins-788f557b77-hdvhv:~# knctl service show -s deploy
Service 'deploy'

Name             deploy  
Domain           deploy.jx.example.com  
Internal Domain  deploy.jx.svc.cluster.local  
Annotations      -  
Age              6m  

Conditions

Type                 Status  Age  Reason           Message  
ConfigurationsReady  False   5m   RevisionFailed   Revision "deploy-00001" failed with message: "unsupported status code 401; body:  
                                                   Not Authorized\n".  
Ready                False   5m   RevisionMissing  Configuration "deploy" does not have any ready Revision.  
RoutesReady          False   5m   RevisionMissing  Configuration "deploy" does not have any ready Revision.  

Pods conditions

Pod  Type  Status  Age  Reason  Message  

Succeeded
root@jenkins-788f557b77-hdvhv:~#_ 

The above output is showing an error code 401 (Not authorized), for the authorization i am using a helper.sh script from the below link:
https://github.com/knative/build-templates/tree/master/ecr_helper

This script do the following task:

  • serviceaccount created
  • secret "ecr-creds" created

@ajay-kumar-1
Copy link
Author

Just for the information,

When I am using knctl command to delpoy from the public GIT repostory using below command:


knctl deploy --service deploy --git-url https://github.com/cppforlife/simple-app --git-revision master --service-account builder --image 631963551282.dkr.ecr.ap-northeast-2.amazonaws.com/test --env SIMPLE_MSG=123


The container image gets successfullly build and saved to ECR registory successfuly.
However, the issue ( mentioned in 1st comments and in above logs) occur when it is going to deploy that image on kubernetes cluster.

Please help me.

@cppforlife
Copy link
Owner

@ajaykumar333 im not quite sure how knative + ecr_helper plays together. i would try out using knative directly and making that work with ecr. once you are sure it works, then trying to use knctl with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants