diff --git a/README.md b/README.md index 7698753..8923de3 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ No modules. | [argocd\_chart\_values](#input\_argocd\_chart\_values) | A map of key/value to set ArgoCD chart values or override defaults.
The key must be specified as the full path to the key, e.g: `configs.secret.bitbucketServerSecret`.
Please consult [ArgoCD Helm chart docs](https://github.com/argoproj/argo-helm/tree/main/charts/argo-cd). | `map(string)` | `{}` | no | | [argocd\_chart\_version](#input\_argocd\_chart\_version) | ArgoCD chart version to install. If not specified, latest version is installed | `string` | `null` | no | | [argocd\_ingress\_enabled](#input\_argocd\_ingress\_enabled) | Whether to enable a Kubernetes Ingress resource for the ArgoCD server. Will be set to `false` if `argocd_openshift` set to `true` | `bool` | `false` | no | +| [argocd\_ingress\_host](#input\_argocd\_ingress\_host) | Host for the created Ingress resource. If not set, Ingress resource will be created with `*` as host. Honored only if `argocd_ingress_enabled` set to `true` | `string` | `""` | no | | [argocd\_namespace](#input\_argocd\_namespace) | Kubernetes/OpenShift namespace to install ArgoCD chart to | `string` | `"argocd"` | no | | [argocd\_namespace\_create](#input\_argocd\_namespace\_create) | Whether to create the namespace where ArgoCD chart will be installed | `bool` | `true` | no | | [argocd\_openshift](#input\_argocd\_openshift) | Whether ArgoCD is deployed on OpenShift. If set to `true`, OpenShift route will be created and repo server will run under a random UID instead of 0 | `bool` | `false` | no | diff --git a/examples/deployment-and-bootstrap/main.tf b/examples/deployment-and-bootstrap/main.tf index a127282..12e9a5f 100644 --- a/examples/deployment-and-bootstrap/main.tf +++ b/examples/deployment-and-bootstrap/main.tf @@ -8,6 +8,7 @@ module "argocd" { source = "../.." argocd_ingress_enabled = true + argocd_ingress_host = "argocd.example.com" argocd_admin_password_length = 16 argocd_admin_password_special_characters = "!_" argocd_project_name = "my-project" diff --git a/examples/deployment-only/main.tf b/examples/deployment-only/main.tf index fea6b72..0228cae 100644 --- a/examples/deployment-only/main.tf +++ b/examples/deployment-only/main.tf @@ -7,5 +7,5 @@ provider "helm" { module "argocd" { source = "../.." - argocd_ingress_enabled = false + argocd_ingress_host = "argocd.example.com" } diff --git a/main.tf b/main.tf index db146ea..4c75555 100644 --- a/main.tf +++ b/main.tf @@ -17,6 +17,7 @@ locals { admin_password = bcrypt(random_password.argocd_admin_password.result), timezone = var.argocd_timezone ingress = var.argocd_ingress_enabled ? "true" : "false" + ingress_host = var.argocd_ingress_host openshift = var.argocd_openshift ? "true" : "false" } )] diff --git a/templates/values-argocd-settings.tftpl b/templates/values-argocd-settings.tftpl index cd6f4c8..842e794 100644 --- a/templates/values-argocd-settings.tftpl +++ b/templates/values-argocd-settings.tftpl @@ -13,10 +13,12 @@ server: %{ if openshift == "false" } extraArgs: - "--insecure" - - "--rootpath=/argocd" - - "--basehref=/argocd" ingress: enabled: ${ingress} + %{ if ingress_host != "" } + hosts: + - ${ingress_host} + %{ endif } %{ endif } route: enabled: ${openshift} diff --git a/variables.tf b/variables.tf index dc8d093..1091d5a 100644 --- a/variables.tf +++ b/variables.tf @@ -26,6 +26,12 @@ variable "argocd_ingress_enabled" { default = false } +variable "argocd_ingress_host" { + description = "Host for the created Ingress resource. If not set, Ingress resource will be created with `*` as host. Honored only if `argocd_ingress_enabled` set to `true`" + type = string + default = "" +} + variable "argocd_openshift" { description = "Whether ArgoCD is deployed on OpenShift. If set to `true`, OpenShift route will be created and repo server will run under a random UID instead of 0" type = bool