infra: deploy kube-vip with terraform
This commit is contained in:
@ -7,12 +7,12 @@
|
||||
This directory contains Terraform configurations for managing
|
||||
infrastructure resources. It includes configurations for Proxmox.
|
||||
|
||||
The plan is to eventually migrate all infrastructure management to Terraform,
|
||||
including Kubernetes clusters and other resources. Currently, the Proxmox
|
||||
configuration is fully managed by Terraform, while Kubernetes resources are
|
||||
managed using Helm charts and kubectl commands. Previously, the Proxmox
|
||||
configuration was managed using Ansible, but it has been migrated to Terraform
|
||||
for better consistency and state management.
|
||||
Currently, only the Proxmox virtual machines are managed using Terraform.
|
||||
Kubernetes clusters are still created with Ansible, and Kubernetes resources are
|
||||
managed using Helm charts and kubectl. Previously, Proxmox was also managed with
|
||||
Ansible, but it has been moved to Terraform for improved consistency and state
|
||||
management. The goal is to eventually manage all infrastructure—including
|
||||
Kubernetes clusters—using Terraform.
|
||||
|
||||
The terraform state files are stored in a remote backend, which allows for
|
||||
collaboration and state management across different environments. The backend
|
||||
|
||||
16
infra/terraform/kubernetes/kube-vip.tf
Normal file
16
infra/terraform/kubernetes/kube-vip.tf
Normal 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
|
||||
})
|
||||
]
|
||||
}
|
||||
@ -16,7 +16,7 @@ provider "kubernetes" {
|
||||
}
|
||||
|
||||
provider "helm" {
|
||||
kubernetes {
|
||||
kubernetes = {
|
||||
config_path = "~/.kube/config"
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
# custom-values.yaml
|
||||
config:
|
||||
address: $VIP_ADDRESS
|
||||
address: "${VIP_ADDRESS}"
|
||||
env:
|
||||
# Ensure the interface name is correct for the Nodes
|
||||
# Can be found using `ip a` command
|
||||
|
||||
Reference in New Issue
Block a user