Skip to content

Latest commit

 

History

History

ansible

Ansible Server configuration

kubespray kubernetes

Ansible playbook for basic server setup and then bootstrap a kubernetes-sigs/kubespray cluster.

Tested environment

Hardware

Operating System

  • Debian 11

Operations

Create a Python environment and then pip install -r kubespray/requirements.txt.

See official documentation site for common operations like create/modify/delete clusters.

Upgrade cluster

Kubespray community recommends copying the sample group_vars and then maintaining it separately. But how do you receve future updates the community made

To upgrade the cluster from kubespray release v1 to v2:

# 1. In the submodule, checkout the next available version:
cd kubespray
git fetch --all
git checkout v2

# 2. Generate a patch file with all the upstream changes in `group_vars`.
cd inventory/sample
git diff --relative v1 v2 group_vars > /tmp/group_vars.diff

# 3. Apply the diff to the copy, inspect carefully, fix all the conflicts
cd ../../../inventory
patch -s -p1 < /tmp/group_vars.diff

# 4. Upgrade the ansible python environment
cd ..
pip install --upgrade -r kubespray/requirements.txt

# 5. Follow official docs instruction to upgrade the cluster