-
Notifications
You must be signed in to change notification settings - Fork 296
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
kube-controller-manager does not start if "vmFolder" is not provided in config #401
Comments
The solution will be number two:
This falls under the issue discussed by @andrewsykim and myself regarding moving several cloud provider config settings to the cluster provider spec. |
By the way, awesome job catching this! |
agree that fix should be number 2,
good job @ykakarap, there is 1 or few more (not sure yet) capv issues with internal cloud setup. |
I might be missing some context, but if the in-tree vSphere provider requires VM folder to be set, then we should require that here otherwise storage plugins will not work? |
With some objects, like pools, folders, datastores, you can do a “GetThisOrDefault”. We do that for those objects, just not ahead of the construction of the cloud config. /assign @akutz I’ll fix this with a quick patch. |
yes, folder is required field for in-tree provider vSphere, it up to debate whether it should be required input from user, figure out default at runtime should work ( as long as user has permission to the default folder) |
I would say that CAPV shouldn't try to find defaults here and should require an explicit VM folder. The default behavior should be something the cloud provider does and it should document clearly what happens if it is not set. My experience with vSphere in that area is lacking though so will defer to folks with more experience here. |
@ykakarap Sounds good, let me know when it’s ready. @andrewsykim, except a lot of people don’t know the path of the default folder or pool, hence the reason these helpers exist. Trust me, it’s not something to put on users or the UX. |
Good to know, thanks |
I will open other issues for them. |
/assign @ykakarap |
I agree Also note that the value of % govc find vm -type f -childType VirtualMachine
vm
vm/Testing
vm/Templates
vm/Discovered virtual machine
vm/Testing/K8s
vm/Testing/K8s/capv-mgmt-cluster % govc find / -type f -childType VirtualMachine
/dc1/vm
/dc1/vm/Testing
/dc1/vm/Templates
/dc1/vm/Discovered virtual machine
/dc1/vm/Testing/K8s
/dc1/vm/Testing/K8s/capv-mgmt-cluster |
@akutz Leaving the The After fixing the bug, the function returns the correct vmFolder and the kube-controller-manager works as expected. I tested this on |
@akutz With this fix the We wont have to add an extra check to see if the default folder is empty and then set it to "vm". What are your thoughts? |
Hi @ykakarap, I do not disagree. I'm saying there is a fix we can do in CAPV and there is a fix we can do in GoVmomi. Fix it in CAPV as is and file an issue to track the fix in GoVmomi and revisit this later. Heck, just add the empty string check in CAPV, and at some point, when we update the GoVmomi dependency, it won't ever be empty and the CAPV fix code won't be hit. Either way, this unblocks us in CAPV today. |
Signed-off-by: Vince Prignano <vince@vincepri.com>
"vmFolder" is an optional parameter to be set while generating the manifests. "vmFolder" in
VsphereMachineProviderConfig
defaults to an empty string while generating the manifests.Using these manifests with
clusterctl
results in a management cluster in whichkube-controller-manager
does not work, resulting in a broken management cluster.Possible reason:
Spinning up of
kube-controller-manager
needs to know the correct "vmFolder" which by default is an empty string. The data that is passed to theSetCloudInitUserData
method is not modified to fill the values like "vmFolder", "resoursePool" if missing becauseSetCloudInitUserData
is called before we get the correct "vmFolder", "resourcePool", etc using theFolderOrDefault
,ResourcePoolOrDefault
, etc functions.Possible fixes:
SetCloudInitUserData
.VsphereMachineProviderConfig
can remain as is.SetCloudInitUserData
is not a struct but an array of bytes. Modifying it to support default values will need changes elsewhere too (possibly thegenerateUserData
function)./cc @figo
The text was updated successfully, but these errors were encountered: