-
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
Pass actual cluster name to cinder-csi-plugin #15095
Pass actual cluster name to cinder-csi-plugin #15095
Conversation
Hi @ederst. 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. |
/ok-to-test |
@@ -333,7 +333,7 @@ spec: | |||
- name: CLOUD_CONFIG | |||
value: /etc/kubernetes/cloud.config | |||
- name: CLUSTER_NAME | |||
value: kubernetes | |||
value: {{ ClusterName }} |
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.
hmm, what will happen to existing installations? It might work correctly to newer one, but what about old ones?
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.
tried to answer this in one place, here: #15095 (comment)
also I think we need to add this also to occm? Seems that loadbalancer names have the cluster name, so if you create two similar named LBs to two different clusters it is facing an issue. Anyway this change is not backwards compatible, so I would like to see some boolean flag for that feature. It should be turned on for new clusters, but not to old ones. if I read code correctly, modifying existing CSI cinder cluster name should not matter(?). The cluster name is used only when creating snapshots or new volumes, but it will not affect anything else (old volumes should work?). Anyway this might be risky move, if later on the behaviour will change in csi cinder driver (the labels should be modified at least). IMO the best what we can do here, is to add that new boolean value which will define the behaviour for both: occm and csi. After that it can be used for new clusters but not the old ones |
Don't know about that, I know there was an issue resolved in OCCM (kubernetes/cloud-provider-openstack#1809), but AFAIK the https://github.com/kubernetes/kops/blob/master/pkg/apis/kops/componentconfig.go#L675-L676 So in case someone experiences this issue, they can do that already.
Yes, right now the label seems to be just informative, that's what I read from code and doc as well. And I tried it out on a few of our test clusters, does not seem to impact the old volumes, and new volumes just receive the cluster name instead of "kubernetes" in the property. But you got a point with "when the behavior changes later on". So this might be better off as a config flag. But maybe not a boolean but also a clusterName property here: kops/pkg/apis/kops/componentconfig.go Lines 784 to 793 in ffdffb3
For example like this: type OpenstackBlockStorageConfig struct {
Version *string `json:"bs-version,omitempty"`
IgnoreAZ *bool `json:"ignore-volume-az,omitempty"`
OverrideAZ *string `json:"override-volume-az,omitempty"`
IgnoreVolumeMicroVersion *bool `json:"ignore-volume-microversion,omitempty"`
// CreateStorageClass provisions a default class for the Cinder plugin
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"`
CSITopologySupport *bool `json:"csiTopologySupport,omitempty"`
// ClusterName sets the --cluster flag of the cinder-csi-pluing to the provided name instead of "kubernetes"
ClusterName string `json:"clusterName,omitempty"` // default value: "kubernetes"
} Edit: did the changes i mentioned above, marked PR as WIP intmt |
/restest |
/retest @ederst IMO this looks almost correct in case of CSI cinder. The only missing item is that we should populate this clusterName in case of new clusters. If we do that, we make it better for users hopefully in future. Perhaps good place for that is in https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/new_cluster.go#L326 However, I checked our kops occm installations and those does not have cluster-name flag at all for some reason(?).. anyways that can be handled as separate issue/pr if needed. |
Ah, OK now I think I know what you mean. Sounds good, will check out the issue (on Monday probably).
Nope, this should be coming from the controller lib occm has as dependency, so not sure what's the problem with your occm installations. |
Please squash the commits first. |
/approve cancel also we need that default value to https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/new_cluster.go#L326 sorry I was too fast, did not remember that missing piece :) |
74b3286
to
6702187
Compare
@ederst if you could add the clustername by default here https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/new_cluster.go#L326 something like
then I think you need to execute ./hack/update-expected.sh. Please make code changes to first commit and then update-expected.sh to second commit |
This passes the acutal cluster name to the cinder-csi-plugin, so that the plugin will add the name as metadata to the backing volume in OpenStack. Effectively, the change will help to better identify which volume in OpenStack belongs to which cluster, which is especially helpful when running multiple clusters in one OpenStack tenant/project. Setting the cluster name in both - the controller and the nodeserver - will ensure that dynamic and ephemeral volumes will receive the correct metadata.
6702187
to
3049506
Compare
@zetaab done like suggested, updated commits again so that code changes are separate from the generated stuff |
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.
thank you
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zetaab 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 |
…95-origin-release-1.26 Automated cherry pick of #15095: Pass actual cluster name to cinder-csi-plugin
…ck-of-#15095-origin-release-1.26 Automated cherry pick of kubernetes#15095: Pass actual cluster name to cinder-csi-plugin
This passes the acutal cluster name to the cinder-csi-plugin, so that the plugin will add the name as metadata to the backing volume in OpenStack.
Effectively, the change will help to better identify which volume in OpenStack belongs to which cluster, which is especially helpful when running multiple clusters in one OpenStack tenant/project.
Setting the cluster name in both - the controller and the nodeplugin - pods will ensure that dynamic and ephemeral volumes will receive the correct metadata.