Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to Disable Traefik LoadBalancer in K3s #11521

Closed
vkoori opened this issue Jan 6, 2025 · 10 comments
Closed

Unable to Disable Traefik LoadBalancer in K3s #11521

vkoori opened this issue Jan 6, 2025 · 10 comments

Comments

@vkoori
Copy link

vkoori commented Jan 6, 2025

I am attempting to disable the Traefik load balancer when starting my K3s server, but the Traefik service is still being created as a LoadBalancer type. I used the following command to start K3s with the required flags:

ExecStart=/usr/local/bin/k3s \
    server \
    --disable=traefik \
    --disable=servicelb \
    --disable=local-storage \
    '--write-kubeconfig-mode' \
    '644'

However, after starting K3s, I can still see the Traefik service running as a LoadBalancer in the kube-system namespace when I query the services with kubectl get service -n kube-system.

Output:

$ kubectl get service -n kube-system
NAME             TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE
kube-dns         ClusterIP      10.43.0.10      <none>          53/UDP,53/TCP,9153/TCP       101m
metrics-server   ClusterIP      10.43.89.231    <none>          443/TCP                      2d1h
traefik          LoadBalancer   10.43.139.147   192.168.10.10   80:30639/TCP,443:30764/TCP   15h

Expected Behavior:
I expect the Traefik load balancer to be completely disabled and not be present as a LoadBalancer service in the kube-system namespace.

@brandond
Copy link
Member

brandond commented Jan 6, 2025

Can you show the output of kubectl get node -o yaml | grep node-args and kubectl get pod -A -o wide?

@vkoori
Copy link
Author

vkoori commented Jan 7, 2025

Thanks for your response!

$ kubectl get node -o yaml | grep node-args
      k3s.io/node-args: '["server","--disable","traefik","--disable","servicelb","--disable","local-storage","--write-kubeconfig-mode","644"]'
$ kubectl get pod -A -o wide
NAMESPACE     NAME                               READY   STATUS    RESTARTS        AGE   IP           NODE     NOMINATED NODE   READINESS GATES
kong          kong-controller-6845694c68-gplbq   1/1     Running   17 (120m ago)   39h   10.42.0.68   kooriv   <none>           <none>
kong          kong-gateway-685b68bc4c-k44j8      1/1     Running   1 (120m ago)    21h   10.42.0.65   kooriv   <none>           <none>
kube-system   coredns-ccb96694c-h9j4b            1/1     Running   1 (120m ago)    20h   10.42.0.66   kooriv   <none>           <none>
kube-system   metrics-server-5985cbc9d7-njgkq    1/1     Running   1 (120m ago)    20h   10.42.0.67   kooriv   <none>           <none>

However, my issue isn't related to the node args or any pods. The problem I'm facing is specifically with the LoadBalancer service for Traefik that persists even after starting K3s with the --disable=traefik and --disable=servicelb flags.

@brandond
Copy link
Member

brandond commented Jan 7, 2025

The service should go away when traefik is disabled and the chart uninstalled. I've never seen it leave anything behind. I don't see an uninstall job pod present - did it succeed, or did you delete anything manually?

@vkoori
Copy link
Author

vkoori commented Jan 9, 2025

nope. I dont delete anything manually

@caroline-suse-rancher caroline-suse-rancher moved this from New to In Triage in K3s Development Jan 13, 2025
@luo3house
Copy link

The docs indicates --disable=traefik, but I turned to --disable traefik then it worked.

@brandond
Copy link
Member

brandond commented Feb 7, 2025

The flag parser should handle either.

@brandond
Copy link
Member

Closing, please reopen if you can provide specific steps to reproduce. I am not aware of any issues with the disable flag or chart uninstallation process.

@github-project-automation github-project-automation bot moved this from In Triage to Done Issue in K3s Development Feb 11, 2025
@pwright
Copy link

pwright commented Mar 1, 2025

curl -sfL https://get.k3s.io | sh -s - --disable=servicelb --disable=traefik

$ kubectl get svc -A
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.43.0.1 443/TCP 35s
kube-system kube-dns ClusterIP 10.43.0.10 53/UDP,53/TCP,9153/TCP 31s
kube-system metrics-server ClusterIP 10.43.12.159 443/TCP 31s
kube-system traefik LoadBalancer 10.43.205.228 80:32727/TCP,443:30767/TCP 2s

@brandond
Copy link
Member

brandond commented Mar 3, 2025

@pwright This doesn't reproduce. You'll need to provide more information. Is this on an existing node? Is the node part of a cluster with other servers?

root@systemd-node-1:/# curl -sfL https://get.k3s.io | sh -s - --disable=servicelb --disable=traefik
[INFO]  Finding release for channel stable
[INFO]  Using v1.31.6+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.31.6+k3s1/sha256sum-amd64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.31.6+k3s1/k3s
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s

root@systemd-node-1:/# kubectl get node,addon,service -A -o wide
NAME                  STATUS   ROLES                  AGE   VERSION        INTERNAL-IP   EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
node/systemd-node-1   Ready    control-plane,master   96s   v1.31.6+k3s1   172.17.0.4    <none>        openSUSE Leap 15.4   6.8.0-1016-aws   containerd://2.0.2-k3s2

NAMESPACE     NAME                                            SOURCE                                                                                CHECKSUM
kube-system   addon.k3s.cattle.io/aggregated-metrics-reader   /var/lib/rancher/k3s/server/manifests/metrics-server/aggregated-metrics-reader.yaml   63b058ebe88b8179b459777318be49b591fefe629d9258b10974aeed224b5530
kube-system   addon.k3s.cattle.io/auth-delegator              /var/lib/rancher/k3s/server/manifests/metrics-server/auth-delegator.yaml              f55fee16219349d1d803b7025f9fde2b6fca741e3900bfedcf64f34dc1c23786
kube-system   addon.k3s.cattle.io/auth-reader                 /var/lib/rancher/k3s/server/manifests/metrics-server/auth-reader.yaml                 97a74f054fe2972fcc6ffb909224d9cb27f136cc152983c9ac96ff45579015c2
kube-system   addon.k3s.cattle.io/ccm                         /var/lib/rancher/k3s/server/manifests/ccm.yaml                                        15c8482702cd79ec145e960ab92791a0e73b6e7577df7729ae8b523483e3cc93
kube-system   addon.k3s.cattle.io/coredns                     /var/lib/rancher/k3s/server/manifests/coredns.yaml                                    2a9569547585803532236d732be6a06ddf872b01338cdd08150c7eab1199dae2
kube-system   addon.k3s.cattle.io/local-storage               /var/lib/rancher/k3s/server/manifests/local-storage.yaml                              95a587e641bed9d12223d9204d73fb251b065b5a73f8dc63f30997bd56663850
kube-system   addon.k3s.cattle.io/metrics-apiservice          /var/lib/rancher/k3s/server/manifests/metrics-server/metrics-apiservice.yaml          03266df7891b56dfffebb855a031b524ed20c6736846417ccd491dd91c6c0ec3
kube-system   addon.k3s.cattle.io/metrics-server-deployment   /var/lib/rancher/k3s/server/manifests/metrics-server/metrics-server-deployment.yaml   ba9c558aad213754bfb7b14491a091d21891aa22b54343697186eb5db48ee2bd
kube-system   addon.k3s.cattle.io/metrics-server-service      /var/lib/rancher/k3s/server/manifests/metrics-server/metrics-server-service.yaml      0ba8f8a9133f38c226e33384b8019a882440480cb8b7b45b0cd9f62bebb06a6d
kube-system   addon.k3s.cattle.io/resource-reader             /var/lib/rancher/k3s/server/manifests/metrics-server/resource-reader.yaml             d7e21b07d9edf7a1d4e169342f470405970621de59864f998dd84c2048fb9e64
kube-system   addon.k3s.cattle.io/rolebindings                /var/lib/rancher/k3s/server/manifests/rolebindings.yaml                               83a63e513426fad207199a04a54392846e87923ecf31e3c0f1ff3e1ba7a9d1f4
kube-system   addon.k3s.cattle.io/runtimes                    /var/lib/rancher/k3s/server/manifests/runtimes.yaml                                   4ea3be58c76250c61e65a257c8279b42d11568f913233eda98ac0d77ef2a8e37

NAMESPACE     NAME                     TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)                  AGE   SELECTOR
default       service/kubernetes       ClusterIP   10.43.0.1     <none>        443/TCP                  98s   <none>
kube-system   service/kube-dns         ClusterIP   10.43.0.10    <none>        53/UDP,53/TCP,9153/TCP   94s   k8s-app=kube-dns
kube-system   service/metrics-server   ClusterIP   10.43.63.36   <none>        443/TCP                  94s   k8s-app=metrics-server

No traefik

@pwright
Copy link

pwright commented Mar 4, 2025

@brandond I'm a new user trying a single node install (testing skupper.io). Works perfect now that I see your cmds, I wasn't running as root

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

4 participants