#!/sbin/openrc-run # K3s server control plane. The per-cluster config.yaml sets cluster-init, so # k3s uses the embedded etcd datastore (required for multi-server HA). Data # lives at /var/lib/rancher/k3s; subsequent starts reuse it. description="K3s Kubernetes server (Mulga EKS control plane)" command="/usr/local/bin/k3s" command_args="server --config /etc/rancher/k3s/config.yaml" pidfile="/run/k3s.pid" # Supervise the apiserver. A transient k3s crash must self-heal: without a # supervisor a single exit leaves the control plane permanently dead, the NLB # target never recovers, and the cluster wedges ACTIVE-but-unreachable. supervisor="supervise-daemon" respawn_delay=5 respawn_max=0 output_log="/var/log/k3s.log" error_log="/var/log/k3s.log" depend() { need net cgroups after firewall } start_pre() { # k3s-prestart reproduces the guard/derive/stage steps this start_pre used # to run inline (restore-block guard, config.yaml.skel fallback, # konnectivity-agent + CoreDNS manifest staging, token-webhook kubeconfig # wait), shared with the systemd unit that will eventually replace this # runscript. /usr/local/sbin/k3s-prestart }