2.2 KiB
2.2 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.27). - 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.- Standard Run:
cd kubespray ansible-playbook -i inventory/prod/inventory.ini cluster.yml - Forced Upgrade:
cd kubespray ansible-playbook -i inventory/prod/inventory.ini -e upgrade_cluster_setup=true cluster.yml
- Standard Run:
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.