Skip to content
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

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

Open
wanGiB opened this issue Oct 21, 2024 · 2 comments

Comments

@wanGiB
Copy link

wanGiB commented Oct 21, 2024

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?

@wanGiB wanGiB closed this as completed Oct 21, 2024
@wanGiB wanGiB reopened this Oct 21, 2024
@lukasmetzner
Copy link
Contributor

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

@hegerdes
Copy link
Contributor

hegerdes commented Dec 8, 2024

You should be fine by setting --k3s-extra-args="--kubelet-arg=cloud-provider=external"

I would not worry to much about the unofficial support from hetzner for k3s. They are also using k3s for integration tests. See here how they use terraform to setup a k3s cluster:

https://github.com/hetznercloud/kubernetes-dev-env/blob/40b22edf75a85d603c39939a2d00bf16d86bb365/main-setup.tf#L32-L53

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants