-
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
Tag subnets on AWS so load balancers are properly created #3527
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Assign the PR to them by writing The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
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.
Question for you
// https://github.com/kubernetes/kops/issues/2011 | ||
glog.V(4).Infoln("Found a subnet of type: %s and tagging it for proper ELB placement", e.Type) | ||
if e.Type == kops.SubnetTypePrivate { | ||
e.Tags["kubernetes.io/role/internal-elb"] = "" |
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.
I think we do tagname = 1 elsewhere.
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.
dont we need another tag as well. Checking
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.
Do we also need the tags from here kubernetes/kubernetes#41695 shared and owned? I am not certain, but since you are messing with tags anyways
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.
Those tags are generated in https://github.com/kubernetes/kops/blob/master/pkg/resources/aws.go
I'll change values to 1. It also occurred to me that folks who use TF and cloud formation probably also want this, so refactoring a bit.
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.
we need e.Tags["kubernetes.io/role/internal-elb"] = "1"
to have conformity between our tags. Looks great, sorry for the nit pick. Let me know if you do not have time, I can put in a follow-up PR.
Good spot. I'd say rather than passing |
@@ -155,6 +155,7 @@ func (b *NetworkModelBuilder) Build(c *fi.ModelBuilderContext) error { | |||
CIDR: s(subnetSpec.CIDR), | |||
Shared: fi.Bool(sharedSubnet), | |||
Tags: tags, | |||
Type: subnetSpec.Type, | |||
} |
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.
Instead of passing Type here, I would put the Tag logic here.
Sorry for the delay. I reworked this PR in #3682. Addresses the same idea and I think it takes into consideration these comments. |
just came across this issue using kops 1.7 now! I get error: Good to know its fixed in 1.8. But i will wait for GA release |
Without having these tags, internal load balancers are nondeterministically created and sometimes end up in inappropriate subnets.
Closes #2011