Ansible Bare Metal HA K8S

Abstract

This is a set of roles that will initialize a primary control plane, then join secondary and tertiary control planes to a HA k8s cluster.

Ansible Bare Metal HA K8S#

GitHub Actions Workflow Status GitHub CodeQL GitHub Pages Status GitHub Actions Workflow Status

Playbook#

site.yml

---
###
# ```{rubric} The main site deployment
# ```
# ---
# This playbook defines the primary site deployment code for this repository.
#
# ```{literalinclude} /site.yml
# :language: yaml
# ```
- name: Reset Kubernetes Control Planes
  hosts: kcp
  become: true
  roles:
    - role: reset
      tags:
        - reset
- name: Initialize the first control plane
  hosts: kcp01_init
  become: true
  roles:
    - role: kv
      tags:
        - kv
    - role: init
      tags:
        - init
- name: Join the secondary and tertiary control planes
  hosts: kcp_join
  become: true
  roles:
    - role: join
      tags:
        - join
- name: Deploy Calico CNI
  hosts: local
  roles:
    - role: calico
      tags:
        - calico

Roles#

digraph roles {
   reset -> init -> join -> kv
}

Readme#

References#

Indices and tables#

Glossary#

Calico#

Calico is a networking and security solution that enables Kubernetes workloads and non-Kubernetes/legacy workloads to communicate seamlessly and securely. More information is available here.

CNI#

Container Network Interface used to manage networking between and inside clusters.

HA#

High Availability; in this context we mean specifically HA k8s clusters as described here.

kubeadm#

A program that allows the creation and management of Kubernetes clusters with the command line. More information is available here.

kubeconfig#

A file that contains context and authentication information for one or more K8S clusters. Usually kept in a folder in a user’s home directory (.kube/config).

kube-vip#

A network stack that can be used to enable cloud-style network resources on a bare metal K8S cluster. More information is available here.

kubie#

A handy tool for switching k8s contexts and namespaces. More information is available here.

K8S#

Kubernetes; Ancient Greek for navigator or guide, in modern English usage it is a container orchestration system designed by Google and documented here.