-
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 shared subnet/vpc tags #3184
Fix shared subnet/vpc tags #3184
Conversation
ec57745
to
c80c051
Compare
@KashifSaadat this is the PR that may make it so that we don't need #3064. But https://github.com/kubernetes/kops/pull/3184/files#diff-ee8d33deb9549322c28a9ef65ed04473R241 is the tag we talked about that we still need on a shared subnet. It's not a conflict any more, but it does require a tag for each cluster using the subnet. Something I think would also be a nice alternative would be to separate out the network objects into their own "thing" - likely their own top level API object like a Cluster - and then we could tag the VPCs and Subnets with a tag like Let me know if the shared tag is a problem for your use-case and we can discuss more! |
@@ -143,11 +144,10 @@ func (_ *VPC) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *VPC) error { | |||
if featureflag.VPCSkipEnableDNSSupport.Enabled() { | |||
glog.Warningf("VPC did not have EnableDNSSupport=true, but ignoring because of VPCSkipEnableDNSSupport feature-flag") | |||
} else { | |||
// TODO: We could easily just allow kops to fix this... |
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.
Would be good to automatically rectify this issue but could cause issues if users are not expecting any change to occur to a shared resource. Maybe allow users to specify an auto-fix flag and cover other similar cases if there are any?
This is excellent. The cluster tag addition shouldn't be an issue for our use-case, will give it a test. Thanks for the work @justinsb! 👍 |
Tested and this works really well. Couple notes:
|
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.
What happens when the kops install user cannot modify subnets or the vpc? i.e. add tags?
@justinsb PR needs rebase |
For subnets, k8s needs it if you're going to be creating ELBs. I'd like to fix this (#3191) but need to clear some of the backlog first... |
@justinsb on the vpc as well? |
@chrislovecnm It is required on the subnet. It is not required on the VPC, but it seems inconsistent to do one but not the other. I would like to get it so that you don't need permissions on either (#3191), but until then it doesn't seem like the one permission is going to be much worse than the other... |
@geojaz can you take a look please? We need to work out these details |
Testing some of this now, I noticed that kops doesn't seem to respect Otherwise setting all the tags properly shared subnets/rtb/ngw seems to work for me. |
@blakebarnett the route table does not have a shared bool in the model. Bug. |
@KashifSaadat / @justinsb what do we need to resolve? Can we get a rebase and get this merged? |
c80c051
to
daabe45
Compare
Rebased. AFAIK @chrislovecnm you're the only -1 on this. |
* Stop setting the Name tag on a shared subnet/vpc * Stop setting the legacy KubernetesCluster tag on a shared subnet/vpc that is new enough (>=1.6); we rely on the shared tags instead * Set tags on shared subnets; i.e. we _do_ set the shared tag on a shared subnet; that is important for ELBs * Set tags on shared VPCs; i.e. we _do_ set the shared tag on a shared VPC; that is not used but consistent with subnets. * Add tests for shared subnet
daabe45
to
9cf22ae
Compare
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.
LGTM, are we able to get this merged in? :)
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrislovecnm 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 |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
Stop setting the Name tag on a shared subnet/vpc
Stop setting the legacy KubernetesCluster tag on a shared subnet/vpc
that is new enough (>=1.6); we rely on the shared tags instead
Set tags on shared subnets; i.e. we do set the shared tag on a
shared subnet; that is important for ELBs
Set tags on shared VPCs; i.e. we do set the shared tag on a shared
VPC; that is not used but consistent with subnets.
Add tests for shared subnet