shy-tent-66642
01/12/2023, 6:12 AMapiVersion: <http://kubelet.config.k8s.io/v1beta1|kubelet.config.k8s.io/v1beta1>
kind: KubeletConfiguration
maxPods: 250
edit /etc/systemd/system/k3s.service
to change the k3s server args:
ExecStart=/usr/local/bin/k3s \
server \
'--disable' \
'servicelb' \
'--disable' \
'traefik' \
'--kubelet-arg=config=/etc/rancher/k3s/kubelet.config'
reload systemctl to pick up the service change:
sudo systemctl daemon-reload
restart k3s:
sudo systemctl restart k3s
creamy-pencil-82913
01/12/2023, 6:23 AMshy-tent-66642
01/12/2023, 6:44 AMINSTALL_K3S_EXEC="--flannel-backend=none --disable-network-policy --cluster-cidr=192.168.0.0/16 server --disable traefik,servicelb"
Coming to the point of --kubelet-arg=max-pods how do I do that exactly on already running nodes? What if I want to change pod limit to another value few times? We are just experimenting with pod we can run. These are AMD EPYC metal nodes.creamy-pencil-82913
01/12/2023, 7:20 AMshy-tent-66642
01/12/2023, 8:46 AMcreamy-pencil-82913
01/12/2023, 8:53 AMshy-tent-66642
01/12/2023, 9:37 AMOn master
curl -sfL <https://get.k3s.io> | INSTALL_K3S_EXEC="--flannel-backend=none --disable-network-policy --cluster-cidr=192.168.0.0/16 server --disable traefik,servicelb --kubelet-arg=max-pods=350" sh -
on workers
curl -sfL <https://get.k3s.io> | K3S_URL=<https://MASTER-IP:6443> K3S_TOKEN=<token> INSTALL_K3S_EXEC="--kubelet-arg=max-pods=350" sh -
BTW, if I have to re run installed w/o the script....how can I do that? Some thing like below?
k3s server/agent INSTALL_K3S_EXEC="--flannel-backend=none --disable-network-policy --cluster-cidr=192.168.0.0/16 server --disable traefik,servicelb --kubelet-arg=max-pods=350"
k3s agent --kubelet-arg=max-pods=300 --token=<RKN> --server=<https://IP:6443>
creamy-pencil-82913
01/12/2023, 10:28 AMshy-tent-66642
01/12/2023, 10:43 AMk3s agent K3S_URL=<https://MASTER-IP:6443> K3S_TOKEN=<token> INSTALL_K3S_EXEC="--kubelet-arg=max-pods=350"
multiple times (with different value of kubelet-arg) on agent node, the k3s agent services just hangs in second attempt and nodes goes into unready state. I could only got script installation to reruncreamy-pencil-82913
01/12/2023, 5:12 PMk3s agent
itselfshy-tent-66642
01/13/2023, 6:55 AMk3s agent --kubelet-arg=max-pods=300 --token=<RKN> --server=<https://IP:6443>
with max pod values multiple times and that kind of hanged the k3s agent on node which caused node to become notready state