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>
This commit is contained in:
parent
ca0a53d6eb
commit
8fcb82f6cb
6 changed files with 75 additions and 3 deletions
|
@ -2,7 +2,7 @@ apiVersion: v2
|
||||||
appVersion: 2.0.3
|
appVersion: 2.0.3
|
||||||
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
|
||||||
name: argo-cd
|
name: argo-cd
|
||||||
version: 3.6.8
|
version: 3.6.9
|
||||||
home: https://github.com/argoproj/argo-helm
|
home: https://github.com/argoproj/argo-helm
|
||||||
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png
|
||||||
keywords:
|
keywords:
|
||||||
|
|
|
@ -104,7 +104,7 @@ NAME: my-release
|
||||||
|-----|------|---------|
|
|-----|------|---------|
|
||||||
| global.image.imagePullPolicy | If defined, a imagePullPolicy applied to all ArgoCD deployments. | `"IfNotPresent"` |
|
| global.image.imagePullPolicy | If defined, a imagePullPolicy applied to all ArgoCD deployments. | `"IfNotPresent"` |
|
||||||
| global.image.repository | If defined, a repository applied to all ArgoCD deployments. | `"argoproj/argocd"` |
|
| global.image.repository | If defined, a repository applied to all ArgoCD deployments. | `"argoproj/argocd"` |
|
||||||
| global.image.tag | If defined, a tag applied to all ArgoCD deployments. | `"v1.8.4"` |
|
| global.image.tag | If defined, a tag applied to all ArgoCD deployments. | `"v2.0.3"` |
|
||||||
| global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) |
|
| global.securityContext | Toggle and define securityContext | See [values.yaml](values.yaml) |
|
||||||
| global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` |
|
| global.imagePullSecrets | If defined, uses a Secret to pull an image from a private Docker registry or repository. | `[]` |
|
||||||
| global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` |
|
| global.hostAliases | Mapping between IP and hostnames that will be injected as entries in the pod's hosts files | `[]` |
|
||||||
|
@ -271,6 +271,7 @@ NAME: my-release
|
||||||
| server.ingressGrpc.labels | Additional ingress labels for dedicated [gRPC-ingress] | `{}` |
|
| server.ingressGrpc.labels | Additional ingress labels for dedicated [gRPC-ingress] | `{}` |
|
||||||
| server.ingressGrpc.ingressClassName | Defines which ingress controller will implement the resource [gRPC-ingress] | `""` |
|
| server.ingressGrpc.ingressClassName | Defines which ingress controller will implement the resource [gRPC-ingress] | `""` |
|
||||||
| server.ingressGrpc.tls | Ingress TLS configuration for dedicated [gRPC-ingress] | `[]` |
|
| server.ingressGrpc.tls | Ingress TLS configuration for dedicated [gRPC-ingress] | `[]` |
|
||||||
|
| server.ingressGrpc.isAWSALB | Setup up GRPC ingress to work with an AWS ALB | `false` |
|
||||||
| server.route.enabled | Enable a OpenShift route for the server | `false` |
|
| server.route.enabled | Enable a OpenShift route for the server | `false` |
|
||||||
| server.route.hostname | Hostname of OpenShift route | `""` |
|
| server.route.hostname | Hostname of OpenShift route | `""` |
|
||||||
| server.lifecycle | PostStart and PreStop hooks configuration | `{}` |
|
| server.lifecycle | PostStart and PreStop hooks configuration | `{}` |
|
||||||
|
@ -395,3 +396,23 @@ through `xxx.extraArgs`
|
||||||
| redis-ha.image.tag | Redis tag | `"6.2.1-alpine"` |
|
| redis-ha.image.tag | Redis tag | `"6.2.1-alpine"` |
|
||||||
|
|
||||||
[gRPC-ingress]: https://argoproj.github.io/argo-cd/operator-manual/ingress/
|
[gRPC-ingress]: https://argoproj.github.io/argo-cd/operator-manual/ingress/
|
||||||
|
|
||||||
|
|
||||||
|
### Using AWS ALB Ingress Controller With GRPC
|
||||||
|
If you are using an AWS ALB Ingress controller, you will need to set `server.ingressGrpc.isAWSALB` to `true`. This will create a second service with the annotation `alb.ingress.kubernetes.io/backend-protocol-version: HTTP2` and modify the server ingress to add a condition annotation to route GRPC traffic to the new service.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```yaml
|
||||||
|
server:
|
||||||
|
ingress:
|
||||||
|
enabled: true
|
||||||
|
annotations:
|
||||||
|
alb.ingress.kubernetes.io/backend-protocol: HTTPS
|
||||||
|
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
|
||||||
|
alb.ingress.kubernetes.io/scheme: internal
|
||||||
|
alb.ingress.kubernetes.io/target-type: ip
|
||||||
|
ingressGrpc:
|
||||||
|
enabled: true
|
||||||
|
isAWSALB: true
|
||||||
|
|
||||||
|
```
|
26
charts/argo-cd/templates/argocd-server/alb-grpc-service.yaml
Normal file
26
charts/argo-cd/templates/argocd-server/alb-grpc-service.yaml
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{{- if .Values.server.ingressGrpc.enabled -}}
|
||||||
|
{{- if .Values.server.ingressGrpc.isAWSALB -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
annotations:
|
||||||
|
alb.ingress.kubernetes.io/backend-protocol-version: HTTP2 #This tells AWS to send traffic from the ALB using HTTP2. Can use GRPC as well if you want to leverage GRPC specific features
|
||||||
|
labels:
|
||||||
|
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
|
||||||
|
name: {{ template "argo-cd.server.fullname" . }}-grpc
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: {{ .Values.server.service.servicePortHttpName }}
|
||||||
|
protocol: TCP
|
||||||
|
port: {{ .Values.server.service.servicePortHttp }}
|
||||||
|
targetPort: {{- if .Values.server.service.namedTargetPort }} {{ .Values.server.name }} {{- else }} {{ .Values.server.containerPort }} {{- end }}
|
||||||
|
- name: {{ .Values.server.service.servicePortHttpsName }}
|
||||||
|
protocol: TCP
|
||||||
|
port: {{ .Values.server.service.servicePortHttps }}
|
||||||
|
targetPort: {{- if .Values.server.service.namedTargetPort }} {{ .Values.server.name }} {{- else }} {{ .Values.server.containerPort }} {{- end }}
|
||||||
|
selector:
|
||||||
|
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }}
|
||||||
|
sessionAffinity: None
|
||||||
|
type: ClusterIP
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
|
@ -1,4 +1,4 @@
|
||||||
{{- if .Values.server.ingressGrpc.enabled -}}
|
{{- if and .Values.server.ingressGrpc.enabled (not .Values.server.ingressGrpc.isAWSALB) -}}
|
||||||
{{- $serviceName := include "argo-cd.server.fullname" . -}}
|
{{- $serviceName := include "argo-cd.server.fullname" . -}}
|
||||||
{{- $servicePort := ternary .Values.server.service.servicePortHttps .Values.server.service.servicePortHttp .Values.server.ingressGrpc.https -}}
|
{{- $servicePort := ternary .Values.server.service.servicePortHttps .Values.server.service.servicePortHttp .Values.server.ingressGrpc.https -}}
|
||||||
{{- $paths := .Values.server.ingressGrpc.paths -}}
|
{{- $paths := .Values.server.ingressGrpc.paths -}}
|
||||||
|
|
|
@ -11,6 +11,10 @@ metadata:
|
||||||
{{- range $key, $value := .Values.server.ingress.annotations }}
|
{{- range $key, $value := .Values.server.ingress.annotations }}
|
||||||
{{ $key }}: {{ $value | quote }}
|
{{ $key }}: {{ $value | quote }}
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- end }}
|
||||||
name: {{ template "argo-cd.server.fullname" . }}
|
name: {{ template "argo-cd.server.fullname" . }}
|
||||||
labels:
|
labels:
|
||||||
|
@ -34,6 +38,26 @@ spec:
|
||||||
{{- toYaml $extraPaths | nindent 10 }}
|
{{- toYaml $extraPaths | nindent 10 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- range $p := $paths }}
|
{{- 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 }}
|
- path: {{ $p }}
|
||||||
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
{{- if eq (include "argo-cd.ingress.apiVersion" $) "networking.k8s.io/v1" }}
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
|
|
|
@ -581,6 +581,7 @@ server:
|
||||||
# https://argoproj.github.io/argo-cd/operator-manual/ingress/
|
# https://argoproj.github.io/argo-cd/operator-manual/ingress/
|
||||||
ingressGrpc:
|
ingressGrpc:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
isAWSALB: false
|
||||||
annotations: {}
|
annotations: {}
|
||||||
labels: {}
|
labels: {}
|
||||||
ingressClassName: ""
|
ingressClassName: ""
|
||||||
|
|
Loading…
Reference in a new issue