fix
This commit is contained in:
@@ -9,6 +9,20 @@ locals {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
data "kubernetes_secret_v1" "authentik" {
|
||||||
|
metadata {
|
||||||
|
name = "authentik"
|
||||||
|
namespace = "${var.domain}-auth"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
data "kubernetes_ingress_v1" "authentik" {
|
||||||
|
metadata {
|
||||||
|
name = "authentik"
|
||||||
|
namespace = "${var.domain}-auth"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data "kustomization_overlay" "data" {
|
data "kustomization_overlay" "data" {
|
||||||
common_labels = local.common-labels
|
common_labels = local.common-labels
|
||||||
namespace = var.namespace
|
namespace = var.namespace
|
||||||
|
|||||||
@@ -6,45 +6,21 @@ metadata:
|
|||||||
name: grafana
|
name: grafana
|
||||||
description: null
|
description: null
|
||||||
options:
|
options:
|
||||||
app-group:
|
|
||||||
default: monitor
|
|
||||||
examples:
|
|
||||||
- monitor
|
|
||||||
type: string
|
|
||||||
volume:
|
|
||||||
default:
|
|
||||||
accessMode: ReadWriteOnce
|
|
||||||
size: 10Gi
|
|
||||||
examples:
|
|
||||||
- accessMode: ReadWriteOnce
|
|
||||||
size: 10Gi
|
|
||||||
properties:
|
|
||||||
accessMode:
|
|
||||||
default: ReadWriteOnce
|
|
||||||
enum:
|
|
||||||
- ReadWriteOnce
|
|
||||||
- ReadOnlyMany
|
|
||||||
- ReadWriteMany
|
|
||||||
type: string
|
|
||||||
size:
|
|
||||||
default: 10Gi
|
|
||||||
type: string
|
|
||||||
type: object
|
|
||||||
sub-domain:
|
|
||||||
default: grafana
|
|
||||||
examples:
|
|
||||||
- grafana
|
|
||||||
type: string
|
|
||||||
domain-name:
|
|
||||||
default: your_company.com
|
|
||||||
examples:
|
|
||||||
- your_company.com
|
|
||||||
type: string
|
|
||||||
ingress-class:
|
ingress-class:
|
||||||
default: traefik
|
default: traefik
|
||||||
examples:
|
examples:
|
||||||
- traefik
|
- traefik
|
||||||
type: string
|
type: string
|
||||||
|
domain:
|
||||||
|
default: your-company
|
||||||
|
examples:
|
||||||
|
- your-company
|
||||||
|
type: string
|
||||||
|
issuer:
|
||||||
|
default: letsencrypt-prod
|
||||||
|
examples:
|
||||||
|
- letsencrypt-prod
|
||||||
|
type: string
|
||||||
images:
|
images:
|
||||||
default:
|
default:
|
||||||
busybox:
|
busybox:
|
||||||
@@ -142,28 +118,52 @@ options:
|
|||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
issuer:
|
volume:
|
||||||
default: letsencrypt-prod
|
default:
|
||||||
|
accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
examples:
|
examples:
|
||||||
- letsencrypt-prod
|
- accessMode: ReadWriteOnce
|
||||||
|
size: 10Gi
|
||||||
|
properties:
|
||||||
|
accessMode:
|
||||||
|
default: ReadWriteOnce
|
||||||
|
enum:
|
||||||
|
- ReadWriteOnce
|
||||||
|
- ReadOnlyMany
|
||||||
|
- ReadWriteMany
|
||||||
|
type: string
|
||||||
|
size:
|
||||||
|
default: 10Gi
|
||||||
|
type: string
|
||||||
|
type: object
|
||||||
|
app-group:
|
||||||
|
default: monitor
|
||||||
|
examples:
|
||||||
|
- monitor
|
||||||
|
type: string
|
||||||
|
domain-name:
|
||||||
|
default: your_company.com
|
||||||
|
examples:
|
||||||
|
- your_company.com
|
||||||
|
type: string
|
||||||
|
sub-domain:
|
||||||
|
default: grafana
|
||||||
|
examples:
|
||||||
|
- grafana
|
||||||
type: string
|
type: string
|
||||||
admin_name:
|
admin_name:
|
||||||
default: grafana_admin
|
default: grafana_admin
|
||||||
examples:
|
examples:
|
||||||
- grafana_admin
|
- grafana_admin
|
||||||
type: string
|
type: string
|
||||||
domain:
|
|
||||||
default: your-company
|
|
||||||
examples:
|
|
||||||
- your-company
|
|
||||||
type: string
|
|
||||||
dependencies: []
|
dependencies: []
|
||||||
providers:
|
providers:
|
||||||
kubernetes: true
|
kubernetes: true
|
||||||
authentik: true
|
authentik: true
|
||||||
kubectl: true
|
kubectl: true
|
||||||
postgresql: null
|
postgresql: null
|
||||||
restapi: null
|
restapi: true
|
||||||
http: null
|
http: true
|
||||||
gitea: null
|
gitea: null
|
||||||
tfaddtype: null
|
tfaddtype: null
|
||||||
|
|||||||
71
monitor/grafana/presentation.tf
Normal file
71
monitor/grafana/presentation.tf
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
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 = "logo192.png"
|
||||||
|
request_headers = {
|
||||||
|
"Content-Type" = "application/json"
|
||||||
|
Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}"
|
||||||
|
}
|
||||||
|
service = {
|
||||||
|
"name" = "grafana"
|
||||||
|
"port" = {
|
||||||
|
"number" = 80
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module "ingress" {
|
||||||
|
source = "/dist/modules/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 = "/dist/modules/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 = "/dist/modules/oauth2"
|
||||||
|
component = var.component
|
||||||
|
instance = var.instance
|
||||||
|
namespace = var.namespace
|
||||||
|
labels = local.common-labels
|
||||||
|
dns-name = local.dns-name
|
||||||
|
redirect-path = ""
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
*/
|
||||||
Reference in New Issue
Block a user