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
jx is creating my ECRs on region us-west-2, but nowhere have I set that. The cluster is in us-east-1 #1376
Comments
I am facing the same issue, not sure how to set the region to us-east-1. $ jx --version
1.3.128
Running on Ubuntu 18.04. |
I was facing the same problem, after some research in the code I've realized that it expects AWS_REGION instead of AWS_DEFAULT_REGION. After I've set AWS_REGION worked for me. |
Yes, that worked. thanks @rodrigodelmonte I was hoping it to get from the |
It doesn't seem to be taking region as ap-southeast-1 export AWS_REGION=ap-southeast-1 still fails jx create cluster aws --zones ap-southeast-1a |
also doesn't work on my end
|
Maybe this is the problem? jx/pkg/jx/cmd/create_cluster_aws.go Line 184 in 8d7e128
|
This fixes jenkins-x#1376 and jenkins-x#1453 by using the AWS region resolved by either the AWS_REGION or AWS_DEFAULT_REGION environment variables instead of hardcoding us-west-1.
This fixes jenkins-x#1376 by using the AWS region resolved by either the AWS_REGION or AWS_DEFAULT_REGION environment variables instead of hardcoding us-west-1.
Please try to use the latest version of jx. I've fixed a couple of AWS region related issues there. I had the same issue with ECR push and those changes did the job for me. |
This is not solved. jx still doesn't create the ECR repository in in the region used by the cluster. What would make sense to me is using the registry stored in configmap jenkins-x-docker-registry. |
This is because you have multiple AWSCLI profiles, and you create the cluster using a non-default profile with 'jx create cluster eks --profile xxx', but jx will always create ECR using the default profile. |
If you send me...
...I could try to tell your what is the issue and/or create PR with fix for this. |
OK, @StephenWangasg suggestion is right. The issue is here - Line 68 in 7fb4656
|
Actually just figured out that even if profile is not passed, there is information about ECR region saved in ConfigMap. So still this value should be read from it. So again, I need this #1376 (comment) input to help you :) . |
Summary
Even though I've installed Jenkins-X in a cluster on AWS Region us-east-1, all of the ECRs it creates for my apps are in us-west-2.
jx get aws
correctly returns my AWS Account ID, but I can't tell where it's getting the region from.~/.aws/config
file is set tous-east-1
and I don't have a environment variableAWS_DEFAULT_REGION
set.Steps to reproduce the behavior
Deploy any app using
jx import
, wait until the ECR is created, then go to your AWS Console, move to Oregon region, then open Elastic Container Service -> ECR, and notice that the ECR repo for your app was created there.Jx version
The output of
jx version
is:Kubernetes cluster
What kind of Kubernetes cluster are you using & how did you create it?
Cluster deployed using Kops, Jenkins-X installed later on.
Operating system / Environment
linux-amd
Expected behavior
jx should detect my AWS Region using file
~/.aws/config
or Environment VariableAWS_DEFAULT_REGION
Actual behavior
Apparently it is assuming my region to be
us-west-2
The text was updated successfully, but these errors were encountered: