fix
This commit is contained in:
@@ -1,10 +1,17 @@
|
|||||||
locals {
|
locals {
|
||||||
dns-name = "${var.sub-domain}.${var.domain-name}"
|
dns-name = "${var.sub-domain}.${var.domain-name}"
|
||||||
dns-names = [local.dns-name]
|
dns-names = [local.dns-name]
|
||||||
|
icon = "logo192.png"
|
||||||
request_headers = {
|
request_headers = {
|
||||||
"Content-Type" = "application/json"
|
"Content-Type" = "application/json"
|
||||||
Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}"
|
Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}"
|
||||||
}
|
}
|
||||||
|
service = {
|
||||||
|
"name" = "${var.component}-${var.instance}"
|
||||||
|
"port" = {
|
||||||
|
"number" = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -29,12 +36,7 @@ module "ingress" {
|
|||||||
labels = local.common-labels
|
labels = local.common-labels
|
||||||
dns-names = local.dns-names
|
dns-names = local.dns-names
|
||||||
middlewares = ["${var.instance}-https"]
|
middlewares = ["${var.instance}-https"]
|
||||||
service = {
|
service = local.service
|
||||||
"name" = "${var.component}-${var.instance}"
|
|
||||||
"port" = {
|
|
||||||
"number" = 80
|
|
||||||
}
|
|
||||||
}
|
|
||||||
providers = {
|
providers = {
|
||||||
kubectl = kubectl
|
kubectl = kubectl
|
||||||
}
|
}
|
||||||
@@ -47,7 +49,7 @@ module "application" {
|
|||||||
app-group = var.app-group
|
app-group = var.app-group
|
||||||
sub-domain = var.sub-domain
|
sub-domain = var.sub-domain
|
||||||
domain-name = var.domain-name
|
domain-name = var.domain-name
|
||||||
icon = "logo192.png"
|
icon = local.icon
|
||||||
protocol_provider = var.use-oauth?module.oauth2.provider-id:module.forward.provider-id
|
protocol_provider = var.use-oauth?module.oauth2.provider-id:module.forward.provider-id
|
||||||
providers = {
|
providers = {
|
||||||
authentik = authentik
|
authentik = authentik
|
||||||
@@ -79,6 +81,8 @@ module "forward" {
|
|||||||
ingress-class = var.ingress-class
|
ingress-class = var.ingress-class
|
||||||
labels = local.common-labels
|
labels = local.common-labels
|
||||||
dns-names = local.dns-names
|
dns-names = local.dns-names
|
||||||
|
service = local.service
|
||||||
|
icon = local.icon
|
||||||
providers = {
|
providers = {
|
||||||
restapi = restapi
|
restapi = restapi
|
||||||
http = http
|
http = http
|
||||||
|
|||||||
@@ -6,94 +6,11 @@ metadata:
|
|||||||
name: dbgate
|
name: dbgate
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
domain-name:
|
use-oauth:
|
||||||
default: your_company.com
|
default: false
|
||||||
examples:
|
examples:
|
||||||
- your_company.com
|
- false
|
||||||
type: string
|
type: boolean
|
||||||
app-group:
|
|
||||||
default: dev
|
|
||||||
examples:
|
|
||||||
- dev
|
|
||||||
type: string
|
|
||||||
mongo:
|
|
||||||
default: []
|
|
||||||
examples:
|
|
||||||
- []
|
|
||||||
items:
|
|
||||||
properties:
|
|
||||||
dbname:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
namespace:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
secret:
|
|
||||||
properties:
|
|
||||||
key:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
name:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
username:
|
|
||||||
default: ''
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: array
|
|
||||||
issuer:
|
|
||||||
default: letsencrypt-prod
|
|
||||||
examples:
|
|
||||||
- letsencrypt-prod
|
|
||||||
type: string
|
|
||||||
images:
|
|
||||||
default:
|
|
||||||
dbgate:
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: dbgate/dbgate
|
|
||||||
tag: 5.2.7-alpine
|
|
||||||
examples:
|
|
||||||
- dbgate:
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: dbgate/dbgate
|
|
||||||
tag: 5.2.7-alpine
|
|
||||||
properties:
|
|
||||||
dbgate:
|
|
||||||
default:
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
registry: docker.io
|
|
||||||
repository: dbgate/dbgate
|
|
||||||
tag: 5.2.7-alpine
|
|
||||||
properties:
|
|
||||||
pullPolicy:
|
|
||||||
default: IfNotPresent
|
|
||||||
enum:
|
|
||||||
- Always
|
|
||||||
- Never
|
|
||||||
- IfNotPresent
|
|
||||||
type: string
|
|
||||||
registry:
|
|
||||||
default: docker.io
|
|
||||||
type: string
|
|
||||||
repository:
|
|
||||||
default: dbgate/dbgate
|
|
||||||
type: string
|
|
||||||
tag:
|
|
||||||
default: 5.2.7-alpine
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
type: object
|
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
storage:
|
storage:
|
||||||
default:
|
default:
|
||||||
accessMode: ReadWriteOnce
|
accessMode: ReadWriteOnce
|
||||||
@@ -121,17 +38,7 @@ options:
|
|||||||
- Block
|
- Block
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
sub-domain:
|
mongo:
|
||||||
default: dbgate
|
|
||||||
examples:
|
|
||||||
- dbgate
|
|
||||||
type: string
|
|
||||||
use-oauth:
|
|
||||||
default: false
|
|
||||||
examples:
|
|
||||||
- false
|
|
||||||
type: boolean
|
|
||||||
pg:
|
|
||||||
default: []
|
default: []
|
||||||
examples:
|
examples:
|
||||||
- []
|
- []
|
||||||
@@ -189,11 +96,104 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
images:
|
||||||
|
default:
|
||||||
|
dbgate:
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
registry: docker.io
|
||||||
|
repository: dbgate/dbgate
|
||||||
|
tag: 5.2.7-alpine
|
||||||
|
examples:
|
||||||
|
- dbgate:
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
registry: docker.io
|
||||||
|
repository: dbgate/dbgate
|
||||||
|
tag: 5.2.7-alpine
|
||||||
|
properties:
|
||||||
|
dbgate:
|
||||||
|
default:
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
registry: docker.io
|
||||||
|
repository: dbgate/dbgate
|
||||||
|
tag: 5.2.7-alpine
|
||||||
|
properties:
|
||||||
|
pullPolicy:
|
||||||
|
default: IfNotPresent
|
||||||
|
enum:
|
||||||
|
- Always
|
||||||
|
- Never
|
||||||
|
- IfNotPresent
|
||||||
|
type: string
|
||||||
|
registry:
|
||||||
|
default: docker.io
|
||||||
|
type: string
|
||||||
|
repository:
|
||||||
|
default: dbgate/dbgate
|
||||||
|
type: string
|
||||||
|
tag:
|
||||||
|
default: 5.2.7-alpine
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: object
|
||||||
ingress-class:
|
ingress-class:
|
||||||
default: traefik
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
|
app-group:
|
||||||
|
default: dev
|
||||||
|
examples:
|
||||||
|
- dev
|
||||||
|
type: string
|
||||||
|
sub-domain:
|
||||||
|
default: dbgate
|
||||||
|
examples:
|
||||||
|
- dbgate
|
||||||
|
type: string
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
|
type: string
|
||||||
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
|
pg:
|
||||||
|
default: []
|
||||||
|
examples:
|
||||||
|
- []
|
||||||
|
items:
|
||||||
|
properties:
|
||||||
|
dbname:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
namespace:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
secret:
|
||||||
|
properties:
|
||||||
|
key:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
name:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
username:
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
type: array
|
||||||
dependencies:
|
dependencies:
|
||||||
- dist: null
|
- dist: null
|
||||||
category: share
|
category: share
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ resource "authentik_group" "groups" {
|
|||||||
resource "authentik_group" "subgroup" {
|
resource "authentik_group" "subgroup" {
|
||||||
count = length(var.sub-groups)
|
count = length(var.sub-groups)
|
||||||
name = format("%s-%s", local.app-name, var.sub-groups[count.index])
|
name = format("%s-%s", local.app-name, var.sub-groups[count.index])
|
||||||
parent = authentik_group.prj_users.id
|
parent = authentik_group.groups.id
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "authentik_application" "prj_app" {
|
resource "authentik_application" "prj_app" {
|
||||||
|
|||||||
3
modules/application/outputs.tf
Normal file
3
modules/application/outputs.tf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
output "provider-id" {
|
||||||
|
value = authentik_provider_proxy.prj_forward.id
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ locals {
|
|||||||
"http" = {
|
"http" = {
|
||||||
"paths" = [{
|
"paths" = [{
|
||||||
"backend" = {
|
"backend" = {
|
||||||
"service" = local.service
|
"service" = var.service
|
||||||
}
|
}
|
||||||
"path" = "/${var.icon}"
|
"path" = "/${var.icon}"
|
||||||
"pathType" = "Prefix"
|
"pathType" = "Prefix"
|
||||||
@@ -37,7 +37,6 @@ resource "kubectl_manifest" "prj_ingress_icon" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "authentik_flow" "default-authorization-flow" {
|
data "authentik_flow" "default-authorization-flow" {
|
||||||
depends_on = [authentik_group.prj_users]
|
|
||||||
slug = "default-provider-authorization-implicit-consent"
|
slug = "default-provider-authorization-implicit-consent"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,9 +47,9 @@ resource "authentik_provider_proxy" "prj_forward" {
|
|||||||
mode = "forward_single"
|
mode = "forward_single"
|
||||||
access_token_validity = var.access-token-validity
|
access_token_validity = var.access-token-validity
|
||||||
}
|
}
|
||||||
|
data "authentik_group" "vynil-admin" {
|
||||||
|
name = "vynil-forward-admins"
|
||||||
|
}
|
||||||
resource "authentik_policy_binding" "prj_access_users" {
|
resource "authentik_policy_binding" "prj_access_users" {
|
||||||
target = authentik_application.prj_application.uuid
|
target = authentik_application.prj_application.uuid
|
||||||
policy = authentik_policy_expression.policy.id
|
policy = authentik_policy_expression.policy.id
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ variable "component" {
|
|||||||
variable "instance" {
|
variable "instance" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
variable "icon" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
variable "domain" {
|
variable "domain" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
@@ -13,12 +16,9 @@ variable "namespace" {
|
|||||||
variable "ingress-class" {
|
variable "ingress-class" {
|
||||||
type = string
|
type = string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
variable "labels" {
|
variable "labels" {
|
||||||
type = map(string)
|
type = map(string)
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "dns-names" {
|
variable "dns-names" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
}
|
}
|
||||||
@@ -26,5 +26,5 @@ variable "access-token-validity" {
|
|||||||
type = string
|
type = string
|
||||||
default = "hours=10" // ;minutes=10
|
default = "hours=10" // ;minutes=10
|
||||||
}
|
}
|
||||||
|
variable "service" {
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user