hetznercloud / hcloud-cloud-controller-manager

Kubernetes cloud-controller-manager for Hetzner Cloud
Apache License 2.0
734 stars 118 forks source link

How to properly set up Environment="KUBELET_EXTRA_ARGS=--cloud-provider=external" in K3S #763

Open wanGiB opened 2 weeks ago

wanGiB commented 2 weeks ago

I have the following set up for the control planes:

The first etcd server:

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--kubelet-arg=cloud-provider=external --node-name=$(hostname -f) --disable=traefik --disable=servicelb --disable-cloud-controller --prefer-bundled-bin --cluster-init --node-ip=$INTERNAL_IP --tls-san $PUBLIC_IP" sh -s - server

And the following when joining additional servers

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--kubelet-arg=cloud-provider=external --node-name=$(hostname -f) --disable=traefik --disable=servicelb --disable-cloud-controller --prefer-bundled-bin --node-ip=$INTERNAL_IP --server https://$FIRST_SERVER_IP:6443 --tls-san $PUBLIC_IP" K3S_TOKEN=$FIRST_SERVER_JOIN_SECRET sh -s - server

And here is the equivalent script when joining worker nodes to the cluster:

export K3S_NODE_NAME=$(hostname -f)
export K3S_KUBELET_EXTRA_ARGS="--cloud-provider=external"
curl -sfL https://get.k3s.io | K3S_TOKEN=$FIRST_SERVER_JOIN_SECRET sh -s - agent --server https://$FIRST_SERVER_IP:6443

I just want to be sure if this way of setting the cloud provider external flag is correct in k3s?

lukasmetzner commented 1 day ago

Hi,

Here you can find the official K3s documentation on this topic. Just as a note, while our cloud controller manager works with K3s, we don’t directly support K3s itself, as this question seems more specific to K3s than to our product.

In general, this looks good to me. As described in the kubelet cli reference, the value should be set to external, if you are running a external cloud controller manager, like ours.

Did you experience any issues while testing?

Best Regards

Lukas