fix(terraform): Configuration nœuds cluster et stockage
This commit is contained in:
parent
155de75fbf
commit
5f6df07fbe
7 changed files with 61 additions and 37 deletions
|
|
@ -90,14 +90,15 @@ jobs:
|
|||
ssh_public_key = "${{ secrets.SSH_PUBLIC_KEY }}"
|
||||
forgejo_token = "${{ secrets.GIT_TOKEN }}"
|
||||
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
|
||||
k3s_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
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_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
k3s_server_1_storage_pool = "linstor_storage"
|
||||
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" }
|
||||
EOF
|
||||
tofu init
|
||||
tofu apply -auto-approve
|
||||
|
|
@ -119,19 +120,20 @@ jobs:
|
|||
run: |
|
||||
cd terraform/pve2
|
||||
cat > terraform.tfvars <<EOF
|
||||
proxmox_token_id = "${{ secrets.PROXMOX_TOKEN_ID }}"
|
||||
proxmox_token_secret = "${{ secrets.PROXMOX_TOKEN_SECRET }}"
|
||||
ssh_public_key = "${{ secrets.SSH_PUBLIC_KEY }}"
|
||||
forgejo_token = "${{ secrets.GIT_TOKEN }}"
|
||||
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
|
||||
k3s_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
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" }
|
||||
proxmox_token_id = "${{ secrets.PROXMOX_TOKEN_ID }}"
|
||||
proxmox_token_secret = "${{ secrets.PROXMOX_TOKEN_SECRET }}"
|
||||
ssh_public_key = "${{ secrets.SSH_PUBLIC_KEY }}"
|
||||
forgejo_token = "${{ secrets.GIT_TOKEN }}"
|
||||
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
|
||||
k3s_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
k3s_server_2_storage_pool = "linstor_storage"
|
||||
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" }
|
||||
EOF
|
||||
tofu init
|
||||
tofu apply -auto-approve
|
||||
|
|
@ -153,19 +155,20 @@ jobs:
|
|||
run: |
|
||||
cd terraform/pve3
|
||||
cat > terraform.tfvars <<EOF
|
||||
proxmox_token_id = "${{ secrets.PROXMOX_TOKEN_ID }}"
|
||||
proxmox_token_secret = "${{ secrets.PROXMOX_TOKEN_SECRET }}"
|
||||
ssh_public_key = "${{ secrets.SSH_PUBLIC_KEY }}"
|
||||
forgejo_token = "${{ secrets.GIT_TOKEN }}"
|
||||
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
|
||||
k3s_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
snippets_storage = "local"
|
||||
k3s_network_bridge = "k3s"
|
||||
k3s_gateway = "10.100.20.1"
|
||||
k3s_dns = ["10.100.20.1", "1.1.1.1"]
|
||||
etcd_witness_config = { ip = "10.100.20.30/24", cores = 2, memory = 2048, disk_size = "20G" }
|
||||
proxmox_token_id = "${{ secrets.PROXMOX_TOKEN_ID }}"
|
||||
proxmox_token_secret = "${{ secrets.PROXMOX_TOKEN_SECRET }}"
|
||||
ssh_public_key = "${{ secrets.SSH_PUBLIC_KEY }}"
|
||||
forgejo_token = "${{ secrets.GIT_TOKEN }}"
|
||||
forgejo_repo_url = "${{ secrets.GIT_REPO_URL }}"
|
||||
k3s_version = "v1.28.5+k3s1"
|
||||
ubuntu_template = "ubuntu-2404-cloudinit"
|
||||
storage_pool = "linstor_storage"
|
||||
etcd_witness_storage_pool = "local-lvm"
|
||||
snippets_storage = "local"
|
||||
k3s_network_bridge = "k3s"
|
||||
k3s_gateway = "10.100.20.1"
|
||||
k3s_dns = ["10.100.20.1", "1.1.1.1"]
|
||||
etcd_witness_config = { ip = "10.100.20.30/24", cores = 2, memory = 2048, disk_size = "20G" }
|
||||
EOF
|
||||
tofu init
|
||||
tofu apply -auto-approve
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ resource "proxmox_vm_qemu" "k3s_server_1" {
|
|||
name = "k3s-server-1"
|
||||
target_node = "acemagician"
|
||||
clone = var.ubuntu_template
|
||||
full_clone = true
|
||||
|
||||
cpu {
|
||||
cores = var.k3s_server_1_config.cores
|
||||
|
|
@ -48,7 +49,7 @@ resource "proxmox_vm_qemu" "k3s_server_1" {
|
|||
slot = "scsi0"
|
||||
size = var.k3s_server_1_config.disk_size
|
||||
type = "disk"
|
||||
storage = var.storage_pool
|
||||
storage = var.k3s_server_1_storage_pool
|
||||
iothread = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ variable "storage_pool" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "k3s_server_1_storage_pool" {
|
||||
description = "Storage pool for k3s-server-1 disk (linstor_storage for HA)"
|
||||
type = string
|
||||
default = "linstor_storage"
|
||||
}
|
||||
|
||||
variable "snippets_storage" {
|
||||
description = "Proxmox storage for cloud-init snippets"
|
||||
type = string
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ resource "proxmox_vm_qemu" "k3s_server_2" {
|
|||
name = "k3s-server-2"
|
||||
target_node = "elitedesk"
|
||||
clone = var.ubuntu_template
|
||||
full_clone = true
|
||||
|
||||
cpu {
|
||||
cores = var.k3s_server_2_config.cores
|
||||
|
|
@ -48,7 +49,7 @@ resource "proxmox_vm_qemu" "k3s_server_2" {
|
|||
slot = "scsi0"
|
||||
size = var.k3s_server_2_config.disk_size
|
||||
type = "disk"
|
||||
storage = var.storage_pool
|
||||
storage = var.k3s_server_2_storage_pool
|
||||
iothread = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ variable "storage_pool" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "k3s_server_2_storage_pool" {
|
||||
description = "Storage pool for k3s-server-2 disk (linstor_storage for HA)"
|
||||
type = string
|
||||
default = "linstor_storage"
|
||||
}
|
||||
|
||||
variable "snippets_storage" {
|
||||
description = "Proxmox storage for cloud-init snippets"
|
||||
type = string
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ resource "proxmox_vm_qemu" "etcd_witness" {
|
|||
name = "etcd-witness"
|
||||
target_node = "thinkpad"
|
||||
clone = var.ubuntu_template
|
||||
full_clone = true
|
||||
|
||||
cpu {
|
||||
cores = var.etcd_witness_config.cores
|
||||
|
|
@ -48,7 +49,7 @@ resource "proxmox_vm_qemu" "etcd_witness" {
|
|||
slot = "scsi0"
|
||||
size = var.etcd_witness_config.disk_size
|
||||
type = "disk"
|
||||
storage = var.storage_pool
|
||||
storage = var.etcd_witness_storage_pool
|
||||
iothread = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,6 +53,12 @@ variable "storage_pool" {
|
|||
type = string
|
||||
}
|
||||
|
||||
variable "etcd_witness_storage_pool" {
|
||||
description = "Proxmox storage pool for etcd witness VM disk (thinkpad uses local storage)"
|
||||
type = string
|
||||
default = "local-lvm"
|
||||
}
|
||||
|
||||
variable "snippets_storage" {
|
||||
description = "Proxmox storage for cloud-init snippets"
|
||||
type = string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue