hetznercloud / hcloud-cloud-controller-manager

Kubernetes cloud-controller-manager for Hetzner Cloud
Apache License 2.0
681 stars 108 forks source link

CCM installation with microk8s #664

Open telemorphix opened 1 month ago

telemorphix commented 1 month ago

TL;DR

Hi. I'm currently installing CCM with microk8s. The installation steps are not comparable to the current installation manual (e.g. kubeadm not available). For a simplified Kubernetes installation based on Ubuntu (microK8s), such an official manual would be very helpful, because I got stuck with the installation (error below).

Are there any plans to include a microk8s installation manual, or do you have such manual available. Thanks.

Expected behavior

The installation of CCM with microk8s works fine so far.

Environment:

I followed these steps:

With the yaml file below, the service is create and I can see the new load balancer in the Hetzner Cloud panel, but the service creates an error: Warning SyncLoadBalancerFailed 4s (x2 over 9s) service-controller Error syncing load balancer: failed to ensure load balancer: hcloud/loadBalancers.EnsureLoadBalancer: hcops/LoadBalancerOps.ReconcileHCLBTargets: providerID does not have one of the the expected prefixes (hcloud://, hrobot://, hcloud://bm-):

I added "--cloud-provider=external" to the:

config files and restarted microk8s, but that did not work out.

I did not configure anything to tolerate the uninitialized taint (yet, would not know where).

yaml

apiVersion: v1 kind: Service metadata: name: balancer-test-service annotations: load-balancer.hetzner.cloud/location: fsn1 spec: selector: app: test-apps ports:

apricote commented 4 weeks ago

Hey @telemorphix,

you need to add --cloud-provider=external from the start to the kubelet, otherwise the node will be initialized with the microk8s internal "cloud provider" and have the wrong provider ID.

You can verify this by running kubectl get nodes -o=custom-columns=NAME:.metadata.name,PROVIDERID:.spec.providerID.

Docs

We currently only document the required parameters for kubeadm, as its the primary method supported by upstream kubernetes. We are planning a rewrite of our docs and Ill make sure to make space for other Kubernetes Distributions. We do not have the bandwidth to support & test every distribution though, so this will rely on the community providing the documentations for each distribution.

A quick look into the microk8s docs tells me, that you can configure this through "Launch Configurations", where you can add --cloud-provider: external under extraKubeletArgs.