gce: Support cloudLabels for InstanceGroup#17821
gce: Support cloudLabels for InstanceGroup#17821k8s-ci-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
Welcome @rramkumar1! |
|
Hi @rramkumar1. Thanks for your PR. I'm waiting for a github.com 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. DetailsInstructions 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-sigs/prow repository. |
2dd10bd to
ebb3276
Compare
|
/ok-to-test |
bade583 to
9a58b0d
Compare
| case kops.CloudProviderHetzner: | ||
| labels[hetzner.TagKubernetesNodeLabelPrefix+k] = v | ||
| case kops.CloudProviderGCE: | ||
| // TODO: Do nothing for now while we figure out how to address GCE label length limit of 63 |
There was a problem hiding this comment.
I'm guessing the label is too long for GCE, and the cluster-autoscaler doesn't look at this label anyway on GCE?
There was a problem hiding this comment.
I see, I was not aware that the labels might be a no-op on GCE. Does that need to be looked into more or are you sure on that fact? If so, I can just change the comment.
|
|
||
| t.ServiceAccounts = append(t.ServiceAccounts, b.LinkToServiceAccount(ig)) | ||
|
|
||
| // labels, err := b.CloudTagsForInstanceGroup(ig) |
There was a problem hiding this comment.
lol, thanks for fixing ... I'll have to go splunking to figure out why we commented this out and special-cased it :-)
There was a problem hiding this comment.
Yeah I tried but it's hard to follow the change history because a few of the recent changes were just formatting.
There was a problem hiding this comment.
AFAICT this was commented out in the original code in 2017, so ... thanks for fixing :-)
|
/assign @justinsb |
| fs := bindFlags(d) | ||
|
|
||
| // Ensure https://github.com/Azure/rg-cleanup deletes removes resources | ||
| if d.CloudProvider == "azure" { |
There was a problem hiding this comment.
I don't think at this stage d.CloudProvider is available.
There was a problem hiding this comment.
I think it becomes available after bindFlags() no? If not, any suggestions on where to place this conditional?
The issue I ran into is that the "creationTimestamp" label is not a valid label format for GCE.
There was a problem hiding this comment.
The tags issue should be fixed via #17826. Let's see how things work afterwards.
859dbff to
5d6094b
Compare
|
/retest |
1 similar comment
|
/retest |
|
Failed tests are unrelated. Thanks @rramkumar1! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hakman The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/override pull-kops-e2e-k8s-gce-ipalias |
|
@hakman: Overrode contexts on behalf of hakman: pull-kops-e2e-k8s-aws-calico, pull-kops-e2e-k8s-gce-ipalias DetailsIn response to this:
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-sigs/prow repository. |
|
@rramkumar1: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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-sigs/prow repository. I understand the commands that are listed here. |
Moved existing default label application logic for GCE IG to central CloudTagsForInstanceGroup. We then call this function when generating the IG template which also gives us the user supplied cloudLabels from both the Cluster and InstanceGroup resource. I have explicitly not plumbed through support for node labels and have left it for a TODO. There was an issue with GCE label length limits that I ran into in the e2e test.
Note that a simple refactor would be to move the shared CloudTagsForInstanceGroup function to respective context.go files in each cloud provider directory. I think this is better served in a follow up PR to ensure consistency at this very moment in case we don't get to the refactor.
In terms of testing, I have added a single integration test which verifies that a
cloudLabeladded to the InstanceGroup is reflected properly in the output Terraform. This doesn't necessarily cover all cases (e.g what happens when cluster.cloudLabel and instanceGroup.cloudLabel) are specified. I think these would be better served as unit tests which should be added when the aformentioned refactor is complete.Ref: #17638