diff --git a/cockroachdb/templates/ingress.yaml b/cockroachdb/templates/ingress.yaml index 2fa6373c..f6f70fe7 100644 --- a/cockroachdb/templates/ingress.yaml +++ b/cockroachdb/templates/ingress.yaml @@ -28,9 +28,9 @@ metadata: app.kubernetes.io/name: {{ template "cockroachdb.name" . }} app.kubernetes.io/instance: {{ $.Release.Name | quote }} app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} -{{- if .Values.ingress.labels }} -{{- toYaml .Values.ingress.labels | nindent 4 }} -{{- end }} + {{- if .Values.ingress.labels }} + {{- toYaml .Values.ingress.labels | nindent 4 }} + {{- end }} spec: rules: {{- if .Values.ingress.hosts }} @@ -38,53 +38,62 @@ spec: - host: {{ $host }} http: paths: - {{- range $path := $paths }} + {{- range $path := $paths }} + {{- if kindIs "map" $path }} + - path: {{ $path.path | quote }} + pathType: {{ $path.pathType | quote }} + {{- else }} - path: {{ $path | quote }} - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} - {{- if $.Values.iap.enabled }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + {{- if $.Values.iap.enabled }} pathType: ImplementationSpecific - {{- else }} + {{- else }} pathType: Prefix - {{- end }} - {{- end }} + {{- end }} + {{- end }} + {{- end }} backend: - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} service: name: {{ $fullName }}-public port: name: {{ $ports.http.name | quote }} - {{- else }} + {{- else }} serviceName: {{ $fullName }}-public servicePort: {{ $ports.http.name | quote }} - {{- end }} - {{- end }} + {{- end }} + {{- end }} {{- end }} {{- else }} - http: paths: - {{- range $path := $paths }} + {{- range $path := $paths }} + {{- if kindIs "map" $path }} + - path: {{ $path.path | quote }} + pathType: {{ $path.pathType | quote }} + {{- else }} - path: {{ $path | quote }} - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} - {{- if $.Values.iap.enabled }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + {{- if $.Values.iap.enabled }} pathType: ImplementationSpecific - {{- else }} + {{- else }} pathType: Prefix - {{- end }} - {{- end }} + {{- end }} + {{- end }} + {{- end }} backend: - {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + {{- if $.Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} service: name: {{ $fullName }}-public port: name: {{ $ports.http.name | quote }} - {{- else }} + {{- else }} serviceName: {{ $fullName }}-public servicePort: {{ $ports.http.name | quote }} - {{- end }} - {{- end }} - {{- end }} - {{- if .Values.ingress.tls }} - tls: -{{- toYaml .Values.ingress.tls | nindent 4 }} + {{- end }} + {{- end }} {{- end }} +{{- if .Values.ingress.tls }} + tls: {{- toYaml .Values.ingress.tls | nindent 4 }} +{{- end }} {{- end }} diff --git a/cockroachdb/values.yaml b/cockroachdb/values.yaml index 9d54946d..584a96ce 100644 --- a/cockroachdb/values.yaml +++ b/cockroachdb/values.yaml @@ -308,7 +308,10 @@ ingress: annotations: {} # kubernetes.io/ingress.class: nginx # cert-manager.io/cluster-issuer: letsencrypt - paths: [/] + paths: + - / + # or alternatively: + # - {path: /, pathType: Prefix} hosts: [] # - cockroachlabs.com tls: []