This playbook allow you to deploy Ubuntu 22.04 VMs to Vsphere and configure them as k8s nodes.
Dualstack, IPv6 prefer, keepalived.
RKE2, MetalLB, Rancher.
Upgrade possible, but not tested. New node addining possible, but not tested.
-
Clone repository to your local machine
-
Open repository directory and run prepare-environment.pl, like next
./prepare-environment.pl
-
When environment will be ready you will see Virtual environment successfully prepeared. in console
-
Run playbook with run_playbook.sh script, like next
./run_playbook.sh -i inventory/<inventory file> <playbook yml file>
- vmware/secrets.yml - vSphere secrets
- ssh_key - add private and public ansible user keys (by default id_ed25519 and id_ed25519.pub)
- inventories/main/vmware.yml - vSphere and ESXi nodes
- inventories/devel/rke2-devel-0.yml - contain information about VMs to deploy
- roles/ubuntu/vars/users.yml - You can add some additional users
- roles/vmware/vars/local-vars.yml.tmpl - evaluate this template with required VM details
- roles/rke2/vars/common/deployment_version.yml - rke2 and other version
- roles/rke2/vars/common/domains.yml - cluster top domain names
- roles/rke2/vars/common/rke2.yml - rke2 configuration
- roles/rke2/vars/rke2-devel.yml - cluster IPs, MetalLB BGP/BFD/Pools details
- roles/rke2/templates/server-manifests - server manifests
- roles/rke2/templates/agent-manifests - agent manifests
Note: Need to update roles/rke2/vars/common/rke2.yml after adding new manifest
Deploy VMs:
./run_playbook.sh -i inventories/main/ -i inventories/devel/rke2-devel-0.yml deploy-rke2-cluster-devel.yml
Deploy k8s:
./run_playbook.sh -i inventories/main -i inventories/devel/rke2-devel-0.yml deploy-rke2-nodes-devel.yml
MIT
RKE part based on Labyrinth Labs.