Skip to content

Commit

Permalink
Mise à jour de la configuration de MetalLB pour utiliser une plage d'…
Browse files Browse the repository at this point in the history
…adresses IP différente
  • Loading branch information
AlxFrst committed Apr 17, 2024
1 parent 0cdb82a commit 2a24e83
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ jobs:
- name: Terraform Plan
run: terraform plan -var-file="secrets_prod.tfvars" -var-file="configurations/prod.tfvars"

- name: Terraform apply
run: terraform apply -auto-approve -var-file="secrets_prod.tfvars" -var-file="configurations/prod.tfvars"
- name: Terraform destroy
run: terraform destroy -auto-approve -var-file="secrets_prod.tfvars" -var-file="configurations/prod.tfvars"

2 changes: 1 addition & 1 deletion configurations/prod.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ k8s_master_nodes= 2 # Number of master nodes (the main node is always the first
k8s_worker_nodes= 3 # Number of worker nodes (recommended 3 or more for production environments)
k8s_storage_nodes= 1 # Number of storage nodes (if you don't want storage nodes, put 0 here)
k8s_pod_network_cidr= "10.244.0.0" # The CIDR notation of the pod network
metallb_ip_range= "192.168.1.200-192.168.1.230" # The IP range for MetalLB
metallb_ip_range= "192.168.1.160-192.168.1.180" # The IP range for MetalLB

# Load balancer configuration
load_balancer_cpu= 2 # Number of CPUs
Expand Down
13 changes: 13 additions & 0 deletions k8s_loadbalancer.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ resource "proxmox_vm_qemu" "k8s_loadbalancer" {
bridge = var.proxmox_bridge_name
}

provisioner "file" {
connection {
type = "ssh"
user = var.vm_user
private_key = var.ssh_private_key
host = self.ssh_host
}
source = "assets/metallb-config.yaml"
destination = "/tmp/metallb-config.yaml"
}

provisioner "remote-exec" {
connection {
type = "ssh"
Expand Down Expand Up @@ -68,6 +79,8 @@ resource "proxmox_vm_qemu" "k8s_loadbalancer" {
"sudo mkdir apps",
"sudo mkdir tools",
"sudo mkdir tools/cluster",
"sudo mkdir tools/metallb",
"sudo mv /tmp/metallb-config.yaml tools/metallb/metallb-config.yaml",
"sudo mkdir .kube",
"sudo chown -R ${var.vm_user}:${var.vm_user} .kube",
"sudo chown -R ${var.vm_user}:${var.vm_user} apps",
Expand Down

0 comments on commit 2a24e83

Please sign in to comment.