Some checks failed
Django Helm GitOps Deploy / build-and-deploy (push) Failing after 13s
51 lines
1.1 KiB
HCL
51 lines
1.1 KiB
HCL
terraform {
|
|
required_providers {
|
|
kubernetes = {
|
|
source = "hashicorp/kubernetes"
|
|
version = "~> 2.26"
|
|
}
|
|
helm = {
|
|
source = "hashicorp/helm"
|
|
version = "~> 2.12"
|
|
}
|
|
}
|
|
|
|
backend "consul" {
|
|
address = "consul:8500"
|
|
path = "terraform/states/boday_tf"
|
|
}
|
|
}
|
|
|
|
# Variable für den dynamischen Git-SHA-Tag deiner Pipeline
|
|
variable "app_version" {
|
|
type = string
|
|
default = "latest"
|
|
}
|
|
|
|
provider "kubernetes" {
|
|
config_path = "./kind_kubeconfig"
|
|
host = "https://local-k3s-platform:6443"
|
|
insecure = true
|
|
}
|
|
|
|
provider "helm" {
|
|
kubernetes {
|
|
config_path = "./kind_kubeconfig"
|
|
host = "https://local-k3s-platform:6443"
|
|
insecure = true
|
|
}
|
|
}
|
|
|
|
# DAS FINALE DJANGO HELM-CHART DEPLOYMENT
|
|
resource "helm_release" "boday_website" {
|
|
name = "boday-it"
|
|
chart = "./charts/boday-it" # Zeigt direkt auf den lokalen Chart-Ordner im Repo
|
|
namespace = "default"
|
|
|
|
# Überschreibt das Image-Tag dynamisch mit der aktuellen Pipeline-Version
|
|
set {
|
|
name = "image.tag"
|
|
value = var.app_version
|
|
}
|
|
}
|
|
|