mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-07 09:43:15 +00:00
add uuid bits to master/worker to make it a bit easier on operators
This commit is contained in:
@@ -714,10 +714,15 @@ def configure_kubelet(dns, ingress_ip):
|
||||
cloud_config_path = _cloud_config_path('kubelet')
|
||||
kubelet_opts['cloud-provider'] = 'openstack'
|
||||
kubelet_opts['cloud-config'] = str(cloud_config_path)
|
||||
elif is_state('endpoint.vsphere.ready'):
|
||||
# vsphere doesnt need a cloud config on the worker
|
||||
elif is_state('endpoint.vsphere.joined'):
|
||||
# vsphere just needs to be joined on the worker (vs 'ready')
|
||||
cloud_config_path = _cloud_config_path('kubelet')
|
||||
kubelet_opts['cloud-provider'] = 'vsphere'
|
||||
# NB: vsphere maps node product-id to its uuid (no config file needed).
|
||||
uuid_file = '/sys/class/dmi/id/product_uuid'
|
||||
with open(uuid_file, 'r') as f:
|
||||
uuid = f.read().strip()
|
||||
kubelet_opts['provider-id'] = 'vsphere://{}'.format(uuid)
|
||||
|
||||
if get_version('kubelet') >= (1, 10):
|
||||
# Put together the KubeletConfiguration data
|
||||
|
||||
Reference in New Issue
Block a user