HA traefik ingress

Hi!
I noticed that when installing k3s it deployes the traefik ingress with just one replica. This can lead to some downtime if the node running traefik goes down, until the pod is created on another node.
I can manually scale the traefik deployment to more replicas but somehow this gets reset automatically to 1 (probably by helm).
Is there a way to configure the traefik replicas count at k3s install time (or later)?

It’s a tragedy how un-HA K3S is out of the box.

You can either edit YAMLs in /var/lib/rancher/k3s/server/manifests/ or edit helmchartconfig.

We run the ingres controllers on all nodes as a DaemonSet:
You might want to consider these:

# Ensure `traefik` ingress controller runs on all nodes:
kubectl edit helmchartconfig -n kube-system
# Add:
    deployment:
      kind: DaemonSet

You might also want to run coredns runs on all nodes:

kubectl edit helmchartconfig -n kube-system
# Add:
    deployment:
      kind: DaemonSet

Nevertheless you will see that Kubernetes still routes traffic to pods on dead nodes for up to 30s.

1 Like