fix
This commit is contained in:
89
apps/code-server/presentation.tf
Normal file
89
apps/code-server/presentation.tf
Normal file
@@ -0,0 +1,89 @@
|
||||
locals {
|
||||
dns-name = "${var.instance}.${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 = "_static/src/browser/media/favicon-dark-support.svg"
|
||||
request_headers = {
|
||||
"Content-Type" = "application/json"
|
||||
Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}"
|
||||
}
|
||||
service = {
|
||||
"name" = "${var.component}-${var.instance}"
|
||||
"port" = {
|
||||
"number" = 80
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 = "/dist/modules/ingress"
|
||||
component = var.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 = ["${var.instance}-https", "forward-${local.app-name}"]
|
||||
service = local.service
|
||||
providers = {
|
||||
kubectl = kubectl
|
||||
}
|
||||
}
|
||||
|
||||
module "application" {
|
||||
source = "/dist/modules/application"
|
||||
component = var.component
|
||||
instance = var.instance
|
||||
app-group = var.app-group
|
||||
sub-domain = var.sub-domain
|
||||
domain-name = var.domain-name
|
||||
icon = local.icon
|
||||
protocol_provider = module.forward.provider-id
|
||||
providers = {
|
||||
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"
|
||||
}
|
||||
|
||||
module "forward" {
|
||||
source = "/dist/modules/forward"
|
||||
component = var.component
|
||||
instance = var.instance
|
||||
domain = var.domain
|
||||
namespace = var.namespace
|
||||
ingress-class = var.ingress-class
|
||||
labels = local.common-labels
|
||||
dns-names = local.dns-names
|
||||
service = local.service
|
||||
icon = local.icon
|
||||
request_headers = local.request_headers
|
||||
providers = {
|
||||
restapi = restapi
|
||||
http = http
|
||||
kubectl = kubectl
|
||||
authentik = authentik
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user