k3s | ip changed
-
Installed and using systemd
-
example master node installed and joined
Bash
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik --write-kubeconfig-mode=644" K3S_TOKEN="K10fc17d45f6d25cbac8XXXXXXXXXXXXXXXXXXX7ddfaa85bb939b5beeb94a::server:2dfd01XXXXXXXXX85c54fc011" sh -s - server --server https://cluster.example.dev:6443 --tls-san=100.90.76.124,192.168.0.54,cluster.example.dev
- the ip 100.90.76.124 has changed, so find it and changed it in systemd with the new one
Edit
Systemd
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
Wants=network-online.target
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
EnvironmentFile=-/etc/default/%N
EnvironmentFile=-/etc/sysconfig/%N
EnvironmentFile=-/etc/systemd/system/k3s.service.env
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
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service 2>/dev/null'
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s \
server \
'--disable=traefik' \
'--write-kubeconfig-mode=644' \
'server' \
'--server' \
'https://jev-cluster.kafana.dev:6443' \
'--tls-san=100.98.146.143,192.168.0.54,example.domain.dev' \
or