This commit is contained in:
2023-10-23 19:53:14 +02:00
parent bab68d5822
commit 2849b6fa1a
5 changed files with 343 additions and 360 deletions

View File

@@ -37,7 +37,7 @@ module "ingress" {
ingress-class = var.ingress-class
labels = local.common-labels
dns-names = local.dns-names
middlewares = var.use-oauth?[]:["forward-${local.app-name}"]
middlewares = []
service = local.service
providers = {
kubectl = kubectl
@@ -51,14 +51,13 @@ module "application" {
app-group = var.app-group
dns-name = local.dns-name
icon = local.icon
protocol_provider = var.use-oauth?module.oauth2[0].provider-id:module.forward[0].provider-id
protocol_provider = module.oauth2.provider-id
providers = {
authentik = authentik
}
}
module "oauth2" {
count = var.use-oauth?1:0
source = "/dist/modules/oauth2"
component = var.component
instance = var.instance
@@ -72,34 +71,3 @@ module "oauth2" {
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" {
count = var.use-oauth?0:1
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
}
}