syself / cluster-api-provider-hetzner

Cluster API Provider Hetzner 🚀 Kubernetes Infrastructure as Software 🔧 Terraform/Kubespray/kOps alternative for running Kubernetes on Hetzner
https://caph.syself.com
Apache License 2.0
540 stars 51 forks source link

confusing hcloudmachinetemplate controller error when using k0s #1291

Open rgarcia opened 2 months ago

rgarcia commented 2 months ago

/kind bug

What steps did you take and what happened: Please see here: https://github.com/k0sproject/k0smotron/issues/561

Basically I'm trying to run the basic k0s cluster-api + hetzner example from their docs and running into a lot of problems. I've tracked it down to the CAPH machinetemplate controller failing to create the machine template because it can't fetch the hcloud api key secret from the parent hetznercluster object... but that seems to be configured correctly, so I'm stumped.

What did you expect to happen: A k0s cluster to spin up in hetzner.

Anything else you would like to add:

Environment:

guettli commented 2 months ago

I never used k0s, but I use caph daily and it works fine.

Why do you use k0s? I don't know that project.

Have you tried using caph the normal way (start with the mgt cluster in a kind cluster, later you can move the mgt cluster into a wl cluster)?

rgarcia commented 2 months ago

Yes I am using caph the normal way daily as well! I'm using a regular old kubeadm cluster in Hetzner as my management cluster and have used it to create lots of clusters.

I'm now trying to make some extremely lightweight k0s clusters for users and so that put me down the path of trying to get caph to work with the k0s control plane provider. So any guidance on how to debug caph in this case would be greatly appreciated.

guettli commented 2 months ago

If the secret can't be found, these things come to my mind:

Check the namespace.

Check rbacs via impersonating the service account.

batistein commented 1 month ago

@rgarcia Were you able to solve it?

rgarcia commented 1 month ago

I gave up and switched back to the default control plane provider in CAPH (kubeadm). It's working fine for now. I do think it would be nice to get a lightweight control plane provider like k0s or k3s working, since Hetzner is often the place people go for super low-cost VMs. E.g. running a single node k0s cluster on a cax11 would be neat.

Thanks for checking in and feel free to close.