feat(argo-cd): Support AWS ALB Ingress with gRPC (#806)

* Support AWS ALB Ingress with GRPC

Signed-off-by: Thomas O'Neill <toneill818@gmail.com>
Signed-off-by: Thomas O'Neill <toneill@new-innov.com>

* Bump chart version

Signed-off-by: Marco Kilchhofer <marco@kilchhofer.info>

* Apply suggestions from code review

Signed-off-by: Marco Kilchhofer <marco@kilchhofer.info>

* Use single if statement

Signed-off-by: Thomas O'Neill <toneill@new-innov.com>

* Append -grpc to the service labels for ALB GRPC service

Signed-off-by: Thomas O'Neill <toneill@new-innov.com>

Co-authored-by: Thomas O'Neill <toneill@new-innov.com>
Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Marco Kilchhofer <marco@kilchhofer.info>
This commit is contained in:
Thomas O'Neill 2021-07-20 07:40:54 -04:00 committed by GitHub
parent 922799081d
commit 1e3a4afd05
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 73 additions and 4 deletions

View file

@ -12,6 +12,10 @@ metadata:
{{- range $key, $value := .Values.server.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- if and .Values.server.ingressGrpc.isAWSALB .Values.server.ingressGrpc.enabled }}
alb.ingress.kubernetes.io/conditions.{{ template "argo-cd.server.fullname" . }}-grpc: |
[{"field":"http-header","httpHeaderConfig":{"httpHeaderName": "Content-Type", "values":["application/grpc"]}}]
{{- end }}
{{- end }}
name: {{ template "argo-cd.server.fullname" . }}
labels:
@ -35,6 +39,26 @@ spec:
{{- toYaml $extraPaths | nindent 10 }}
{{- end }}
{{- range $p := $paths }}
{{- if and $.Values.server.ingressGrpc.isAWSALB $.Values.server.ingressGrpc.enabled }}
- path: {{ $p }}
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
pathType: Prefix
{{- end }}
backend:
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
service:
name: {{ template "argo-cd.server.fullname" $ }}-grpc
port:
{{- if kindIs "float64" $servicePort }}
number: {{ $servicePort }}
{{- else }}
name: {{ $servicePort }}
{{- end }}
{{- else }}
serviceName: {{ template "argo-cd.server.fullname" $ }}-grpc
servicePort: {{ $servicePort }}
{{- end }}
{{- end }}
- path: {{ $p }}
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
pathType: {{ $pathType }}