This commit is contained in:
Eric Meehan 2024-09-24 10:00:07 -04:00
parent e2e172471c
commit 3e51c67453
4 changed files with 60 additions and 1 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "roles/ericomeehan.nvidia_driver"]
path = roles/ericomeehan.nvidia_driver
url = https://git.eom.dev/ansible-role-nvidia-driver
[submodule "roles/ericomeehan.kraken-bot"]
path = roles/ericomeehan.kraken-bot
url = https://git.eom.dev/ansible-role-kraken-bot

55
cluster-host.yml Normal file
View File

@ -0,0 +1,55 @@
---
# Playbook for deploying a Kubernetes cluster on QEMU
- name: Prepare virtualization environment
hosts: alpha-worker-0
become: true
tasks:
- name: Install QEMU
apt:
state: present
name:
- qemu-system
- libvirt-daemon-system
- name: Create network bridge for cluster
- name: Create control plane
- name: Create workers
- name: Start cluster
- name: Initialize cluster nodes
hosts: clusters
become: true
roles:
- role: ericomeehan.debian
- role: ericomeehan.ericomeehan
- name: Install Kubernetes on cluster nodes
hosts: #TODO: get cluster nodes dynamically
become: true
pre_tasks:
- name: Update sysctl configuration to enable IPv4 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv4.ip_forward = 1'
state: present
- name: Update sysctl configuration to enable IPv6 packet forwarding
lineinfile:
path: /etc/sysctl.conf
line: 'net.ipv6.conf.all.forwarding = 1'
state: present
- name: Reload sysctl configuration
command: sysctl --system
- name: Enable br_netfilter kernel module
command: modprobe br_netfilter
- name: Add the module to a configuration file for persistence
lineinfile:
path: /etc/modules-load.d/modules.conf
line: "br_netfilter"
- name: Install kubernetes library
apt:
name: python3-kubernetes
state: present
roles:
- role: geerlingguy.containerd
- role: geerlingguy.kubernetes
- role: geerlingguy.helm
when: kubernetes_role == 'control_plane'

View File

@ -4,4 +4,4 @@
hosts: alpha-control-plane
become: true
roles:
- role: ericomeehan.pykraken
- role: ericomeehan.kraken-bot

@ -0,0 +1 @@
Subproject commit 45c0352dde33deab8c7a1a62f0d289014c617154