homelab/ansible/playbooks/setup-k3s.yaml

28 lines
772 B
YAML

---
# Run: ansible-playbook -i ansible/inventory.yml ansible/playbooks/setup-k3s.yml
#
# What this does:
# - Installs K3s in server mode (with Traefik disabled)
# - Installs Helm
# - Fetches kubeconfig to /tmp/k3s-minisforum.yaml on your workstation
# - Labels the node as node-role=primary
#
# After this playbook:
# export KUBECONFIG=/tmp/k3s-minisforum.yaml
# kubectl get nodes # should show minisforum as Ready
#
# Then deploy Traefik:
# helm repo add traefik https://helm.traefik.io/traefik
# helm repo update
# helm upgrade --install traefik traefik/traefik \
# --namespace traefik --create-namespace \
# -f values/traefik.yml
- name: Install K3s server
hosts: minisforum
become: true
gather_facts: true
roles:
- k3s-server