Skip to content

Automates the creation of a K3S cluster running in Multipass virtual machines

License

Notifications You must be signed in to change notification settings

krizsan/k3s-cluster-ansible

Repository files navigation

k3s-cluster-ansible

Ansible role that automates the creation of a K3S cluster running in Multipass virtual machines.

Prerequisites

Using this Ansible role to create a K3S cluster according to the instructions below require the following:

  • Multipass
  • Ansible
  • Molecule
  • Kubectl

Usage

From the root of this project:

  1. Install the collection:
    ansible-galaxy collection install k3s_cluster --force
  2. Create a K3S cluster running in Multipass VMs as specified in the inventory.yml file in project root:
    ansible-playbook -i inventory.yml k3s-cluster-create.yml
  3. Update kubectl configuration on the local computer as to manage the K3S cluster:
    ansible-playbook -i inventory.yml kubectl-local-config.yml
  4. Verify K3S cluster:
    kubectl cluster-info
    kubectl get nodes
  5. Tear down the K3S cluster including deleting the Multipass VMs:
    ansible-playbook -i inventory.yml k3s-cluster-teardown.yml



The K3S cluster is defined in the inventory.yml file. Currently only one master node per cluster is supported.

Please refer to the README in the k3scluster role (k3s_cluster/roles/k3scluster/README.md) for instructions on how to set up a K3S cluster using Molecule.

About

Automates the creation of a K3S cluster running in Multipass virtual machines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages