infra: deploy kube-vip with terraform

This commit is contained in:
2025-07-01 09:50:55 +03:00
parent 82421c60cb
commit 79e4a02657
5 changed files with 35 additions and 8 deletions

View File

@ -0,0 +1,16 @@
# No new namespace is required since it is being deployed in kube-system namespace.
resource "helm_release" "kube_vip" {
name = "kube-vip"
repository = "https://kube-vip.github.io/helm-charts"
chart = "kube-vip"
version = "0.6.6"
atomic = true
namespace = "kube-system"
values = [
templatefile("${var.kubernetes_project_path}/kube-vip/values.yaml", {
VIP_ADDRESS = var.vip_address
})
]
}

View File

@ -16,7 +16,7 @@ provider "kubernetes" {
}
provider "helm" {
kubernetes {
kubernetes = {
config_path = "~/.kube/config"
}
}

View File

@ -32,4 +32,15 @@ variable "docker_username" {
variable "docker_password" {
description = "Docker registry password"
type = string
}
variable "kubernetes_project_path" {
description = "Path to the Kubernetes configuration files"
type = string
default = "../../../kubernetes"
}
variable "vip_address" {
description = "VIP address for kube-vip"
type = string
}