hetznercloud / hcloud-cloud-controller-manager

Kubernetes cloud-controller-manager for Hetzner Cloud
Apache License 2.0
703 stars 112 forks source link

Loadbalancer on "master" is "red" #216

Closed exocode closed 3 years ago

exocode commented 3 years ago

Hi there,

I then deploy a Workload and a Loadbalancer šŸ‘


---
apiVersion: "v1"
kind: Service
metadata:
  name: "nginx-hello-world"
  labels:
    app: "hello-world"
  annotations:
    load-balancer.hetzner.cloud/name: "lb-staging"
    load-balancer.hetzner.cloud/health-check-port: "10254" #You can find it in the ingress-nginx manifest.
spec:
  ports:
    - name: "http"
      port: 80
      targetPort: 80
  selector:
    app: "hello-world"
  type: LoadBalancer
---
apiVersion: "apps/v1"
kind: "Deployment"
metadata:
  name: "nginx-hello-world"
  labels:
    app: "hello-world"
spec:
  selector:
    matchLabels:
      app: "hello-world"
  strategy:
    type: "Recreate"
  template:
    metadata:
      labels:
        app: "hello-world"
    spec:
      containers:
        - image: "nginx"
          name: "nginx-hello-world"
          imagePullPolicy: "Always"
          ports:
            - containerPort: 80
              name: "http

Everything fine so far: the loadbalancer balances the requests to the two worker nodes and is reachable through its public IP.

Bildschirmfoto 2021-07-09 um 01 09 10 Bildschirmfoto 2021-07-09 um 01 09 03

As you can see the "Master" is "not healthy".

And the taints...

# taints
node-role.kubernetes.io/controlplane=true:NoScheduleĀ 
node-role.kubernetes.io/etcd=true:NoExecute

# labels
role=master
topology.kubernetes.io/region=fsn1
topology.kubernetes.io/zone=fsn1-dc14

...seems normal for me: the controlpane should not be loadbalanced.

Do I have to simply "remove" the Master node from the loadbalancers target list in the Hetzner Dashboard? or is there "cleaner" way to get everything "green"?

Thank you in advance

LKaemmerling commented 3 years ago

Hey @exocode,

please have a look at this comment: https://github.com/hetznercloud/hcloud-cloud-controller-manager/issues/182#issuecomment-830577642 The CCM is not in charge of selecting the nodes that should be behind the LoadBalancer. The CCM gets a list of nodes from Kubernetes and simply adds those nodes to the LoadBalancer.

exocode commented 3 years ago

very nice: WORKED. Thank you