From 1662fca251831fa23aa3a9a3229ee8e3a42a9951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Huss?= Date: Wed, 24 Jan 2024 15:08:13 +0100 Subject: [PATCH] fix --- monitor/grafana/config.tf | 8 +++++- monitor/grafana/index.yaml | 50 ++++++++++++++++----------------- monitor/grafana/presentation.tf | 27 +++++++++--------- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/monitor/grafana/config.tf b/monitor/grafana/config.tf index 07830ec..6142c96 100644 --- a/monitor/grafana/config.tf +++ b/monitor/grafana/config.tf @@ -21,6 +21,12 @@ resource "kubectl_manifest" "config" { provisioning = /etc/grafana/provisioning [server] domain = '' - + root_url = 'https://${local.dns-name}/' + [auth.generic_oauth] + enabled = true + client_id = '${module.oauth2.client_id}' + client_secret = '${module.oauth2.client_secret}' + auth_url = '${module.oauth2.sso_configuration_url}' + api_url = '${module.oauth2.sso_userinfo}' EOF } diff --git a/monitor/grafana/index.yaml b/monitor/grafana/index.yaml index 41ae9b2..9f59bd4 100644 --- a/monitor/grafana/index.yaml +++ b/monitor/grafana/index.yaml @@ -6,41 +6,16 @@ metadata: name: grafana description: null options: - admin_name: - default: grafana_admin - examples: - - grafana_admin - type: string app-group: default: monitor examples: - monitor type: string - domain: - default: your-company - examples: - - your-company - type: string sub-domain: default: grafana examples: - grafana type: string - domain-name: - default: your_company.com - examples: - - your_company.com - type: string - issuer: - default: letsencrypt-prod - examples: - - letsencrypt-prod - type: string - ingress-class: - default: traefik - examples: - - traefik - type: string images: default: busybox: @@ -138,6 +113,11 @@ options: type: string type: object type: object + domain: + default: your-company + examples: + - your-company + type: string volume: default: accessMode: ReadWriteOnce @@ -157,6 +137,26 @@ options: default: 10Gi type: string type: object + domain-name: + default: your_company.com + examples: + - your_company.com + type: string + admin_name: + default: grafana_admin + examples: + - grafana_admin + type: string + ingress-class: + default: traefik + examples: + - traefik + type: string + issuer: + default: letsencrypt-prod + examples: + - letsencrypt-prod + type: string dependencies: [] providers: kubernetes: true diff --git a/monitor/grafana/presentation.tf b/monitor/grafana/presentation.tf index ada7a54..5889258 100644 --- a/monitor/grafana/presentation.tf +++ b/monitor/grafana/presentation.tf @@ -2,7 +2,7 @@ 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" + icon = "public/img/grafana_icon.svg" request_headers = { "Content-Type" = "application/json" Authorization = "Bearer ${data.kubernetes_secret_v1.authentik.data["AUTHENTIK_BOOTSTRAP_TOKEN"]}" @@ -16,27 +16,27 @@ locals { } module "ingress" { - source = "/dist/modules/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 + ingress_class = var.ingress-class labels = local.common-labels - dns-names = local.dns-names + dns_names = local.dns-names middlewares = [] - service = local.service + services = [local.service] providers = { kubectl = kubectl } } -/* module "application" { - source = "/dist/modules/application" + 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 + app_group = var.app-group + dns_name = local.dns-name icon = local.icon protocol_provider = module.oauth2.provider-id providers = { @@ -45,13 +45,13 @@ module "ingress" { } module "oauth2" { - source = "/dist/modules/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 = "" + dns_name = local.dns-name + redirect_path = "login/generic_oauth" providers = { kubernetes = kubernetes kubectl = kubectl @@ -67,5 +67,4 @@ provider "restapi" { destroy_method = "PATCH" write_returns_object = true id_attribute = "name" -} - */ \ No newline at end of file +} \ No newline at end of file