Auto-update blog content from Obsidian: 2026-10-14 21:11:40
Blog Deployment / Merge (push) Successful in 6s
Blog Deployment / Deploy-Production (push) Successful in 14s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Skipped
Blog Deployment / Notify (push) Successful in 2s
Blog Deployment / Check-Rebuild (push) Successful in 5s
Blog Deployment / Build (push) Skipped
Blog Deployment / Deploy-Staging (push) Successful in 11s
Blog Deployment / Test-Staging (push) Successful in 1s
Blog Deployment / Merge (push) Successful in 6s
Blog Deployment / Deploy-Production (push) Successful in 14s
Blog Deployment / Test-Production (push) Successful in 2s
Blog Deployment / Clean (push) Skipped
Blog Deployment / Notify (push) Successful in 2s
Blog Deployment / Check-Rebuild (push) Successful in 5s
Blog Deployment / Build (push) Skipped
Blog Deployment / Deploy-Staging (push) Successful in 11s
Blog Deployment / Test-Staging (push) Successful in 1s
This commit is contained in:
@@ -3,7 +3,7 @@ slug: automate-kubernetes-vms-terraform-ansible
|
||||
title: Automatiser le déploiement des VM Kubernetes avec Terraform et Ansible
|
||||
description: Je provisionne des VM Kubernetes sur Proxmox avec Terraform et les prépare avec Ansible via Semaphore, en utilisant l’état Terraform comme inventaire.
|
||||
date: 2026-10-14
|
||||
draft: true
|
||||
draft: false
|
||||
tags:
|
||||
- kubernetes
|
||||
- proxmox
|
||||
@@ -23,7 +23,7 @@ C’était volontaire. Je voulais comprendre les étapes de préparation et de b
|
||||
|
||||
ℹ️ Je travaille maintenant sur la [migration de Docker Compose vers Kubernetes]({{< ref "post/24-roadmap-migrate-docker-applications-kubernetes" >}}), et je veux automatiser le déploiement des VM et la préparation des nœuds. Pour l’instant, le bootstrap du cluster restera manuel, comme prévu dans la feuille de route.
|
||||
|
||||
L’objectif de ce projet est d’obtenir des VM prêtes pour Kubernetes, créées avec Terraform et configurées avec Ansible. J’exécute les deux via Semaphore UI, et l’état Terraform fournit l’inventaire à Ansible.
|
||||
🎯 L’objectif de ce projet est d’obtenir des VM prêtes pour Kubernetes, créées avec Terraform et configurées avec Ansible. J’exécute les deux via Semaphore UI, et l’état Terraform fournit l’inventaire à Ansible.
|
||||
|
||||
## Un projet Terraform dédié
|
||||
|
||||
@@ -52,7 +52,7 @@ module "pve_vm" {
|
||||
|
||||
✅ Je teste d’abord le déploiement depuis `bastion` avec un master et deux workers. Tout fonctionne comme prévu, je passe donc à l’exécution depuis Semaphore.
|
||||
|
||||
Le [projet Terraform complet](https://github.com/Vezpi/Homelab/tree/main/terraform/projects/kubernetes_vms) est disponible dans mon dépôt homelab.
|
||||
📝 Le [projet Terraform complet](https://github.com/Vezpi/Homelab/tree/main/terraform/projects/kubernetes_vms) est disponible dans mon dépôt homelab.
|
||||
|
||||
## Choisir les paramètres de déploiement dans Semaphore
|
||||
|
||||
@@ -138,7 +138,7 @@ Je crée un modèle de tâche Semaphore appelé **Kubernetes VM Preparation** po
|
||||
|
||||

|
||||
|
||||
Le [projet Ansible et son rôle](https://github.com/Vezpi/Homelab/tree/main/ansible/kubernetes) sont également disponibles dans le dépôt.
|
||||
📝 Le [projet Ansible et son rôle](https://github.com/Vezpi/Homelab/tree/main/ansible/kubernetes) sont également disponibles dans le dépôt.
|
||||
|
||||
## Où je m’arrête pour l’instant
|
||||
|
||||
@@ -152,6 +152,6 @@ J’arrête aussi l’automatisation avant le bootstrap du cluster. Le playbook
|
||||
|
||||
## Conclusion
|
||||
|
||||
J’ai maintenant six VM déployées avec Terraform et préparées avec Ansible via Semaphore. En utilisant l’état Terraform comme inventaire, je n’ai pas besoin de recopier leurs noms, leurs adresses et leurs rôles dans une liste d’hôtes séparée.
|
||||
🚀 J’ai maintenant six VM déployées avec Terraform et préparées avec Ansible via Semaphore. En utilisant l’état Terraform comme inventaire, je n’ai pas besoin de recopier leurs noms, leurs adresses et leurs rôles dans une liste d’hôtes séparée.
|
||||
|
||||
Le stockage temporaire de l’état et l’absence d’environnements indépendants restent à résoudre. Pour l’instant, je m’arrête aux machines préparées et je passe au bootstrap Kubernetes manuel, comme prévu dans la feuille de route de migration.
|
||||
@@ -3,7 +3,7 @@ slug: automate-kubernetes-vms-terraform-ansible
|
||||
title: Automating Kubernetes VM Deployment with Terraform and Ansible
|
||||
description: I provision Kubernetes VMs on Proxmox with Terraform and prepare them with Ansible through Semaphore, using Terraform state as inventory.
|
||||
date: 2026-10-14
|
||||
draft: true
|
||||
draft: false
|
||||
tags:
|
||||
- kubernetes
|
||||
- proxmox
|
||||
@@ -23,7 +23,7 @@ That was intentional. I wanted to understand the preparation and bootstrap steps
|
||||
|
||||
ℹ️ Now I am working on the [migration from Docker Compose to Kubernetes]({{< ref "post/24-roadmap-migrate-docker-applications-kubernetes" >}}), and I want to automate the VM deployment and node preparation. The cluster bootstrap itself will remain manual for now, as planned in the roadmap.
|
||||
|
||||
The goal of this project is to end up with VMs ready for Kubernetes, using Terraform to create them and Ansible to configure them. I run both through Semaphore UI, with Terraform state providing the Ansible inventory.
|
||||
🎯 The goal of this project is to end up with VMs ready for Kubernetes, using Terraform to create them and Ansible to configure them. I run both through Semaphore UI, with Terraform state providing the Ansible inventory.
|
||||
|
||||
## A dedicated Terraform project
|
||||
|
||||
@@ -52,7 +52,7 @@ module "pve_vm" {
|
||||
|
||||
✅ I first test the deployment from `bastion` with one master and two workers. It works as expected, so I move on to running it from Semaphore.
|
||||
|
||||
The complete [Terraform project](https://github.com/Vezpi/Homelab/tree/main/terraform/projects/kubernetes_vms) is available in my homelab repository.
|
||||
📝 The complete [Terraform project](https://github.com/Vezpi/Homelab/tree/main/terraform/projects/kubernetes_vms) is available in my homelab repository.
|
||||
|
||||
## Choosing the deployment settings in Semaphore
|
||||
|
||||
@@ -138,7 +138,7 @@ I create a Semaphore task template called **Kubernetes VM Preparation** to run t
|
||||
|
||||

|
||||
|
||||
The [Ansible project and role](https://github.com/Vezpi/Homelab/tree/main/ansible/kubernetes) are also available in the repository.
|
||||
📝 The [Ansible project and role](https://github.com/Vezpi/Homelab/tree/main/ansible/kubernetes) are also available in the repository.
|
||||
|
||||
## Where I stop for now
|
||||
|
||||
@@ -152,6 +152,6 @@ I also stop the automation before cluster bootstrap. The playbook prepares the n
|
||||
|
||||
## Conclusion
|
||||
|
||||
🎯 I now have six VMs deployed with Terraform and prepared with Ansible through Semaphore. Using Terraform state as inventory means I do not need to copy their names, addresses, and roles into a separate host list.
|
||||
🚀 I now have six VMs deployed with Terraform and prepared with Ansible through Semaphore. Using Terraform state as inventory means I do not need to copy their names, addresses, and roles into a separate host list.
|
||||
|
||||
The temporary state storage and lack of independent environments still need work. For now, I stop here with the prepared machines and move on to the manual Kubernetes bootstrap, as planned in the migration roadmap.
|
||||
|
||||
Reference in New Issue
Block a user