From ec7d27d369b27a6b8c7c913869dfc390c2c9692a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Tue, 27 Feb 2024 11:05:19 +0100 Subject: [PATCH] docs(sks): update example with new module versions --- examples/sks/apps.tf | 2 ++ examples/sks/dns.tf | 2 +- examples/sks/locals.tf | 1 + examples/sks/main.tf | 34 ++++++++++++++++++++-------------- examples/sks/terraform.tf | 2 +- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/examples/sks/apps.tf b/examples/sks/apps.tf index 19f1a1528b..f58628ebd1 100644 --- a/examples/sks/apps.tf +++ b/examples/sks/apps.tf @@ -44,12 +44,14 @@ module "helloworld_apps" { cluster: name: "${module.sks.cluster_name}" domain: "${module.sks.base_domain}" + subdomain: "${local.subdomain}" issuer: "${local.cluster_issuer}" apps: longhorn: true grafana: true prometheus: true thanos: true + alertmanager: true EOT } } diff --git a/examples/sks/dns.tf b/examples/sks/dns.tf index 43b904c3b5..67115137b9 100644 --- a/examples/sks/dns.tf +++ b/examples/sks/dns.tf @@ -11,7 +11,7 @@ resource "exoscale_domain_record" "wildcard" { count = local.activate_wildcard_record ? 1 : 0 domain = resource.exoscale_domain.domain.id - name = "*.apps" + name = local.subdomain != "" ? "*.${local.subdomain}" : "*" record_type = "A" ttl = "300" content = module.sks.nlb_ip_address diff --git a/examples/sks/locals.tf b/examples/sks/locals.tf index cbeb75ae2e..218ef6792c 100644 --- a/examples/sks/locals.tf +++ b/examples/sks/locals.tf @@ -4,6 +4,7 @@ locals { zone = "YOUR_CLUSTER_ZONE" service_level = "starter" base_domain = "your.domain.here" + subdomain = "apps" activate_wildcard_record = true cluster_issuer = module.cert-manager.cluster_issuers.staging letsencrypt_issuer_email = "YOUR_EMAIL_ADDRESS" diff --git a/examples/sks/main.tf b/examples/sks/main.tf index ca99963243..107887aa2f 100644 --- a/examples/sks/main.tf +++ b/examples/sks/main.tf @@ -1,10 +1,11 @@ module "sks" { - source = "git::https://github.com/camptocamp/devops-stack-module-cluster-sks.git?ref=v1.1.1" + source = "git::https://github.com/camptocamp/devops-stack-module-cluster-sks.git?ref=v1.2.0" cluster_name = local.cluster_name kubernetes_version = local.kubernetes_version zone = local.zone base_domain = resource.exoscale_domain.domain.name + subdomain = local.subdomain service_level = local.service_level @@ -20,7 +21,7 @@ module "sks" { } module "argocd_bootstrap" { - source = "git::https://github.com/camptocamp/devops-stack-module-argocd.git//bootstrap?ref=v4.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-argocd.git//bootstrap?ref=v4.3.0" argocd_projects = { "${module.sks.cluster_name}" = { @@ -32,10 +33,8 @@ module "argocd_bootstrap" { } module "traefik" { - source = "git::https://github.com/camptocamp/devops-stack-module-traefik.git//sks?ref=v5.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-traefik.git//sks?ref=v6.2.0" - cluster_name = module.sks.cluster_name - base_domain = module.sks.base_domain argocd_project = module.sks.cluster_name nlb_id = module.sks.nlb_id @@ -51,7 +50,7 @@ module "traefik" { } module "cert-manager" { - source = "git::https://github.com/camptocamp/devops-stack-module-cert-manager.git//sks?ref=v8.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-cert-manager.git//sks?ref=v8.1.0" argocd_project = module.sks.cluster_name @@ -60,7 +59,6 @@ module "cert-manager" { app_autosync = local.app_autosync enable_service_monitor = local.enable_service_monitor - dependency_ids = { argocd = module.argocd_bootstrap.id } @@ -68,10 +66,11 @@ module "cert-manager" { # TODO Create an external database as PoC module "keycloak" { - source = "git::https://github.com/camptocamp/devops-stack-module-keycloak.git?ref=v3.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-keycloak.git?ref=v3.1.1" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer argocd_project = module.sks.cluster_name @@ -85,10 +84,11 @@ module "keycloak" { } module "oidc" { - source = "git::https://github.com/camptocamp/devops-stack-module-keycloak.git//oidc_bootstrap?ref=v3.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-keycloak.git//oidc_bootstrap?ref=v3.1.1" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer user_map = { @@ -106,16 +106,18 @@ module "oidc" { } module "longhorn" { - source = "git::https://github.com/camptocamp/devops-stack-module-longhorn.git?ref=v3.2.1" + source = "git::https://github.com/camptocamp/devops-stack-module-longhorn.git?ref=v3.4.0" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer argocd_project = module.sks.cluster_name app_autosync = local.app_autosync enable_service_monitor = local.enable_service_monitor + enable_preupgrade_check = false # Remove this variable or set it to true after the first install of the Longhorn module. enable_dashboard_ingress = true oidc = module.oidc.oidc @@ -160,15 +162,17 @@ module "loki-stack" { } module "thanos" { - source = "git::https://github.com/camptocamp/devops-stack-module-thanos.git//sks?ref=v3.0.1" + source = "git::https://github.com/camptocamp/devops-stack-module-thanos.git//sks?ref=v4.0.0" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer cluster_id = module.sks.cluster_id argocd_project = module.sks.cluster_name - app_autosync = local.app_autosync + app_autosync = local.app_autosync + enable_service_monitor = local.enable_service_monitor metrics_storage = { bucket_name = resource.aws_s3_bucket.this["thanos"].id @@ -192,10 +196,11 @@ module "thanos" { } module "kube-prometheus-stack" { - source = "git::https://github.com/camptocamp/devops-stack-module-kube-prometheus-stack.git//sks?ref=v9.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-kube-prometheus-stack.git//sks?ref=v9.2.1" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer argocd_project = module.sks.cluster_name @@ -230,10 +235,11 @@ module "kube-prometheus-stack" { } module "argocd" { - source = "git::https://github.com/camptocamp/devops-stack-module-argocd.git?ref=v4.0.0" + source = "git::https://github.com/camptocamp/devops-stack-module-argocd.git?ref=v4.3.0" cluster_name = module.sks.cluster_name base_domain = module.sks.base_domain + subdomain = local.subdomain cluster_issuer = local.cluster_issuer argocd_project = module.sks.cluster_name diff --git a/examples/sks/terraform.tf b/examples/sks/terraform.tf index d1cdfa6fb5..65626b01f6 100644 --- a/examples/sks/terraform.tf +++ b/examples/sks/terraform.tf @@ -90,7 +90,7 @@ provider "keycloak" { client_id = "admin-cli" username = module.keycloak.admin_credentials.username password = module.keycloak.admin_credentials.password - url = "https://keycloak.apps.${module.sks.cluster_name}.${module.sks.base_domain}" + url = format("https://keycloak.%s.%s", trimprefix("${local.subdomain}.${module.sks.cluster_name}", "."), module.sks.base_domain) tls_insecure_skip_verify = true # Can be disabled/removed when using letsencrypt-prod as cluster issuer initial_login = false }