-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
fix: pass AWS_REGION to etcd-manager #6099
Conversation
Hi @knight42. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/assign @justinsb |
Thanks @knight42 |
We actually probably need a better way to pass the region to etcd-manager. The region the s3 bucket is in may not always be the region the cluster is running in. @justinsb what do you think about setting this so that is defaults to the region the bucket is in but so that the user can overwrite the setting through the spec? |
ping @justinsb Any suggestion? |
@@ -342,6 +342,9 @@ func (b *EtcdManagerBuilder) buildPod(etcdCluster *kops.EtcdClusterSpec) (*v1.Po | |||
awsup.TagNameRolePrefix + "master=1", | |||
} | |||
config.VolumeNameTag = awsup.TagNameEtcdClusterPrefix + etcdCluster.Name | |||
container.Env = []v1.EnvVar{ | |||
{Name: "AWS_REGION", Value: os.Getenv("AWS_REGION")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is AWS_REGION set to the state store bucket? I thought we decided it wasn't necessarily the case.
I think we need to explicitly figure out the region of the bucket, and pass that in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justinsb If we could infer the region of the bucket that would be best, but the path to the state store bucket is often written in S3Uri
, like s3://kops-state-store
, one may not figure out the region easily.
Thanks for the fix - I think it's the right idea. What we need to be sure of though is that the AWS_REGION we pass in is indeed the correct region, and I don't think that is necessarily the AWS_REGION that is set for kops. (I think for example you can just set the region in the aws config file, and never set AWS_REGION). We also shouldn't really set AWS_REGION if AWS_REGION isn't set locally, and in particular not when we're on GCE :-) |
As mentioned above, the path to the state store bucket is often written in
Given the context, we could see that only if the cloud provider was AWS, we would set the AWS_REGION. |
I am also running into this problem, and this code fixed my issue while testing the 1.12 beta. If I understand the problem correctly, the current Kops implementation of etcd-manager introduces a breaking change and can't be used if the s3 bucket for a cluster is either in AWS China or (assuming) AWS Gov, right? I can upgrade/revert my test cluster all day with Kops 1.11.x in AWS China, but not with the current implementation in Kops 1.12. @justinsb - instead of defaulting to the region the cluster is in, are you suggesting the bucket region be explicitly defined in either the cluster spec or some other environment variable? Are you open to @rdrgmnzs's suggestion by defaulting to the same region as the cluster unless otherwise specified somewhere (assuming the cluster spec)? It sounds like folks are open to resolving this because it is definitely a blocker, but we need to know the preferred way to address it. |
803befe
to
15f08e9
Compare
New changes are detected. LGTM label has been removed. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: knight42 If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@justinsb do you have any feedback on this? We talked about this PR during the previous 2 office hour meetings. |
Just a quick update for watchers, we did discuss this again today in office hours. Currently we're going to hold the release for this and I believe @justinsb will chime in shortly. If this requires a bunch of rework, we're going to plan to cut 1.12 and add this in a patch or 1.13, whichever comes first. |
Thanks for the update, @mikesplain! |
Close in favor of #6943 |
Fixes #6098