Skip to content

Commit

Permalink
Flyte-core don't render empty ingress annotations
Browse files Browse the repository at this point in the history
 - It's possible to have no annotations set for the ingress, which ends
   up rendering an annotations:

   This can make some validators unhappy, so rewrite the rendering to
   only emit annotations: when the collection is not empty

Signed-off-by: ddl-ebrown <[email protected]>
  • Loading branch information
ddl-ebrown committed Feb 6, 2024
1 parent c4d4fef commit bae6982
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 20 deletions.
10 changes: 4 additions & 6 deletions charts/flyte-core/templates/common/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,10 @@ kind: Ingress
metadata:
name: {{ template "flyte.name" . }}-grpc
namespace: {{ template "flyte.namespace" . }}
annotations:
{{- with .Values.common.ingress.annotations }}
{{- tpl (toYaml .) $ | nindent 4}}
{{- end }}
{{- with .Values.common.ingress.separateGrpcIngressAnnotations }}
{{- toYaml . | nindent 4}}
{{- $annotations := .Values.common.ingress.annotations | deepCopy -}}
{{- $_ := merge $annotations .Values.common.ingress.separateGrpcIngressAnnotations -}}
{{- with $annotations }}
annotations: {{ tpl (toYaml .) $ | nindent 4}}
{{- end }}
spec:
ingressClassName: {{ .Values.common.ingress.ingressClassName | quote }}
Expand Down
4 changes: 2 additions & 2 deletions deployment/eks/flyte_aws_scheduler_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1550,9 +1550,10 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
{ "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
alb.ingress.kubernetes.io/certificate-arn: '<CERTIFICATE_ARN>'
alb.ingress.kubernetes.io/group.name: flyte
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
Expand All @@ -1561,7 +1562,6 @@ metadata:
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
nginx.ingress.kubernetes.io/backend-protocol: GRPC
spec:
ingressClassName:
Expand Down
4 changes: 2 additions & 2 deletions deployment/eks/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1176,9 +1176,10 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
{ "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
alb.ingress.kubernetes.io/certificate-arn: '<CERTIFICATE_ARN>'
alb.ingress.kubernetes.io/group.name: flyte
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
Expand All @@ -1187,7 +1188,6 @@ metadata:
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
nginx.ingress.kubernetes.io/backend-protocol: GRPC
spec:
ingressClassName:
Expand Down
4 changes: 2 additions & 2 deletions deployment/eks/flyte_helm_dataplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -749,9 +749,10 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
{ "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
alb.ingress.kubernetes.io/certificate-arn: '<CERTIFICATE_ARN>'
alb.ingress.kubernetes.io/group.name: flyte
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
Expand All @@ -760,7 +761,6 @@ metadata:
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
nginx.ingress.kubernetes.io/backend-protocol: GRPC
spec:
ingressClassName:
Expand Down
4 changes: 2 additions & 2 deletions deployment/eks/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1669,9 +1669,10 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig":
{ "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
alb.ingress.kubernetes.io/certificate-arn: '<CERTIFICATE_ARN>'
alb.ingress.kubernetes.io/group.name: flyte
alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS":443}]'
Expand All @@ -1680,7 +1681,6 @@ metadata:
alb.ingress.kubernetes.io/target-type: ip
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
alb.ingress.kubernetes.io/backend-protocol-version: GRPC
nginx.ingress.kubernetes.io/backend-protocol: GRPC
spec:
ingressClassName:
Expand Down
4 changes: 2 additions & 2 deletions deployment/gcp/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,12 +1183,12 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
cert-manager.io/issuer: letsencrypt-production
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
Expand Down
4 changes: 2 additions & 2 deletions deployment/gcp/flyte_helm_dataplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,12 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
cert-manager.io/issuer: letsencrypt-production
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
Expand Down
4 changes: 2 additions & 2 deletions deployment/gcp/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1683,12 +1683,12 @@ kind: Ingress
metadata:
name: flyte-core-grpc
namespace: flyte
annotations:
annotations:
cert-manager.io/issuer: letsencrypt-production
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
Expand Down

0 comments on commit bae6982

Please sign in to comment.