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

unable to get working loadbalancer from rke2 cluster

Open lachnerd opened this issue 1 year ago • 5 comments

Hi there,

as i switched from rke1 to rke2 i got problems deploying my traefik helm chart that generates a loadbalancer in hetzner cloud.

The LB gets created but no target nodes are attached so the service stays in status pending. Log Message:

"...hcops/providerIDToServerID: missing prefix hcloud://: rke2://<NODENAME>"

If i look at the node config i see on rke1:

providerID: hcloud://123456 

and on rke2

providerID: rke2://<nodename>

It seems like on rke2 the prefix changed. Any suggestions how to deal with that on hcloud-cloud-controller-manager

Tested on v1.23.8+rke2r1 and v1.22.11+rke2r1

lachnerd avatar Jul 21 '22 14:07 lachnerd

Try adding this configuration to the kubelet options

From the rke2 docs --kubelet-arg value (agent/flags) Customized flag for kubelet process

The required params by hetzner cloud controller

kubelet-arg:
    - "cloud-provider=external" 

Let me know if this works

PS: I believe you should recreate the cluster

fmendez89 avatar Jul 22 '22 10:07 fmendez89

[EDITED after a quick check]

I did a quick test and it works. The node is added to the target.

fmendez89 avatar Jul 25 '22 13:07 fmendez89

Hi,

i`m trying to accomplish this using terraform and "rancher2_cluster_v2" ressource - do you have any ideas or documentation (aside from hashicorp) where to set this kubelet args with this ressource.

I tried :

machine_selector_config{ cloud-provider-name = "external" }

But it didn't work - cluster does not start

lachnerd avatar Jul 26 '22 06:07 lachnerd

ok,

now if i set:

`machine_selector_config { config = {
profile = local.cisprofile protect-kernel-defaults = true system-default-registry = var.private_registry != null ? var.private_registry : null cloud-provider-name = "external" } }'

setting this @machine_selector_config results in only controlplane coming up - but no worker is running. Reason some tainting i guess.

i also tried to deploy "hcloud-cloud-controller-manager" but its crashing with this...:

kubectl logs hcloud-cloud-controller-manager-bc6d9d8db-24rz6 -n kube-system Flag --allow-untagged-cloud has been deprecated, This flag is deprecated and will be removed in a future release. A cluster-id will be required on cloud instances. I0801 11:59:16.629364 1 serving.go:313] Generated self-signed cert in-memory W0801 11:59:16.926396 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work. I0801 11:59:16.929053 1 controllermanager.go:120] Version: v0.0.0-master+$Format:%h$ F0801 11:59:26.930489 1 controllermanager.go:124] Cloud provider could not be initialized: could not init cloud provider "hcloud": hcloud/newCloud: Get "https://api.hetzner.cloud/v1/networks/<NETWORKID>": dial tcp: lookup api.hetzner.cloud on <IP>: read udp <IP>:53755-><IP>: i/o timeout

lachnerd avatar Aug 01 '22 12:08 lachnerd

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 Sep 30 '22 13:09 github-actions[bot]

Hi,

i`m trying to accomplish this using terraform and "rancher2_cluster_v2" ressource - do you have any ideas or documentation (aside from hashicorp) where to set this kubelet args with this ressource.

I tried :

machine_selector_config{ cloud-provider-name = "external" }

But it didn't work - cluster does not start

@lachnerd Appearing a similar issue. Did you solve your issue with registering the downstream cluster?

gthieleb avatar May 10 '24 09:05 gthieleb