diff --git a/charts/dotnet-app/Chart.yaml b/charts/dotnet-app/Chart.yaml index 9152ae5..71e28ec 100644 --- a/charts/dotnet-app/Chart.yaml +++ b/charts/dotnet-app/Chart.yaml @@ -4,6 +4,6 @@ description: SitkoRu dotnet app type: application -version: 0.3.0 +version: 0.4.0 appVersion: "1.0.0" diff --git a/charts/dotnet-app/templates/ingress.yaml b/charts/dotnet-app/templates/ingress.yaml index 687367c..d4fbf78 100644 --- a/charts/dotnet-app/templates/ingress.yaml +++ b/charts/dotnet-app/templates/ingress.yaml @@ -1,18 +1,17 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "dotnet-app.fullname" . -}} {{- $svcPort := .Values.service.port -}} -{{- $grcpEnabled := .Values.ingress.grpcEnabled -}} -{{- $grcpPort := .Values.service.grpcPort -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} labels: {{- include "dotnet-app.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} annotations: + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} + nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" spec: ingressClassName: {{ .Values.ingress.className }} {{- if .Values.ingress.tls }} @@ -30,17 +29,6 @@ spec: - host: {{ .host | quote }} http: paths: - {{- if $grcpEnabled -}} - {{- range .grpcPaths }} - - path: {{ . }} - pathType: Prefix - backend: - service: - name: "{{ $fullName }}-grpc" - port: - number: {{ $grcpPort }} - {{- end }} - {{- end }} {{- range .paths }} - path: {{ .path }} pathType: {{ .pathType }} @@ -52,3 +40,46 @@ spec: {{- end }} {{- end }} {{- end }} +--- +{{- if and .Values.ingress.enabled .Values.ingress.grpcEnabled -}} +{{- $fullName := include "dotnet-app.fullname" . -}} +{{- $grcpPort := .Values.service.grpcPort -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: "{{ $fullName }}-grpc" + labels: + {{- include "dotnet-app.labels" . | nindent 4 }} + annotations: + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} + nginx.ingress.kubernetes.io/backend-protocol: "GRPCS" +spec: + ingressClassName: {{ .Values.ingress.className }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .grpcPaths }} + - path: {{ . }} + pathType: Prefix + backend: + service: + name: "{{ $fullName }}-grpc" + port: + number: {{ $grcpPort }} + {{- end }} + {{- end }} +{{- end }} \ No newline at end of file