Closed MatthiasLohr closed 4 years ago
Hey @MatthiasLohr,
thank you for the report. I found the bug. Did you create a network secret within the hcloud
secret like described here: https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/docs/deploy_with_networks.md?
It looks like the CCM can not find the Network
No, I followed the instructions from https://community.hetzner.com/tutorials/install-kubernetes-cluster to create a ansible role for setting up everything. The ansible task for creating the secret looks like this:
- name: Hetzner Cloud Controller Secret
community.kubernetes.k8s:
definition:
apiVersion: v1
kind: Secret
metadata:
name: hcloud
namespace: kube-system
stringData:
token: "{{ hetzner.api_token }}"
network: "{{ hetzner.network_id }}"
According to https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/docs/deploy_with_networks.md, there are two "create secret" commands, which does not work:
# kubectl -n kube-system create secret generic hcloud --from-literal=token=nothingtoseehere
secret/hcloud created
# kubectl -n kube-system create secret generic hcloud --from-literal=network=42
Error from server (AlreadyExists): secrets "hcloud" already exists
(to test this, I deleted the secret generated by ansible manually)
Are you sure that the hetzner.network_id contain the correct value of your network?
Oops. I recreated the network to adjust the subnet to match the controllers default subnet and forgot to update it in my config as well. Sorry!
Anyways: I would suggest to add a check for n == nil
in https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/hcloud/cloud.go#L83 and give a proper message like "are you as stupid as Matthias and put the wrong ID here?" message...
Thanks for your help!
@MatthiasLohr the MR for this was just opened in #61 :) Thank you!
Hi,
I'm trying to set up a Kubernetes Cluster on the Hetzner Cloud with the network feature.
I'm using the unmodified https://github.com/hetznercloud/hcloud-cloud-controller-manager/blob/master/deploy/v1.6.1-networks.yaml file.
After removing the taints for calico/coredns they're starting, the hcloud-cloud-controller-manager started to crash:
Any idea?
Best regards Matthias