Skip to content

Commit

Permalink
docs(sks): update example with new module versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lentidas committed Mar 15, 2024
1 parent 2d9b340 commit ec7d27d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 16 deletions.
2 changes: 2 additions & 0 deletions examples/sks/apps.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/sks/dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions examples/sks/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
34 changes: 20 additions & 14 deletions examples/sks/main.tf
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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}" = {
Expand All @@ -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
Expand All @@ -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

Expand All @@ -60,18 +59,18 @@ module "cert-manager" {
app_autosync = local.app_autosync
enable_service_monitor = local.enable_service_monitor


dependency_ids = {
argocd = module.argocd_bootstrap.id
}
}

# 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

Expand All @@ -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 = {
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/sks/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit ec7d27d

Please sign in to comment.