X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=helm%2Finfrastructure%2Fsubcharts%2Fkong%2Ftemplates%2Fingress-proxy.yaml;h=9976df9108d3c9985fa81dae98b5ca510dbc6308;hb=7a43fbd4642448783aaf708d07ca883bf9bc5afd;hp=002f0cd63f347521f994020829a740fea5aae4c1;hpb=282e7af25ec053ae6d1c5a399c91c2c323f705cd;p=ric-plt%2Fric-dep.git diff --git a/helm/infrastructure/subcharts/kong/templates/ingress-proxy.yaml b/helm/infrastructure/subcharts/kong/templates/ingress-proxy.yaml index 002f0cd..9976df9 100755 --- a/helm/infrastructure/subcharts/kong/templates/ingress-proxy.yaml +++ b/helm/infrastructure/subcharts/kong/templates/ingress-proxy.yaml @@ -2,23 +2,29 @@ {{- $serviceName := include "kong.fullname" . -}} {{- $servicePort := include "kong.ingress.servicePort" .Values.proxy -}} {{- $path := .Values.proxy.ingress.path -}} -apiVersion: networking.k8s.io/v1beta1 +{{- $hosts_count := len .Values.proxy.ingress.hosts -}} +apiVersion: extensions/v1beta1 kind: Ingress metadata: name: {{ template "kong.fullname" . }}-proxy labels: - app: {{ template "kong.name" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" + {{- include "kong.metaLabels" . | nindent 4 }} annotations: {{- range $key, $value := .Values.proxy.ingress.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} spec: rules: + {{- if eq $hosts_count 0 }} + - http: + paths: + - path: {{ $path }} + backend: + serviceName: {{ $serviceName }}-proxy + servicePort: {{ $servicePort }} + {{ else -}} {{- range $host := .Values.proxy.ingress.hosts }} - - host: {{ $host }} + - host: {{ $host | quote }} http: paths: - path: {{ $path }} @@ -26,6 +32,7 @@ spec: serviceName: {{ $serviceName }}-proxy servicePort: {{ $servicePort }} {{- end -}} + {{- end -}} {{- if .Values.proxy.ingress.tls }} tls: {{ toYaml .Values.proxy.ingress.tls | indent 4 }}