diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index 8c506f4f..171f589f 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -56,10 +56,9 @@ $ helm install --name my-release argo/argo-cd | dexServer.servicePortHttp | int | `5556` | Service port for Dex Server GRPC | | dexServer.volumeMounts | list | `[]` | Additional volume mounts | | dexServer.volumes | list | `[]` | Additional volumes | +| ingress.additionalHosts | list | `[]` | Ingress additional hosts | | ingress.annotations | object | `{}` | Annotations for ingress object, set `nginx.ingress.kubernetes.io/force-ssl-redirect: "true"` and `nginx.ingress.kubernetes.io/ssl-passthrough: "true"` if serving GRPC and HTTPS on the same ingress | | ingress.enabled | bool | `false` | Enable ingress | -| ingress.hosts[0] | string | `"argocd.example.com"` | Ingress host | -| ingress.path | string | `"/"` | Ingress path | | rbac.policyCsv | string | `nil` | RBAC policy in CSV, see [values.yaml](./values.yaml) for format | | rbac.policyDefault | string | `nil` | The default role Argo CD will fall back to, when authorizing API requests, ie: `role:readonly` | | rbac.scopes | string | `nil` | Scopes controls which OIDC scopes to examine during rbac enforcement (in addition to `sub` scope). ie: `[groups]` | diff --git a/charts/argo-cd/templates/argocd-server-ingress.yaml b/charts/argo-cd/templates/argocd-server-ingress.yaml index 459ce6bd..283d65f2 100644 --- a/charts/argo-cd/templates/argocd-server-ingress.yaml +++ b/charts/argo-cd/templates/argocd-server-ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} -{{- $ingressPath := .Values.ingress.path -}} -{{- $servicePortHttps := .Values.server.servicePortHttps -}} +{{- $host := regexReplaceAll "^https?://([^/]+)(/.*)?$" .Values.config.url "${1}" }} +{{- $path := default "/" (regexReplaceAll "^https?://([^/]+)(/.*)?$" .Values.config.url "${2}") }} apiVersion: extensions/v1beta1 kind: Ingress metadata: @@ -17,22 +17,13 @@ metadata: {{- end }} spec: rules: - {{- with .Values.config.url }} + {{- range prepend .Values.ingress.additionalHosts $host }} - host: {{ . | quote }} http: paths: - - path: {{ $ingressPath }} + - path: {{ $path | quote }} backend: serviceName: argocd-server - servicePort: {{ $servicePortHttps }} - {{- end }} - {{- range .Values.ingress.additionalHosts }} - - host: {{ . | quote }} - http: - paths: - - path: {{ $ingressPath }} - backend: - serviceName: argocd-server - servicePort: {{ $servicePortHttps }} + servicePort: https {{- end }} {{- end }}