- Bump Kubespray baseline to release-2.28 (last release supporting Ubuntu 20.04) - Upgrade Kubernetes control plane and node to v1.32.13 - Configure single-node cluster settings (drain_nodes: false) - Add patch for Kubespray v1beta4 kubeadm preflight error handling - Update init.sh, AGENTS.md, and README.md with two-phase upgrade instructions
2.4 KiB
2.4 KiB
AGENTS.md
Note
This directory handles the bootstrapping and provisioning of the Haumdaucher Kubernetes cluster using Kubespray.
Project Overview
- Tool: Kubespray (Ansible-based).
- Method: The local
inventory/is the source of truth, which is synced into a checked-out Kubespray repository. - Idempotency: The process is designed to be repeatable. The
kubesprayfolder is treated as ephemeral and is re-created byinit.sh.
Workflow & Scripts
The core workflow is encapsulated in init.sh.
init.sh
Purpose: Prepares the environment and Kubespray for deployment. Actions:
- Clean Slate: Deletes existing
kubespray/directory. - Clone: Clones Kubespray (version defined in variable
VERSION, e.g.,release-2.28). - Environment: Sets up Python virtualenv via
pyenvand installsrequirements.txt. - Sync: Copies local
./inventory/configurations into./kubespray/inventory/.
Usage
- Source the script:
source init.sh - Deploy / Upgrade:
After sourcing, go to the
kubespraydirectory and run the Ansible playbooks as instructed by the script output.- Phase 1: Reconcile Kubespray baseline (stay on current k8s version):
cd kubespray ansible-playbook -i inventory/prod/inventory.ini cluster.yml - Phase 2: Upgrade Kubernetes version (e.g. to v1.32.13):
Update
kube_versionininventory/prod/group_vars/k8s_cluster/k8s-cluster.yml, re-sync, and run:cd kubespray ansible-playbook -i inventory/prod/inventory.ini -e upgrade_cluster_setup=true cluster.yml
- Phase 1: Reconcile Kubespray baseline (stay on current k8s version):
Directory Structure
init.sh: The entry point script. Source of truth for Kubespray version.inventory/: Contains cluster inventory configurations (hosts, variables). Edit this, not the one inkubespray/.kubespray/: (Ignored/Ephemeral) The checked-out Kubespray repository. Do not edit files here directly; they will be overwritten.
Configuration Updates
To upgrade Kubespray or change cluster config:
- Version Upgrade: Update
VERSIONininit.sh(e.g., torelease-2.28). - Config Changes: Modify files in
./inventory/. - Apply: Run
source init.shthen execute the Ansible playbook.