84 lines
2.3 KiB
HCL
84 lines
2.3 KiB
HCL
locals {
|
|
dns_name = "${var.sub-domain}.${var.domain_name}"
|
|
dns_names = [local.dns_name]
|
|
app_name = var.component == var.instance ? var.instance : format("%s-%s", var.component, var.instance)
|
|
icon = "assets/img/logo.svg"
|
|
request_headers = {
|
|
"Content-Type" = "application/json"
|
|
Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}"
|
|
}
|
|
service = {
|
|
"name" = "gitea-http"
|
|
"port" = {
|
|
"number" = 3000
|
|
}
|
|
}
|
|
}
|
|
|
|
# module "service" {
|
|
# source = "/dist/modules/service"
|
|
# component = var.component
|
|
# instance = var.instance
|
|
# namespace = var.namespace
|
|
# labels = local.common-labels
|
|
# target = "http"
|
|
# port = local.service.port.number
|
|
# providers = {
|
|
# kubectl = kubectl
|
|
# }
|
|
# }
|
|
|
|
module "ingress" {
|
|
source = "git::https://git.solidite.fr/vynil/kydah-modules.git//ingress"
|
|
component = ""
|
|
instance = var.instance
|
|
namespace = var.namespace
|
|
issuer = var.issuer
|
|
ingress_class = var.ingress_class
|
|
labels = local.common-labels
|
|
dns_names = local.dns_names
|
|
middlewares = []
|
|
service = local.service
|
|
providers = {
|
|
kubectl = kubectl
|
|
}
|
|
}
|
|
|
|
module "application" {
|
|
source = "git::https://git.solidite.fr/vynil/kydah-modules.git//application"
|
|
component = var.component
|
|
instance = var.instance
|
|
app_group = var.app_group
|
|
dns_name = local.dns_name
|
|
icon = local.icon
|
|
protocol_provider = module.oauth2.provider-id
|
|
providers = {
|
|
authentik = authentik
|
|
}
|
|
}
|
|
|
|
module "oauth2" {
|
|
source = "git::https://git.solidite.fr/vynil/kydah-modules.git//oauth2"
|
|
component = var.component
|
|
instance = var.instance
|
|
namespace = var.namespace
|
|
labels = local.common-labels
|
|
dns_name = local.dns_name
|
|
redirect-path = "user/oauth2/vynil/callback"
|
|
providers = {
|
|
kubernetes = kubernetes
|
|
kubectl = kubectl
|
|
authentik = authentik
|
|
}
|
|
}
|
|
|
|
provider "restapi" {
|
|
uri = "http://authentik.${var.domain}-auth.svc/api/v3/"
|
|
headers = local.request_headers
|
|
create_method = "PATCH"
|
|
update_method = "PATCH"
|
|
destroy_method = "PATCH"
|
|
write_returns_object = true
|
|
id_attribute = "name"
|
|
}
|