From 99139305feb120a4ceb1ac4f0710274a34810dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20T=C3=B6lle?= Date: Mon, 15 Jan 2024 14:09:57 +0100 Subject: [PATCH] docs(deploy): mention kubeadm config for --cloud-provider flag (#607) - Mention that the deployment suggestions for the flag are only valid for `kubeadm` and other distributions might have different requirements - Mention the kubeadm config field that can be used in place of the systemd drop-in unit. - Update deprecation notice for flag `--cloud-provider=external` for latest kubernetes release. Closes #513 --- README.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5eb2f3c70..6cd603c3f 100644 --- a/README.md +++ b/README.md @@ -58,20 +58,21 @@ guide](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/), which these instructions are meant to augment and the [kubeadm documentation](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/). -1. The cloud controller manager adds its labels when a node is added to +1. The cloud controller manager adds the labels when a node is added to the cluster. For current Kubernetes versions, this means we - have to add the `--cloud-provider=external` flag to the `kubelet` - before initializing the control plane with `kubeadm init`. To do - accomplish this we add this systemd drop-in unit - `/etc/systemd/system/kubelet.service.d/20-hcloud.conf`: + have to add the `--cloud-provider=external` flag to the `kubelet`. How you + do this depends on your Kubernetes distribution. With `kubeadm` you can + either set it in the kubeadm config + ([`nodeRegistration.kubeletExtraArgs`][kubeadm-config]) or through a systemd + drop-in unit `/etc/systemd/system/kubelet.service.d/20-hcloud.conf`: - ``` - [Service] - Environment="KUBELET_EXTRA_ARGS=--cloud-provider=external" - ``` + ```ini + [Service] + Environment="KUBELET_EXTRA_ARGS=--cloud-provider=external" + ``` Note: the `--cloud-provider` flag is deprecated since K8S 1.19. You - will see a log message regarding this. For now (v1.26) it is still required. + will see a log message regarding this. For now (v1.29) it is still required. 2. Now the control plane can be initialized: @@ -123,6 +124,8 @@ documentation](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/ kubectl apply -f https://github.com/hetznercloud/hcloud-cloud-controller-manager/releases/latest/download/ccm.yaml ``` +[kubeadm-config]: https://kubernetes.io/docs/reference/config-api/kubeadm-config.v1beta4/#kubeadm-k8s-io-v1beta4-NodeRegistrationOptions + ## Networks support When you use the Cloud Controller Manager with networks support, the CCM is in favor of allocating the IPs (& setup the