Skip to content

Commit

Permalink
docs(deploy): mention kubeadm config for --cloud-provider flag (#607)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
apricote authored Jan 15, 2024
1 parent 2f339d2 commit 9913930
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9913930

Please sign in to comment.