k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.1k stars 2.35k forks source link

Disable Traefik option doesn't work in v1.29.3+k3s1 #9851

Closed crazyelectron-io closed 7 months ago

crazyelectron-io commented 7 months ago

Environmental Info: K3s Version: v1.29.3+k3s1

Node(s) CPU architecture, OS, and Version: Linux k3s-prod-m01 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

Cluster Configuration: I started setup of a 6 node cluster. So far I installed 3 master nodes (through Ansible).

Describe the bug: With the option --disable traefik in place at install time, it still deploys Traefik.

NAMESPACE        NAME                                      READY   STATUS             RESTARTS        AGE
kube-system      coredns-6799fbcd5-r8nm7                   1/1     Running            1 (2m13s ago)   2m45s
kube-system      helm-install-traefik-b4mtg                0/1     Completed          1               102s
kube-system      helm-install-traefik-crd-228t2            0/1     Completed          0               102s
kube-system      kube-vip-ds-9jlrs                         1/1     Running            1 (2m14s ago)   2m40s
kube-system      kube-vip-ds-9z42h                         1/1     Running            1 (2m13s ago)   2m45s
kube-system      kube-vip-ds-mv2bb                         1/1     Running            0               2m30s
kube-system      local-path-provisioner-6c86858495-pjscg   1/1     Running            1 (2m13s ago)   2m45s
kube-system      metrics-server-54fd9b65b-56zxt            1/1     Running            1 (2m13s ago)   2m45s
kube-system      svclb-traefik-098d8abb-dmtkw              2/2     Running            0               89s
kube-system      svclb-traefik-098d8abb-l2sdk              2/2     Running            0               89s
kube-system      svclb-traefik-098d8abb-szgl5              2/2     Running            0               89s
kube-system      traefik-f4564c4f4-9c2gn                   1/1     Running            0               89s

The K3s service file (/etc/systemd/system/k3s.service):

[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
After=network-online.target

[Service]
Type=notify
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server --disable traefik --disable servicelb --tls-san 10.100.3.10
KillMode=process
Delegate=yes
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Steps To Reproduce:

  1. Install Debian 12.5 on 3 systems (bare metal through unattended preseed).
  2. Install K3s with the parameters --disable servicelb --tls-san 10.100.0.10 --disable traefik.
  3. Run kubectl get pods -A, which will show Traefik running.

Expected behavior: Treafik should not have been installed.

Actual behavior: Despite the disable option, Traefik is installed as shown by the kubectl get pods -A command.

brandond commented 7 months ago

Did you disable traefik on all server nodes?

What is the output of kubectl get node -o yaml | grep node-args ?

crazyelectron-io commented 7 months ago

Did you disable traefik on all server nodes?

@brandond Thanks for your suggestion. I installed a 1 node cluster with my Ansible playbook and that worked as it should (no Traefik installed). Need to check what changes when installing the additional nodes, I guess...

Once I can confirm, I will close this issue.

crazyelectron-io commented 7 months ago

After tweaking the arguments and variables in the Ansible roles, it now installs a 6 node cluster without Traefik. So, it was a user error... issue closed.