132 lines
2.9 KiB
Terraform
132 lines
2.9 KiB
Terraform
|
|
resource "helm_release" "local-chart-infrastructure" {
|
|
name = "infrastructure"
|
|
chart = "charts/infrastructure"
|
|
namespace = "default"
|
|
set = [
|
|
{
|
|
name = "ns.metallb"
|
|
value = module.k8s-helm-charts.namespaces.plugins.metallb
|
|
},
|
|
{
|
|
name = "ns.argocd"
|
|
value = module.k8s-helm-charts.namespaces.plugins.argo-cd
|
|
},
|
|
{
|
|
name = "gitops.data.username"
|
|
value = var.gitea.user
|
|
},
|
|
{
|
|
name = "gitops.data.password"
|
|
value = var.gitea.password
|
|
},
|
|
{
|
|
name = "repos.github-helm-charts.data.sshPrivateKey"
|
|
value = var.github_ssh_key
|
|
}
|
|
]
|
|
values = [
|
|
yamlencode({
|
|
"global" : var.globals
|
|
})
|
|
]
|
|
timeout = 120
|
|
force_update = true
|
|
lint = true
|
|
wait = true
|
|
wait_for_jobs = true
|
|
max_history = 4
|
|
}
|
|
|
|
module "k8s-helm-charts" {
|
|
source = "./tf-modules/k8s-helm-charts"
|
|
plugins = {
|
|
"external-secrets" : {
|
|
repository = "https://charts.external-secrets.io"
|
|
version = "0.16.1"
|
|
},
|
|
"metallb" : {
|
|
repository = "https://metallb.github.io/metallb"
|
|
version = "0.15.2"
|
|
},
|
|
"cert-manager" : {
|
|
repository = "https://charts.jetstack.io"
|
|
version = "1.19.2"
|
|
values : [yamlencode({
|
|
installCRDs : true,
|
|
extraArgs : [
|
|
"--dns01-recursive-nameservers=1.1.1.1:53,8.8.8.8:53",
|
|
"--dns01-recursive-nameservers-only"
|
|
]
|
|
})]
|
|
},
|
|
"argo-cd" : {
|
|
"repository" : "https://argoproj.github.io/argo-helm"
|
|
"version" : "8.5.0"
|
|
"values" : [
|
|
yamlencode({
|
|
configs = {
|
|
cm = {
|
|
"exec.enabled" : true
|
|
}
|
|
params = {
|
|
"server.insecure" = true
|
|
"server.basehref" = "/"
|
|
"server.rootpath" = ""
|
|
"server.disable.auth" : true
|
|
}
|
|
}
|
|
crds = {
|
|
install = true
|
|
keep = false
|
|
}
|
|
server = {
|
|
ingress = {
|
|
enabled = false
|
|
}
|
|
ingressGrpc = {
|
|
enabled = false
|
|
}
|
|
}
|
|
})
|
|
]
|
|
},
|
|
"tailscale-operator" : {
|
|
repository = "https://pkgs.tailscale.com/helmcharts"
|
|
version = "1.82.0"
|
|
values : [
|
|
yamlencode({
|
|
oauth = {
|
|
clientId = var.tailscale.client_id
|
|
clientSecret = var.tailscale.client_secret
|
|
}
|
|
})
|
|
]
|
|
},
|
|
"traefik" : {
|
|
repository = "https://traefik.github.io/charts"
|
|
version = "35.0.1"
|
|
values = [
|
|
yamlencode({
|
|
providers : {
|
|
kubernetesGateway : {
|
|
enabled : true
|
|
}
|
|
}
|
|
})
|
|
]
|
|
}
|
|
}
|
|
}
|
|
|
|
output "ns" {
|
|
value = module.k8s-helm-charts.namespaces
|
|
}
|
|
|
|
|
|
resource "kubernetes_namespace" "test" {
|
|
metadata {
|
|
name = "test"
|
|
}
|
|
}
|