hcloud-cloud-controller-manager icon indicating copy to clipboard operation
hcloud-cloud-controller-manager copied to clipboard

missing prefix on k8s 1.24

Open cschmatzler opened this issue 1 year ago • 5 comments

Hi! First of all:

Client Version: v1.24.2
Kustomize Version: v4.5.4
Server Version: v1.24.2

As described in #80, the missing prefix hcloud:// is caused by the missing --cloud-provider=external flag. As the README also states, though, this flag has been removed in k8s 1.24. Unfortunately, I am getting this same error on the newer version of Kubernetes. Since the flag has been removed, I am unsure on how to proceed here getting the CCM set up.

E0711 18:28:16.043416       1 node_controller.go:237] hcloud/instances.InstanceExistsByProviderID: missing prefix hcloud://
I0711 18:28:16.043429       1 util.go:63] hcloud/providerIDToServerID: make sure your cluster configured for an external cloud provider

cschmatzler avatar Jul 11 '22 18:07 cschmatzler

The --cloud-provider=external flag has not been removed for kubelet, it is only deprecated (see https://github.com/kubernetes/kubernetes/pull/110066 for some background).

hakman avatar Jul 11 '22 19:07 hakman

I have the same issue. I can confirm that --cloud-provider=external flag has been added at kubeadm init stage.

Any ideas anyone?

Cluster version is 1.24.3.

nicholaspearson avatar Jul 28 '22 14:07 nicholaspearson

OK, I think the reason for this is because the --cloud-provider=external flag is being set by the systemd drop-in as per the instructions, however is being unset by the following file: /etc/sysconfig/kubelet.

I've done the following:

yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes

systemctl enable --now kubelet
systemctl enable --now containerd
systemctl enable --now docker

cat > /etc/sysconfig/kubelet <<EOF
KUBELET_EXTRA_ARGS=--cloud-provider=external
EOF

systemctl restart kubelet

Don't forget to do this on both the leaders and all workers otherwise it will cause errors.

My issues are now gone.

nicholaspearson avatar Jul 29 '22 16:07 nicholaspearson

@cschmatzler https://github.com/nicholaspearson/hcloud-kubernetes-terraform

Your welcome :)

nicholaspearson avatar Aug 01 '22 22:08 nicholaspearson

This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs.

github-actions[bot] avatar Oct 01 '22 13:10 github-actions[bot]