PyratLabs / ansible-role-k3s

Ansible role for installing k3s as either a standalone server or HA cluster.
BSD 3-Clause "New" or "Revised" License
627 stars 135 forks source link

Unable to disable kube-proxy anymore after moving to file-based config #199

Closed samip5 closed 1 year ago

samip5 commented 1 year ago

Summary

Previously to 9b800d9fba3eff1a286a3a7c5639cd6543989d84 there was a config option to disable kube-proxy via an arg, but that was removed in that commit, without adding it back again.

Issue Type

Controller Environment and Configuration

v3.3.1

Steps to Reproduce

k3s_disable_kube_proxy: true

Expected Result

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

[Service]
Type=notify
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server --disable-kube-proxy --config /etc/rancher/k3s/config.yaml 
KillMode=process
Delegate=yes
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target

Actual Result

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

[Service]
Type=notify
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s server --config /etc/rancher/k3s/config.yaml 
KillMode=process
Delegate=yes
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=always
RestartSec=5s

[Install]
WantedBy=multi-user.target
xanmanning commented 1 year ago

https://github.com/PyratLabs/ansible-role-k3s#server-control-plane-configuration

See example in this section, add kube-proxy to list of items to be disabled.

samip5 commented 1 year ago

https://github.com/PyratLabs/ansible-role-k3s#server-control-plane-configuration

See example in this section, add kube-proxy to list of items to be disabled.

Unfortunately, it's not allowed there by k3s (as in it will not disable it if it's there). It needs to be after server argument and not from a config file.

Flag `--disable`: Do not deploy packaged components and delete any deployed components (valid items: coredns, servicelb, traefik,local-storage, metrics-server)
xanmanning commented 1 year ago

Add disable-kube-proxy ?

Whatever is in the config file becomes a flag

onedr0p commented 1 year ago

@samip5 you can see how I am doing it here

https://github.com/onedr0p/home-ops/blob/f60fde4304d3675dce504d7034825b8298d9bacf/ansible/kubernetes/inventory/group_vars/master/k3s.yml