Compare commits
10 Commits
573afc50a4
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 0c1c1a24ee | |||
| 9a5c8288b0 | |||
| f946f0f2bf | |||
| 80d48e6f46 | |||
| 8dc6ac2939 | |||
| 7f80884082 | |||
| 9abb0b010e | |||
| aa0e9f37bf | |||
| 5613699540 | |||
| 03dc10c0e5 |
@@ -3,6 +3,7 @@
|
||||
terraform.tfstate
|
||||
terraform.tfstate.backup
|
||||
ansible/lookup_plugins
|
||||
ansible/galaxy_roles
|
||||
|
||||
!.gitignore
|
||||
!.editorconfig
|
||||
|
||||
@@ -4,16 +4,17 @@ opentofu_dir := "infra/"
|
||||
ansible_proton_pass_plugin_ref := "4bd0741c347646060ec59c73f8adf7ed8e706cf3"
|
||||
ansible_proton_pass_plugin_url := "https://raw.githubusercontent.com/protonpass/proton-pass-ansible-integration/" + ansible_proton_pass_plugin_ref + "/lookup_plugins/proton_pass.py"
|
||||
|
||||
init: tofu-init fetch-ansible-deps fetch-ansible-plugins
|
||||
up: tofu-apply ansible-run-playbook
|
||||
down: tofu-destroy
|
||||
|
||||
tofu-init:
|
||||
tofu -chdir={{ opentofu_dir }} init -upgrade
|
||||
|
||||
tofu-apply: tofu-init
|
||||
tofu-apply:
|
||||
tofu -chdir={{ opentofu_dir }} apply -auto-approve
|
||||
|
||||
tofu-destroy: tofu-init
|
||||
tofu-destroy:
|
||||
tofu -chdir={{ opentofu_dir }} apply -auto-approve -destroy
|
||||
|
||||
tofu-destroy-instances:
|
||||
@@ -30,6 +31,9 @@ headlamp:
|
||||
clean: tofu-destroy
|
||||
git clean -fdx
|
||||
|
||||
fetch-plugins:
|
||||
fetch-ansible-deps:
|
||||
ansible-galaxy install --role-file ansible/requirements.yml --roles-path ansible/galaxy_roles
|
||||
|
||||
fetch-ansible-plugins:
|
||||
mkdir -p ansible/lookup_plugins
|
||||
curl -fsSL -o ansible/lookup_plugins/proton_pass.py {{ ansible_proton_pass_plugin_url }}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[defaults]
|
||||
roles_path = ansible/roles:ansible/galaxy_roles
|
||||
lookup_plugins = ansible/lookup_plugins
|
||||
callback_result_format = yaml
|
||||
|
||||
@@ -2,5 +2,6 @@ ansible_python_interpreter: /usr/bin/python3
|
||||
ansible_user: kolibri
|
||||
vip_interface: enp5s0
|
||||
vip_address: 10.150.0.100
|
||||
cluster_name: hive
|
||||
cluster_pod_subnet: 172.16.0.0/16
|
||||
cluster_service_subnet: 10.96.0.0/16
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Configure performance tuning
|
||||
hosts: all
|
||||
become: true
|
||||
roles:
|
||||
- giovtorres.tuned
|
||||
- irqbalance
|
||||
@@ -10,6 +10,7 @@
|
||||
groups:
|
||||
- sudo
|
||||
shell: /bin/bash
|
||||
system: true
|
||||
|
||||
- name: Ensure authorised keys for Kolibri
|
||||
ansible.posix.authorized_key:
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
collections:
|
||||
- ansible.posix
|
||||
roles:
|
||||
- name: giovtorres.tuned
|
||||
version: 2.0.2
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Install irqbalance
|
||||
ansible.builtin.package:
|
||||
name: irqbalance
|
||||
state: present
|
||||
|
||||
- name: Ensure irqbalance service
|
||||
ansible.builtin.service:
|
||||
name: irqbalance
|
||||
state: started
|
||||
enabled: true
|
||||
@@ -2,13 +2,13 @@
|
||||
ansible.builtin.import_tasks: kube-vip.yaml
|
||||
|
||||
- name: Initialise Kubernetes cluster
|
||||
ansible.builtin.include_tasks: init-cluster.yaml
|
||||
ansible.builtin.import_tasks: init-cluster.yaml
|
||||
|
||||
- name: Join nodes as control planes
|
||||
ansible.builtin.include_tasks: join-cluster.yaml
|
||||
ansible.builtin.import_tasks: join-cluster.yaml
|
||||
|
||||
- name: Copy Kubernetes admin configuration on all nodes
|
||||
ansible.builtin.include_tasks: copy-config.yaml
|
||||
ansible.builtin.import_tasks: copy-config.yaml
|
||||
|
||||
- name: Remove control plane scheduling restrictions
|
||||
ansible.builtin.include_tasks: untaint.yaml
|
||||
ansible.builtin.import_tasks: untaint.yaml
|
||||
|
||||
+3
-4
@@ -1,3 +1,6 @@
|
||||
- name: Apply power and performance settings
|
||||
ansible.builtin.import_playbook: playbooks/performance.yaml
|
||||
|
||||
- name: Baseline configuration
|
||||
hosts: all
|
||||
become: true
|
||||
@@ -5,10 +8,6 @@
|
||||
- common
|
||||
- kubernetes_common
|
||||
|
||||
# ========================
|
||||
# Setup Kubernetes Cluster
|
||||
# ========================
|
||||
|
||||
- name: Initialise Kubernetes Cluster
|
||||
hosts: masters
|
||||
become: true
|
||||
|
||||
+4
-8
@@ -3,14 +3,10 @@
|
||||
# ------
|
||||
|
||||
locals {
|
||||
image = "ubuntu/26.04"
|
||||
root_disk_size = "16GiB"
|
||||
ext_disk_size = "16GiB"
|
||||
network_cidr = "10.150.0.1/24"
|
||||
|
||||
master_count = 3
|
||||
worker_count = 0
|
||||
|
||||
image = "ubuntu/26.04"
|
||||
}
|
||||
|
||||
# ---------
|
||||
@@ -46,7 +42,7 @@ resource "incus_network" "this" {
|
||||
|
||||
module "master" {
|
||||
source = "./modules/incus_vm"
|
||||
count = local.master_count
|
||||
count = var.master_count
|
||||
|
||||
name = "master-${count.index}"
|
||||
project = incus_project.this.name
|
||||
@@ -60,7 +56,7 @@ module "master" {
|
||||
|
||||
module "worker" {
|
||||
source = "./modules/incus_vm"
|
||||
count = local.worker_count
|
||||
count = var.worker_count
|
||||
|
||||
name = "worker-${count.index}"
|
||||
project = incus_project.this.name
|
||||
@@ -77,7 +73,7 @@ module "worker" {
|
||||
# ---------
|
||||
|
||||
terraform {
|
||||
required_version = "~> 1.12"
|
||||
required_version = ">= 1.11.5"
|
||||
|
||||
required_providers {
|
||||
incus = {
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
variable "master_count" {
|
||||
description = "The number of master nodes to provision."
|
||||
type = number
|
||||
default = 1
|
||||
nullable = false
|
||||
}
|
||||
|
||||
variable "worker_count" {
|
||||
description = "The number of worker nodes to provision."
|
||||
type = number
|
||||
default = 0
|
||||
nullable = false
|
||||
}
|
||||
|
||||
variable "cpus" {
|
||||
description = "The number of CPU cores allocated to each virtual machine."
|
||||
type = number
|
||||
|
||||
Reference in New Issue
Block a user