HA K8S Kube-VIP

Contents

Abstract

This role creates and installs a Kube-VIP manifest onto all control planes.

HA K8S Kube-VIP#

Deployment of HA K8S Clusters with Kubeadm is helped with use of the tool kube-vip. This role uses the static pods version of the network, which is best for bare metal deployments.

Tasks#

This role enables kube-vip for cluster networking. This role should be run after the join role and before the flannel role.

---
- name: Ensure manifests directory
  ansible.builtin.file:
    state: directory
    recurse: true
    dest: /etc/kubernetes/manifests
    owner: kube
    group: kube
    mode: ug+rw,o+r
- name: Install prerequisites for creating the manifest
  community.general.pacman:
    name: "{{ item }}"
    state: present
  loop:
    - curl
    - jq
- name: Update the bash rc file
  ansible.builtin.template:
    src: bashrc.j2
    dest: /root/.bashrc
    owner: root
    group: root
    mode: ug+rw,o-rwx
- name: Deploy the manifest
  ansible.builtin.template:
    src: kube-vip.yaml
    dest: /etc/kubernetes/manifests/kube-vip.yaml
    owner: kube
    group: kube
    mode: ug+rw,g-rwx

Section author: Xander Harris xandertheharris@gmail.com