Go to file
2024-07-08 17:59:17 +00:00
.vault prune old address, add basic template files 2024-06-06 20:05:18 +00:00
files/manifests move dns secret to template and k8s-vault, fix leading . in wildcard cert, disable traefil, add nginx-ingress 2024-07-08 17:59:17 +00:00
group_vars move dns secret to template and k8s-vault, fix leading . in wildcard cert, disable traefil, add nginx-ingress 2024-07-08 17:59:17 +00:00
host_vars new 2024-06-21 13:56:13 -04:00
roles prune old address, add basic template files 2024-06-06 20:05:18 +00:00
.gitignore prune old address, add basic template files 2024-06-06 20:05:18 +00:00
ansible.cfg prune old address, add basic template files 2024-06-06 20:05:18 +00:00
hosts new 2024-06-21 13:56:13 -04:00
README.md prune old address, add basic template files 2024-06-06 20:05:18 +00:00
site.yml prune old address, add basic template files 2024-06-06 20:05:18 +00:00

Ansible Playbook to setup a simple k8s cluster

Checkout repo and switch to the directorty ~/lx-cad-deploy

Install ansible via virtual env

sudo apt install python3-pip python3.10-venv
python3.10 -m venv ~/.local/venv/ansible
source ~/.local/venv/ansible/bin/activate
pip install ansible
ansible --version

Install required roles:

ansible-galaxy install -f -p roles -r roles/requirements.yml

Generate token for the cluster, this assumes ansible vault has been setup

./roles/k8s/files/token-vault.sh ./group_vars/lx_cad/k8s-vault.yml

Configure firewalld and nginx for hosts

ansible-playbook -i hosts site.yml --tags=firewalld,nginx

Install Stack Orchestrator for control hosts

ansible-playbook -i hosts site.yml --tags=so --limit=so

Deploy k8s

ansible-playbook -i hosts site.yml --tags=k8s --limit=lx_cad

Install k8s helper tools

sudo ~/lx-cad-deploy/roles/k8s/files/get-kube-tools.sh

Verify cluster creation

kubie ctx lx-cad
kubectl get nodes -o wide

DNS Secret example

apiVersion: v1
data:
  access-token: XXX
kind: Secret
metadata:
  name: someprovider-dns
  namespace: cert-manager