{{- if and .Values.server.ingressGrpc.enabled (not .Values.server.ingressGrpc.isAWSALB) -}} {{- $serviceName := include "argo-cd.server.fullname" . -}} {{- $servicePort := ternary .Values.server.service.servicePortHttps .Values.server.service.servicePortHttp .Values.server.ingressGrpc.https -}} {{- $paths := .Values.server.ingressGrpc.paths -}} {{- $extraPaths := .Values.server.ingressGrpc.extraPaths -}} {{- $pathType := .Values.server.ingressGrpc.pathType -}} apiVersion: {{ include "argo-cd.apiVersion.ingress" . }} kind: Ingress metadata: {{- if .Values.server.ingressGrpc.annotations }} annotations: {{- range $key, $value := .Values.server.ingressGrpc.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} {{- end }} name: {{ template "argo-cd.server.fullname" . }}-grpc labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} {{- if .Values.server.ingressGrpc.labels }} {{- toYaml .Values.server.ingressGrpc.labels | nindent 4 }} {{- end }} spec: {{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }} {{- with .Values.server.ingressGrpc.ingressClassName }} ingressClassName: {{ . }} {{- end }} {{- end }} rules: {{- if .Values.server.ingressGrpc.hosts }} {{- range $host := .Values.server.ingressGrpc.hosts }} - host: {{ $host }} http: paths: {{- if $extraPaths }} {{- toYaml $extraPaths | nindent 10 }} {{- end -}} {{- range $p := $paths }} - path: {{ $p }} {{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }} pathType: {{ $pathType }} {{- end }} backend: {{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }} service: name: {{ $serviceName }} port: {{- if kindIs "float64" $servicePort }} number: {{ $servicePort }} {{- else }} name: {{ $servicePort }} {{- end }} {{- else }} serviceName: {{ $serviceName }} servicePort: {{ $servicePort }} {{- end }} {{- end -}} {{- end -}} {{- else }} - http: paths: {{- if $extraPaths }} {{- toYaml $extraPaths | nindent 10 }} {{- end -}} {{- range $p := $paths }} - path: {{ $p }} {{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }} pathType: {{ $pathType }} {{- end }} backend: {{- if eq (include "argo-cd.apiVersion.ingress" $) "networking.k8s.io/v1" }} service: name: {{ $serviceName }} port: {{- if kindIs "float64" $servicePort }} number: {{ $servicePort }} {{- else }} name: {{ $servicePort }} {{- end }} {{- else }} serviceName: {{ $serviceName }} servicePort: {{ $servicePort }} {{- end }} {{- end -}} {{- end -}} {{- if .Values.server.ingressGrpc.tls }} tls: {{- toYaml .Values.server.ingressGrpc.tls | nindent 4 }} {{- end -}} {{- end -}}