From 3008f0e9a683095de6e3ec0e829b0ba57b0ad8ad Mon Sep 17 00:00:00 2001 From: ddl-ebrown Date: Wed, 31 Jan 2024 15:05:39 -0800 Subject: [PATCH] Add support for ingressClassName in ingress - ingressClassName field was added in k8s 1.18, and effectively replaces the unofficially supported annotation `ingress.class` https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation Signed-off-by: ddl-ebrown --- charts/flyte-core/README.md | 3 ++- charts/flyte-core/templates/common/ingress.yaml | 2 ++ charts/flyte-core/values.yaml | 2 ++ deployment/eks/flyte_aws_scheduler_helm_generated.yaml | 2 ++ deployment/eks/flyte_helm_controlplane_generated.yaml | 2 ++ deployment/eks/flyte_helm_dataplane_generated.yaml | 2 ++ deployment/eks/flyte_helm_generated.yaml | 2 ++ deployment/gcp/flyte_helm_controlplane_generated.yaml | 2 ++ deployment/gcp/flyte_helm_dataplane_generated.yaml | 2 ++ deployment/gcp/flyte_helm_generated.yaml | 2 ++ deployment/sandbox/flyte_helm_generated.yaml | 1 + 11 files changed, 21 insertions(+), 1 deletion(-) diff --git a/charts/flyte-core/README.md b/charts/flyte-core/README.md index 5ccb9f60f04..9d00e937be3 100644 --- a/charts/flyte-core/README.md +++ b/charts/flyte-core/README.md @@ -72,12 +72,13 @@ 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"},"class":null,"enabled":true,"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.class | string | `nil` | - Sets the ingressClassName | | 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.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. | diff --git a/charts/flyte-core/templates/common/ingress.yaml b/charts/flyte-core/templates/common/ingress.yaml index 2a45152a0b7..8c01f8fa529 100644 --- a/charts/flyte-core/templates/common/ingress.yaml +++ b/charts/flyte-core/templates/common/ingress.yaml @@ -163,6 +163,7 @@ metadata: annotations: {{ tpl (toYaml .) $ | nindent 4}} {{- end }} spec: + ingressClassName: {{ .Values.common.ingress.class | quote }} rules: - http: paths: @@ -485,6 +486,7 @@ metadata: {{- toYaml . | nindent 4}} {{- end }} spec: + ingressClassName: {{ .Values.common.ingress.class | quote }} rules: - host: {{ tpl (toYaml .Values.common.ingress.host) $ }} http: diff --git a/charts/flyte-core/values.yaml b/charts/flyte-core/values.yaml index 36a9b22e5ec..abeca3a29da 100755 --- a/charts/flyte-core/values.yaml +++ b/charts/flyte-core/values.yaml @@ -424,6 +424,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 + class: # --- 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. diff --git a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml index c4f557836af..787adab9f31 100644 --- a/deployment/eks/flyte_aws_scheduler_helm_generated.yaml +++ b/deployment/eks/flyte_aws_scheduler_helm_generated.yaml @@ -1393,6 +1393,7 @@ metadata: kubernetes.io/ingress.class: alb nginx.ingress.kubernetes.io/app-root: /console spec: + ingressClassName: rules: - http: paths: @@ -1562,6 +1563,7 @@ metadata: alb.ingress.kubernetes.io/backend-protocol-version: GRPC nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: null http: diff --git a/deployment/eks/flyte_helm_controlplane_generated.yaml b/deployment/eks/flyte_helm_controlplane_generated.yaml index 47a75cae25c..08961b25c3b 100644 --- a/deployment/eks/flyte_helm_controlplane_generated.yaml +++ b/deployment/eks/flyte_helm_controlplane_generated.yaml @@ -1021,6 +1021,7 @@ metadata: kubernetes.io/ingress.class: alb nginx.ingress.kubernetes.io/app-root: /console spec: + ingressClassName: rules: - http: paths: @@ -1190,6 +1191,7 @@ metadata: alb.ingress.kubernetes.io/backend-protocol-version: GRPC nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: null http: diff --git a/deployment/eks/flyte_helm_dataplane_generated.yaml b/deployment/eks/flyte_helm_dataplane_generated.yaml index c1d6b963807..b38232bf61a 100644 --- a/deployment/eks/flyte_helm_dataplane_generated.yaml +++ b/deployment/eks/flyte_helm_dataplane_generated.yaml @@ -591,6 +591,7 @@ metadata: kubernetes.io/ingress.class: alb nginx.ingress.kubernetes.io/app-root: /console spec: + ingressClassName: rules: - http: paths: @@ -760,6 +761,7 @@ metadata: alb.ingress.kubernetes.io/backend-protocol-version: GRPC nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: null http: diff --git a/deployment/eks/flyte_helm_generated.yaml b/deployment/eks/flyte_helm_generated.yaml index 910b2746b80..603f4e02544 100644 --- a/deployment/eks/flyte_helm_generated.yaml +++ b/deployment/eks/flyte_helm_generated.yaml @@ -1512,6 +1512,7 @@ metadata: kubernetes.io/ingress.class: alb nginx.ingress.kubernetes.io/app-root: /console spec: + ingressClassName: rules: - http: paths: @@ -1681,6 +1682,7 @@ metadata: alb.ingress.kubernetes.io/backend-protocol-version: GRPC nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: null http: diff --git a/deployment/gcp/flyte_helm_controlplane_generated.yaml b/deployment/gcp/flyte_helm_controlplane_generated.yaml index a31446875cf..24c6f6edbb6 100644 --- a/deployment/gcp/flyte_helm_controlplane_generated.yaml +++ b/deployment/gcp/flyte_helm_controlplane_generated.yaml @@ -1030,6 +1030,7 @@ metadata: nginx.ingress.kubernetes.io/app-root: /console nginx.ingress.kubernetes.io/ssl-redirect: "true" spec: + ingressClassName: rules: - http: paths: @@ -1190,6 +1191,7 @@ metadata: nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: '' http: diff --git a/deployment/gcp/flyte_helm_dataplane_generated.yaml b/deployment/gcp/flyte_helm_dataplane_generated.yaml index c0cb5c5a6d3..95e7283a770 100644 --- a/deployment/gcp/flyte_helm_dataplane_generated.yaml +++ b/deployment/gcp/flyte_helm_dataplane_generated.yaml @@ -592,6 +592,7 @@ metadata: nginx.ingress.kubernetes.io/app-root: /console nginx.ingress.kubernetes.io/ssl-redirect: "true" spec: + ingressClassName: rules: - http: paths: @@ -752,6 +753,7 @@ metadata: nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: '' http: diff --git a/deployment/gcp/flyte_helm_generated.yaml b/deployment/gcp/flyte_helm_generated.yaml index 0627ba986cc..c8b443d7b1d 100644 --- a/deployment/gcp/flyte_helm_generated.yaml +++ b/deployment/gcp/flyte_helm_generated.yaml @@ -1528,6 +1528,7 @@ metadata: nginx.ingress.kubernetes.io/app-root: /console nginx.ingress.kubernetes.io/ssl-redirect: "true" spec: + ingressClassName: rules: - http: paths: @@ -1688,6 +1689,7 @@ metadata: nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/backend-protocol: GRPC spec: + ingressClassName: rules: - host: '' http: diff --git a/deployment/sandbox/flyte_helm_generated.yaml b/deployment/sandbox/flyte_helm_generated.yaml index cade17e8d67..7fa4257653f 100644 --- a/deployment/sandbox/flyte_helm_generated.yaml +++ b/deployment/sandbox/flyte_helm_generated.yaml @@ -7542,6 +7542,7 @@ metadata: annotations: nginx.ingress.kubernetes.io/app-root: /console spec: + ingressClassName: rules: - http: paths: