Skip to content

Instantly share code, notes, and snippets.

@shantur
Created May 31, 2025 20:21
Show Gist options
  • Save shantur/166f22c58cdc68e801a054b135b56129 to your computer and use it in GitHub Desktop.
Save shantur/166f22c58cdc68e801a054b135b56129 to your computer and use it in GitHub Desktop.
#!/bin/bash
sudo mkdir -p /etc/rancher/k3s/
sudo cat << EOF | sudo tee /etc/rancher/k3s/config.yaml
write-kubeconfig-mode: "0644"
tls-san:
- "k.m.lab.rathore.me"
disable:
- servicelb
- local-storage
- traefik
- metrics-server
token: manag3m3ntClust3r
disable-network-policy: true
disable-kube-proxy: true
disable-cloud-controller: true
EOF
hostname=$(hostname)
[ "$hostname" == "node1" ] && curl -sfL https://get.k3s.io | sh -s - --cluster-init
[ "$hostname" != "node1" ] && curl -sfL https://get.k3s.io | sh -s - --server "https://node1:6443"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment