Installation#
Requirements#
- git
- ansible
- kubectl
- helm
Preparation#
- Clone this repository
- Configure pre-commit-hooks
- Adapt ansible vars to your needs. The default variables are located in
ansible/group_vars/all/main.yaml. You can override them by creating environment-specific variable files inansible/group_vars/production/oransible/group_vars/staging/.
For example, to set the VIP for your production environment, create ansible/group_vars/production/main.yaml with the following content:
- Install required ansible modules
Ansible inventory#
The inventory is now structured by environment (e.g., production, staging) inside the ansible/inventory/ directory. This playbook requires the following host groups:
k3s_primary_server: The first server node that initializes the cluster.k3s_secondary_server: Additional server nodes to join the cluster for HA.k3s_agent: The agent/worker nodes.
Example for ansible/inventory/production/hosts:
Installation#
Run ansible from within the ansible folder. Specify the inventory for your target environment.
Ansible downloads the kubeconfig file to the folder ./shared/${HOSTNAME}/k3s.yaml file. You can use this file to access the cluster.
To get the validity of the kubeconfig file, you can use the following command (either replace $KUBECONFIG with the path to the kubeconfig file or set it as environment variable):
Removal#
ArgoCD#
Get the ArgoCD Login password for the admin user:
Remove ArgoCD
