Bare Metal HA k8s roles

Abstract

This is the index for roles to use Kubeadm to configure or reset a bare metal Kubernetes cluster.

Bare Metal HA k8s roles#

Roles#

There are three roles here, they should be run in a specific order as described in the usage section below.

HA K8S Ansible Usage#

To use these roles effectively, you’ll need have an inventory file available at /etc/ansible/hosts.yml that describes all of the groups listed in the site.yml at the root of this repository. With that in hand, the way to use these roles is this.

  1. Reset any existing cluster.

    ansible-playbook -t reset site.yml
    
  2. Initialize the primary control plane.

    ansible-playbook -t init site.yml
    
  3. Join remaining control planes.

    ansible-playbook -t join site.yml
    
  4. Enable Kube-VIP on the control planes.

    ansible-playbook -t kv site.yml
    
  5. Copy your updated kubeconfig from the init role’s file folder to the appropriate directory.

    cp roles/init/files/admin.conf $HOME/.kube/config
    
  6. Verify that your connection works and the cluster is up.

    kubectl get nodes
    

    If everything worked you should see output similar to this.

    NAME                STATUS   ROLES           AGE   VERSION
    kcp01.example.com   Ready    control-plane   51m   v1.30.3
    kcp02.example.com   Ready    control-plane   50m   v1.30.3
    kcp03.example.com   Ready    control-plane   50m   v1.30.3
    

Individual role details#