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 Jan 31, 2024
1 parent 3008f0e commit 8b526d8
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.class | 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 @@ -1549,9 +1549,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 @@ -1560,7 +1561,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 @@ -1177,9 +1177,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 @@ -1188,7 +1189,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 @@ -747,9 +747,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 @@ -758,7 +759,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 @@ -1668,9 +1668,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 @@ -1679,7 +1680,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 @@ -1184,12 +1184,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 @@ -746,12 +746,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 @@ -1682,12 +1682,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 8b526d8

Please sign in to comment.