This set of Ansible playbooks implements the guide at turingpi.com to setup a K3S cluster on top of a Turing Pi 2 cluster.
- Python3
- Ansible
-
Clone the repo
-
cd /path/to/repo
-
Create a venv
python -m venv /path/to/project/venv
- Activate the venv
source /path/to/project/venv/bin/activate
- Install venv dependencies
/path/to/project/venv/bin/pip install -r ./requirements.txt
- List all nodes
ansible all -i ./inventory --list-hosts
- Ping nodes
ansible all -m ping -i ./inventory.yaml
- Apply cluster node role
This role properly sets up nodes in the cluster so they can talk to each other.
ansible-playbook -i ./inventory.yaml ./roles/01-cluster-node.yaml
- Apply storage node role
This role configures the ssd to be mounted at /data.
ansible-playbook -i ./inventory.yaml ./roles/02-storage-node.yaml
- Apply kubernetes control role
This role conifugres Kubernetes control nodes and enables support for Helm and Arkade.
ansible-playbook -i ./inventory.yaml ./roles/03-kubernetes-control.yaml
- Apply kubernetes agent role
This role configures the Kubernetes agent nodes and connects them to the K3S cluster.
ansible-playbook -i ./inventory.yaml ./roles/04-kubernetes-agent.yaml
- Apply kubernetes networking role
This role configures metallb in the K3S cluster so you can allocate IP Address to services using a load balancer.
ansible-playbook -i ./inventory.yaml ./roles/05-kubernetes-network.yaml
- Apply kubernetes cd role
Configures ArgoCD in the cluster and exposes it on a predefined LB port.
ansible-playbook -i ./inventory.yaml ./roles/07-kubernetes-cd.yaml
- Apply kubernetes monitoring role
Configures Prometheus, Grafana, and AlertManager.
ansible-playbook -i ./inventory.yaml ./roles/08-kubernetes-monitoring.yaml