Skip to content

Commit

Permalink
add support for ingress host (#4)
Browse files Browse the repository at this point in the history
* add support for specifying ingress host
  • Loading branch information
nilic authored Oct 2, 2022
1 parent e9389b6 commit 2a85db8
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ No modules.
| <a name="input_argocd_chart_values"></a> [argocd\_chart\_values](#input\_argocd\_chart\_values) | A map of key/value to set ArgoCD chart values or override defaults.<br>The key must be specified as the full path to the key, e.g: `configs.secret.bitbucketServerSecret`. <br>Please consult [ArgoCD Helm chart docs](https://github.com/argoproj/argo-helm/tree/main/charts/argo-cd). | `map(string)` | `{}` | no |
| <a name="input_argocd_chart_version"></a> [argocd\_chart\_version](#input\_argocd\_chart\_version) | ArgoCD chart version to install. If not specified, latest version is installed | `string` | `null` | no |
| <a name="input_argocd_ingress_enabled"></a> [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 |
| <a name="input_argocd_ingress_host"></a> [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 |
| <a name="input_argocd_namespace"></a> [argocd\_namespace](#input\_argocd\_namespace) | Kubernetes/OpenShift namespace to install ArgoCD chart to | `string` | `"argocd"` | no |
| <a name="input_argocd_namespace_create"></a> [argocd\_namespace\_create](#input\_argocd\_namespace\_create) | Whether to create the namespace where ArgoCD chart will be installed | `bool` | `true` | no |
| <a name="input_argocd_openshift"></a> [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 |
Expand Down
1 change: 1 addition & 0 deletions examples/deployment-and-bootstrap/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion examples/deployment-only/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ provider "helm" {
module "argocd" {
source = "../.."

argocd_ingress_enabled = false
argocd_ingress_host = "argocd.example.com"
}
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
)]
Expand Down
6 changes: 4 additions & 2 deletions templates/values-argocd-settings.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2a85db8

Please sign in to comment.