Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flyte-core add support for ingressClassName in ingress #4805

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion charts/flyte-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,14 @@ helm install gateway bitnami/contour -n flyte
| cluster_resource_manager.service_account_name | string | `"flyteadmin"` | Service account name to run with |
| cluster_resource_manager.templates | list | `[{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"},{"key":"ab_project_resource_quota","value":"apiVersion: v1\nkind: ResourceQuota\nmetadata:\n name: project-quota\n namespace: {{ namespace }}\nspec:\n hard:\n limits.cpu: {{ projectQuotaCpu }}\n limits.memory: {{ projectQuotaMemory }}\n"}]` | Resource templates that should be applied |
| cluster_resource_manager.templates[0] | object | `{"key":"aa_namespace","value":"apiVersion: v1\nkind: Namespace\nmetadata:\n name: {{ namespace }}\nspec:\n finalizers:\n - kubernetes\n"}` | Template for namespaces resources |
| common | object | `{"databaseSecret":{"name":"","secretManifest":{}},"flyteNamespaceTemplate":{"enabled":false},"ingress":{"albSSLRedirect":false,"annotations":{"nginx.ingress.kubernetes.io/app-root":"/console"},"enabled":true,"separateGrpcIngress":false,"separateGrpcIngressAnnotations":{"nginx.ingress.kubernetes.io/backend-protocol":"GRPC"},"tls":{"enabled":false},"webpackHMR":false}}` | ---------------------------------------------- COMMON SETTINGS |
| common | object | `{"databaseSecret":{"name":"","secretManifest":{}},"flyteNamespaceTemplate":{"enabled":false},"ingress":{"albSSLRedirect":false,"annotations":{"nginx.ingress.kubernetes.io/app-root":"/console"},"enabled":true,"ingressClassName":null,"separateGrpcIngress":false,"separateGrpcIngressAnnotations":{"nginx.ingress.kubernetes.io/backend-protocol":"GRPC"},"tls":{"enabled":false},"webpackHMR":false}}` | ---------------------------------------------- COMMON SETTINGS |
| common.databaseSecret.name | string | `""` | Specify name of K8s Secret which contains Database password. Leave it empty if you don't need this Secret |
| common.databaseSecret.secretManifest | object | `{}` | Specify your Secret (with sensitive data) or pseudo-manifest (without sensitive data). See https://github.com/godaddy/kubernetes-external-secrets |
| common.flyteNamespaceTemplate.enabled | bool | `false` | - Enable or disable creating Flyte namespace in template. Enable when using helm as template-engine only. Disable when using `helm install ...`. |
| common.ingress.albSSLRedirect | bool | `false` | - albSSLRedirect adds a special route for ssl redirect. Only useful in combination with the AWS LoadBalancer Controller. |
| common.ingress.annotations | object | `{"nginx.ingress.kubernetes.io/app-root":"/console"}` | - Ingress annotations applied to both HTTP and GRPC ingresses. |
| common.ingress.enabled | bool | `true` | - Enable or disable creating Ingress for Flyte. Relevant to disable when using e.g. Istio as ingress controller. |
| common.ingress.ingressClassName | string | `nil` | - Sets the ingressClassName |
| common.ingress.separateGrpcIngress | bool | `false` | - separateGrpcIngress puts GRPC routes into a separate ingress if true. Required for certain ingress controllers like nginx. |
| common.ingress.separateGrpcIngressAnnotations | object | `{"nginx.ingress.kubernetes.io/backend-protocol":"GRPC"}` | - Extra Ingress annotations applied only to the GRPC ingress. Only makes sense if `separateGrpcIngress` is enabled. |
| common.ingress.tls | object | `{"enabled":false}` | - Ingress hostname host: |
Expand Down
12 changes: 6 additions & 6 deletions charts/flyte-core/templates/common/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ metadata:
annotations: {{ tpl (toYaml .) $ | nindent 4}}
{{- end }}
spec:
ingressClassName: {{ .Values.common.ingress.ingressClassName | quote }}
rules:
- http:
paths:
Expand Down Expand Up @@ -477,14 +478,13 @@ 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 -}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thank you!

{{- $_ := merge $annotations .Values.common.ingress.separateGrpcIngressAnnotations -}}
{{- with $annotations }}
annotations: {{ tpl (toYaml .) $ | nindent 4}}
{{- end }}
spec:
ingressClassName: {{ .Values.common.ingress.ingressClassName | quote }}
rules:
- host: {{ tpl (toYaml .Values.common.ingress.host) $ }}
http:
Expand Down
2 changes: 2 additions & 0 deletions charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ common:
# -- Specify your Secret (with sensitive data) or pseudo-manifest (without sensitive data). See https://github.com/godaddy/kubernetes-external-secrets
secretManifest: {}
ingress:
# --- Sets the ingressClassName
ingressClassName:
# --- Enable or disable creating Ingress for Flyte. Relevant to disable when using e.g. Istio as ingress controller.
enabled: true
# --- Enable or disable HMR route to flyteconsole. This is useful only for frontend development.
Expand Down
6 changes: 4 additions & 2 deletions deployment/eks/flyte_aws_scheduler_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,7 @@ metadata:
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -1549,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 @@ -1560,9 +1562,9 @@ 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:
rules:
- host: null
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/eks/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,7 @@ metadata:
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -1175,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 @@ -1186,9 +1188,9 @@ 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:
rules:
- host: null
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/eks/flyte_helm_dataplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ metadata:
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -748,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 @@ -759,9 +761,9 @@ 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:
rules:
- host: null
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/eks/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,7 @@ metadata:
kubernetes.io/ingress.class: alb
nginx.ingress.kubernetes.io/app-root: /console
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -1668,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 @@ -1679,9 +1681,9 @@ 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:
rules:
- host: null
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/gcp/flyte_helm_controlplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ metadata:
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -1182,13 +1183,14 @@ 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:
- host: '<HOSTNAME>'
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/gcp/flyte_helm_dataplane_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ metadata:
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -747,13 +748,14 @@ 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:
- host: '<HOSTNAME>'
http:
Expand Down
6 changes: 4 additions & 2 deletions deployment/gcp/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1529,6 +1529,7 @@ metadata:
nginx.ingress.kubernetes.io/app-root: /console
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down Expand Up @@ -1682,13 +1683,14 @@ 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:
- host: '<HOSTNAME>'
http:
Expand Down
1 change: 1 addition & 0 deletions deployment/sandbox/flyte_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7544,6 +7544,7 @@ metadata:
annotations:
nginx.ingress.kubernetes.io/app-root: /console
spec:
ingressClassName:
rules:
- http:
paths:
Expand Down
Loading