bootstrap-node

X-McKay's avatarfrom X-McKay

Bootstrap a new node for Kubernetes without joining it to the cluster. Use when preparing nodes in advance, testing setup, or staging hardware.

⭐1stars🔀0forks📁View on GitHub🕐Updated Jan 3, 2026

When & Why to Use This Skill

This Claude skill automates the initial bootstrapping and preparation of Kubernetes nodes using Ansible and Tailscale. It streamlines infrastructure management by handling system updates, security hardening, SSH configuration, and kernel optimization, ensuring nodes are fully prepared and compliant before they are officially joined to a cluster.

Use Cases

  • Pre-staging Hardware: Efficiently prepare multiple worker nodes in advance, ensuring all system dependencies and networking requirements are met before a scheduled cluster expansion.
  • Infrastructure Testing: Validate the bootstrap process and system configurations on new physical or virtual machines in a sandbox environment without impacting the live production cluster.
  • Automated Security Hardening: Standardize the deployment of security policies, including disabling password authentication, configuring UFW firewalls, and setting up passwordless sudo across all new infrastructure.
  • Hybrid Cloud Networking: Simplify the integration of remote or edge nodes into a Kubernetes environment by automating Tailscale setup and IP forwarding configurations.
namebootstrap-node
descriptionBootstrap a new node for Kubernetes without joining it to the cluster. Use when preparing nodes in advance, testing setup, or staging hardware.

Bootstrap a New Node

Prepare a node for Kubernetes cluster membership without actually joining it.

Useful when:

  • Preparing multiple nodes before adding them
  • Testing the bootstrap process
  • Setting up nodes that will be added later

Instructions

Step 1: Verify Tailscale Connectivity

tailscale status | grep -i <node_name>

Get the Tailscale IP address.

Step 2: Ensure Node in Inventory

Check ansible/inventory/hosts.yml, add if missing:

workers:
  hosts:
    <node_name>:
      ansible_host: <tailscale_ip>
      tailscale_ip: <tailscale_ip>
      reserved_cpu: "2"
      reserved_memory: "4Gi"
      node_labels:
        node-role: worker
        workstation: "true"

bootstrap:
  hosts:
    <node_name>: {}

Step 3: Setup SSH Access

ssh -o BatchMode=yes -o ConnectTimeout=5 <tailscale_ip> echo "SSH OK" 2>/dev/null

If fails: ssh-copy-id <user>@<tailscale_ip>

Step 4: Run Bootstrap Playbook

cd /home/al/git/kubani
ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/bootstrap_node.yml --limit <node_name>

Step 5: Validate

ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/preflight_checks.yml --limit <node_name>

What Bootstrap Does

  • Updates system packages
  • Installs: curl, git, vim, htop, jq, iptables, conntrack
  • Configures Tailscale
  • Sets up SSH key authentication
  • Hardens SSH (disables password auth, root login)
  • Configures passwordless sudo
  • Sets hostname and timezone
  • Enables IP forwarding and bridge netfilter
  • Loads kernel modules (br_netfilter, overlay)
  • Disables swap
  • Configures UFW firewall

Next Steps

Add to cluster with:

ansible-playbook -i ansible/inventory/hosts.yml ansible/playbooks/add_node.yml --limit "<node_name>,sparky"

Or use the add-node skill.