-
Notifications
You must be signed in to change notification settings - Fork 184
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
Support for running controller outside of cluster #102
Conversation
Welcome @MartinWeindel! |
Hi @MartinWeindel. Thanks for your PR. I'm waiting for a kubernetes-sigs 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 @codenrhoden |
@MartinWeindel what is the use case of running controller outside of the cluster? Isn't this a security hole? |
The use case is providing Kubernetes clusters on vSphere by Gardener. |
klog.Errorf("BuildConfigFromFlags failed %q", err) | ||
return nil, err | ||
} | ||
} else { |
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 about defaulting to an in cluster config if BuildConfigFromFlags
fails?
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.
This would be very confusing. You specify a kubeconfig, but if something fails the controller suddenly tries to control the cluster it is running on.
Better to fail early and report it. If you want to use in-cluster config, just do not provide a kubeconfig.
BTW, your colleges of the vSphere cloud manager are using exactly the same logic, see https://github.com/kubernetes/cloud-provider-vsphere/blob/master/pkg/common/kubernetes/kubernetes.go#L38-L44
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.
CPI have different use cases from CSI. However, on second thought, i agree with the benefits of failing early.
nodes.nodeRegister(obj) | ||
} | ||
|
||
func (nodes *Nodes) nodeUpdate(oldObj interface{}, newObj interface{}) { |
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.
Have you done any testing to validate if nodeUpdate
works as expected? I think here that you'd need to unregister the old node object and register the new one if that passes (or vice versa). Otherwise we'd have a long list of nodes registered representing the same node object.
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.
A node update typically updates its status fields. Especially it is forbidden to change the providerID of the spec or its name. Therefore the node registration happens with the same values and the node manager is hopefully idempotent. I'm not an expert here, but removing the node registration on an update of its status looks to me like a very dangerous operation.
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.
The problem here is a timing behaviour. If the CSI controller is already running if new nodes join the cluster
the node object is created first without attributes required by the CSI controller. They are later added by the cloud controller.
But this is then no create event anymore, but an update event. Therefore it is not possible to ignore update events in the CSI controller.
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.
@mandelsoft exactly! Not just in the case of new nodes, but also if CSI is initialized before CPI adds ProviderID
to all nodes, we have a situation where not all nodes are registered with the ProviderID
set. This is the use case that i see for nodeUpdate
.
@MartinWeindel it seems that nodeRegister
will modify the existing node entry and not add a new one. But we still need some testing to verify
friendly ping |
@divyenpatel can you review this PR? |
/ok-to-test |
…nt variable; reregister node on update
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: divyenpatel, MartinWeindel 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 |
/lgtm |
…ency-openshift-4.16-vmware-vsphere-syncer OCPBUGS-24961: Updating vmware-vsphere-syncer-container image to be consistent with ART
What this PR does / why we need it:
If the control plane runs in another cluster, it is needed to specify kubeconfig path for controller and syncer.
Release note: