fix(k3s-server): harden isolated control-plane bootstrap

- pin kube-vip and cluster traffic to the private guest interface\n- disable disposable guest firewalls and verify API reachability before joins\n- keep control-plane orchestration on the primary and preserve failure diagnostics
This commit is contained in:
Timothy Stewart
2026-07-31 22:31:52 -05:00
committed by Techno Tim
parent 9b220c1629
commit 57a22e364d
9 changed files with 93 additions and 51 deletions
+3
View File
@@ -7,6 +7,9 @@
# See:
# https://github.com/flannel-io/flannel/blob/67d603aaf45ef80f5dd39f43714fc5e6f8a637eb/Documentation/troubleshooting.md#Vagrant
flannel_iface: eth1
# kube-vip cannot infer the cluster interface in these multi-NIC
# Vagrant guests because the default route is on eth0.
kube_vip_iface: eth1
# The test VMs might be a bit slow, so we give them more time to join the cluster:
retry_count: 45
+13 -7
View File
@@ -6,20 +6,26 @@
- name: Network setup
hosts: all
tasks:
- name: Disable firewalld
when: ansible_distribution == "Rocky"
# Rocky Linux comes with firewalld enabled. It blocks some of the network
# connections needed for our k3s cluster. For our test setup, we just disable
# it since the VM host's firewall is still active for connections to and from
# the Internet.
- name: Gather service facts
ansible.builtin.service_facts:
- name: Disable guest firewall services
# The disposable test guests use an isolated VirtualBox network. A distro
# firewall can allow ICMP while silently blocking the inter-node Kubernetes
# API connection, so disable the known guest firewalls consistently.
# When building your own cluster, please DO NOT blindly copy this. Instead,
# please create a custom firewall configuration that fits your network design
# and security needs.
ansible.builtin.systemd:
name: firewalld
name: "{{ item }}"
enabled: false
state: stopped
become: true
loop:
- firewalld.service
- nftables.service
- ufw.service
when: item in ansible_facts.services
- name: Verify the private cluster interface
ansible.builtin.assert: