prole/infrastructure/playbooks/k3s_reset.yml
chrisfu 2c6df07933 Harden monitoring init; improve k3s reset cleanup
- Add diagnostics/reset/retry logic for stuck monitoring Helm installs\n- Add optional cluster-side node/lease deletion during k3s reset via delegated control-plane\n- Bump prole-db image tag/version to 18-123\n- Update monitoring init unit test for reset/diagnostics path
2026-03-15 16:02:15 -07:00

35 lines
1.1 KiB
YAML

---
- name: Reset k3s nodes and reinstall with vault token
hosts: k3s_hosts
become: true
serial: 1
vars:
# During a reset we want to proactively remove the node object from the cluster
# (via a healthy control-plane host) before shutting down local k3s services.
# This prevents stale `NotReady` nodes, DaemonSet pods stuck `Terminating`, and
# `kube-node-lease` entries that can cause future joins/reinstalls to hang.
k3s_reset_force_cluster_node_delete: true
tasks:
- name: Ensure cgroup kernel params are set
ansible.builtin.import_role:
name: cgroups
- name: Remove existing k3s installation and data
ansible.builtin.import_role:
name: k3s
tasks_from: cleanup
- name: Reinstall and configure k3s
ansible.builtin.import_role:
name: k3s
- name: Refresh kubeconfig on controller after reset
hosts: k3s_hosts
gather_facts: false
run_once: true
tasks:
- name: Fetch and save kubeconfig on controller
ansible.builtin.import_role:
name: k3s
tasks_from: fetch_kubeconfig