feat: Configuration stockage local et token K3S partagé
Some checks failed
CD - Deploy Infrastructure / Terraform Validation (push) Successful in 17s
CD - Deploy Infrastructure / Deploy on pve1 (push) Successful in 2m12s
CD - Deploy Infrastructure / Deploy on pve2 (push) Successful in 2m11s
CD - Deploy Infrastructure / Deploy on pve3 (push) Successful in 2m28s
CD - Deploy Infrastructure / Validate K3s Cluster (push) Successful in 5m3s
CD - Deploy Infrastructure / Deployment Notification (push) Failing after 1s

- Passage stockage local-nvme pour acemagician et elitedesk (40G)
- Token K3S partagé via cloud-init pour cluster HA
- Configuration FluxCD avec GitRepository Forgejo
- Déploiement Hello World via FluxCD
- Manifestes Kubernetes pour application demo
This commit is contained in:
Tellsanguis 2025-12-09 11:55:19 +01:00
parent a818aab4be
commit 3b5f1fc2d2
17 changed files with 193 additions and 84 deletions

View file

@ -4,10 +4,9 @@ on:
push:
branches:
- main
workflow_dispatch: # Allow manual trigger
workflow_dispatch:
jobs:
# Run Terraform validation first
ci-terraform:
name: Terraform Validation
runs-on: self-hosted
@ -63,11 +62,11 @@ jobs:
TF_VAR_k3s_network_bridge: "k3s"
TF_VAR_k3s_gateway: "10.100.20.1"
TF_VAR_k3s_dns: '["10.100.20.1", "1.1.1.1"]'
TF_VAR_k3s_server_1_config: '{ ip = "10.100.20.10/24", cores = 6, memory = 12288, disk_size = "100G" }'
TF_VAR_k3s_server_2_config: '{ ip = "10.100.20.20/24", cores = 6, memory = 12288, disk_size = "100G" }'
TF_VAR_k3s_token: ${{ secrets.K3S_TOKEN }}
TF_VAR_k3s_server_1_config: '{ ip = "10.100.20.10/24", cores = 6, memory = 12288, disk_size = "40G" }'
TF_VAR_k3s_server_2_config: '{ ip = "10.100.20.20/24", cores = 6, memory = 12288, disk_size = "40G" }'
TF_VAR_etcd_witness_config: '{ ip = "10.100.20.30/24", cores = 2, memory = 2048, disk_size = "20G" }'
# Deploy infrastructure in parallel
deploy-pve1:
name: Deploy on pve1
runs-on: self-hosted
@ -91,14 +90,15 @@ jobs:
forgejo_token = "${{ secrets.GIT_TOKEN }}"
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
k3s_version = "v1.28.5+k3s1"
k3s_token = "${{ secrets.K3S_TOKEN }}"
ubuntu_template = "ubuntu-2404-cloudinit"
storage_pool = "linstor_storage"
k3s_server_1_storage_pool = "linstor_storage"
k3s_server_1_storage_pool = "local-nvme"
snippets_storage = "local"
k3s_network_bridge = "k3s"
k3s_gateway = "10.100.20.1"
k3s_dns = ["10.100.20.1", "1.1.1.1"]
k3s_server_1_config = { ip = "10.100.20.10/24", cores = 6, memory = 12288, disk_size = "100G" }
k3s_server_1_config = { ip = "10.100.20.10/24", cores = 6, memory = 12288, disk_size = "40G" }
EOF
tofu init
tofu apply -auto-approve
@ -126,14 +126,15 @@ jobs:
forgejo_token = "${{ secrets.GIT_TOKEN }}"
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
k3s_version = "v1.28.5+k3s1"
k3s_token = "${{ secrets.K3S_TOKEN }}"
ubuntu_template = "ubuntu-2404-cloudinit"
storage_pool = "linstor_storage"
k3s_server_2_storage_pool = "linstor_storage"
k3s_server_2_storage_pool = "local-nvme"
snippets_storage = "local"
k3s_network_bridge = "k3s"
k3s_gateway = "10.100.20.1"
k3s_dns = ["10.100.20.1", "1.1.1.1"]
k3s_server_2_config = { ip = "10.100.20.20/24", cores = 6, memory = 12288, disk_size = "100G" }
k3s_server_2_config = { ip = "10.100.20.20/24", cores = 6, memory = 12288, disk_size = "40G" }
EOF
tofu init
tofu apply -auto-approve
@ -161,6 +162,7 @@ jobs:
forgejo_token = "${{ secrets.GIT_TOKEN }}"
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
k3s_version = "v1.28.5+k3s1"
k3s_token = "${{ secrets.K3S_TOKEN }}"
ubuntu_template = "ubuntu-2404-cloudinit"
storage_pool = "linstor_storage"
etcd_witness_storage_pool = "local-lvm"
@ -192,13 +194,12 @@ jobs:
- name: Wait for K3s cluster
run: |
echo "Waiting for K3s cluster to be ready..."
sleep 300 # Wait 5 minutes for ansible-pull to configure K3s
- name: Check cluster status (optional)
sleep 300
- name: Check cluster status
run: |
echo "Cluster validation completed"
continue-on-error: true
# Notify on completion
notify:
name: Deployment Notification
runs-on: self-hosted