From 9f92288af4dce802c8bfc3d2bafa159717b1557c Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Mon, 9 Sep 2024 13:52:26 +0200 Subject: [PATCH] Add missing ArgoCD url configuration --- terraform/main.tf | 2 ++ terraform/modules/k8s-cluster/manager-node.tf | 6 ++++-- .../templates/helm/argocd-values-ha.yaml | 1 + .../templates/helm/argocd-values.yaml | 1 + terraform/modules/k8s-cluster/variables.tf | 16 +++++++++++----- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/terraform/main.tf b/terraform/main.tf index fdc07ee..8fd495a 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -74,6 +74,7 @@ module "test_cluster" { aws_access_key = var.aws_access_key aws_secret_key = var.aws_secret_key argocd_keycloak_client_secret = var.argocd_test_keycloak_client_secret + argocd_url = "https://argocd.k8s.test.2martens.de" } module "monitoring_cluster" { @@ -124,4 +125,5 @@ module "monitoring_cluster" { aws_access_key = var.aws_access_key aws_secret_key = var.aws_secret_key argocd_keycloak_client_secret = var.argocd_monitoring_keycloak_client_secret + argocd_url = "https://argocd.k8s.monitoring.2martens.de" } \ No newline at end of file diff --git a/terraform/modules/k8s-cluster/manager-node.tf b/terraform/modules/k8s-cluster/manager-node.tf index 49ce983..3ccaf5b 100644 --- a/terraform/modules/k8s-cluster/manager-node.tf +++ b/terraform/modules/k8s-cluster/manager-node.tf @@ -126,10 +126,12 @@ resource "hcloud_server" "manager" { aws_secret_key : var.aws_secret_key })) argocd_ha_values : base64encode(templatefile("${path.module}/templates/helm/argocd-values-ha.yaml", { - argocd_keycloak_client_secret : var.argocd_keycloak_client_secret + argocd_keycloak_client_secret : var.argocd_keycloak_client_secret, + argocd_url : var.argocd_url })) argocd_values : base64encode(templatefile("${path.module}/templates/helm/argocd-values.yaml", { - argocd_keycloak_client_secret : var.argocd_keycloak_client_secret + argocd_keycloak_client_secret : var.argocd_keycloak_client_secret, + argocd_url : var.argocd_url })) cluster_setup : base64encode(templatefile("${path.module}/templates/scripts/cluster-setup.sh", { argocd_environment : var.argocd_environment diff --git a/terraform/modules/k8s-cluster/templates/helm/argocd-values-ha.yaml b/terraform/modules/k8s-cluster/templates/helm/argocd-values-ha.yaml index a5c264f..5cbdf73 100644 --- a/terraform/modules/k8s-cluster/templates/helm/argocd-values-ha.yaml +++ b/terraform/modules/k8s-cluster/templates/helm/argocd-values-ha.yaml @@ -4,6 +4,7 @@ global: configs: cm: + url: ${argocd_url} oidc.config: | name: Keycloak issuer: https://id.2martens.de/realms/2martens diff --git a/terraform/modules/k8s-cluster/templates/helm/argocd-values.yaml b/terraform/modules/k8s-cluster/templates/helm/argocd-values.yaml index 8bea405..532d0ea 100644 --- a/terraform/modules/k8s-cluster/templates/helm/argocd-values.yaml +++ b/terraform/modules/k8s-cluster/templates/helm/argocd-values.yaml @@ -3,6 +3,7 @@ global: format: text configs: cm: + url: ${argocd_url} oidc.config: | name: Keycloak issuer: https://id.2martens.de/realms/2martens diff --git a/terraform/modules/k8s-cluster/variables.tf b/terraform/modules/k8s-cluster/variables.tf index b272c53..37f9750 100644 --- a/terraform/modules/k8s-cluster/variables.tf +++ b/terraform/modules/k8s-cluster/variables.tf @@ -55,13 +55,13 @@ variable "server_subnet_id" { variable "private_node_ips" { description = "One IP in the private network subnet for each manager node created." - type = list(string) + type = list(string) } variable "private_worker_node_ips" { description = "One IP in the private network subnet for each worker node created." - type = list(string) - default = [] + type = list(string) + default = [] } variable "basic_firewall_id" { @@ -151,8 +151,8 @@ variable "vault_service_principal" { variable "vault_allowed_namespaces" { description = "Namespaces that are allowed to access secrets from the Vault" - type = list(string) - default = [] + type = list(string) + default = [] } variable "hcloud_token_enabled" { @@ -212,3 +212,9 @@ variable "argocd_keycloak_client_secret" { default = "" sensitive = true } +variable "argocd_url" { + description = "Base URL of ArgoCD application" + type = string + default = "" + sensitive = false +} \ No newline at end of file