xetys / hetzner-kube

A CLI tool for provisioning kubernetes clusters on Hetzner Cloud
Apache License 2.0
745 stars 116 forks source link

hcloud-cloud-controller-manager isn't propagated to workers #160

Open voron opened 6 years ago

voron commented 6 years ago

I just bootstraped k8s from hetzner-kube 0.3.2-SNAPSHOT, and noted hcloud-cloud-controller-manager is not deployed on workers, neither during bootstrap nor during cluster add-worker. I had to follow https://github.com/xetys/hetzner-kube/issues/4#issuecomment-361984088 to get Hetzner metadata and IP to pull up into k8s.

voron commented 6 years ago

I checked my deploy again, and it looks like pre-created workers have 20-hcloud.conf, but I need to re-add worker node to k8s to have Hetzner metadata such as ProviderID, region, zone to appear. cluster add-worker workers don't have 20-hcloud.conf at all;

xetys commented 6 years ago

Yes, that is desired to be this way. If I deploy the controller manager silently, you cannot use the add extrernal worker feature, as the cloud controller manager doesn't find the external server in the cloud (obviously) and deletes it immediately after registration. So I decided to move it to an add-on. So you can post deploy it using addon install hcloud-cloud-controller-manager

voron commented 6 years ago

In my case I bootstraped k8, installed addon hcloud-cloud-controller-manager and then added 2 workers via cluster add-worker. Should these auto-created by hetzner-kube workers have 20-hcloud.conf as Hetzner cloud instances ?

voron commented 6 years ago

As a work-around I had to re-install hcloud CCM every time I add worker

hetzner-kube cluster addon uninstall hcloud-controller-manager -n CLUSTER-NAME
hetzner-kube cluster addon install hcloud-controller-manager -n CLUSTER-NAME
xetys commented 6 years ago

Possibly we need to add some kind of hooks into the addon section. So we define several hooks for different steps like adding nodes, where add-ons can hook into to run some custom code.