From 04b854b86c080c22d90b3b0c664c15ec00eab5ec Mon Sep 17 00:00:00 2001 From: "f.szekeresch" Date: Mon, 20 Dec 2021 14:02:44 +0100 Subject: [PATCH] Update apis to allow for compatibility with k8s 1.22 The CRD for the flyteworkflows is incomplete, atm. A schema should be added in the near future. See #1273 Signed-off-by: ferdinand.szekeresch --- charts/flyte-core/templates/admin/rbac.yaml | 2 +- .../flyte-core/templates/common/ingress.yaml | 190 ++++++++++++------ .../propeller/crds/flyteworkflow.yaml | 12 +- .../flyte-core/templates/propeller/rbac.yaml | 2 +- 4 files changed, 138 insertions(+), 68 deletions(-) diff --git a/charts/flyte-core/templates/admin/rbac.yaml b/charts/flyte-core/templates/admin/rbac.yaml index 35acd47249a..866e867dd4a 100644 --- a/charts/flyte-core/templates/admin/rbac.yaml +++ b/charts/flyte-core/templates/admin/rbac.yaml @@ -43,7 +43,7 @@ rules: - '*' --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "flyteadmin.name" . }}-binding diff --git a/charts/flyte-core/templates/common/ingress.yaml b/charts/flyte-core/templates/common/ingress.yaml index fa46f17f18b..9f56665a556 100644 --- a/charts/flyte-core/templates/common/ingress.yaml +++ b/charts/flyte-core/templates/common/ingress.yaml @@ -3,46 +3,62 @@ - path: /flyteidl.service.AdminService pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /flyteidl.service.AdminService/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /flyteidl.service.AuthMetadataService pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /flyteidl.service.AuthMetadataService/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /flyteidl.service.IdentityService pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /flyteidl.service.IdentityService/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /grpc.health.v1.Health pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 - path: /grpc.health.v1.Health/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 81 + service: + name: flyteadmin + port: + number: 81 {{- end }} {{- if .Values.common.ingress.enabled }} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ template "flyte.name" . }} @@ -58,125 +74,171 @@ spec: - path: /* pathType: ImplementationSpecific backend: - serviceName: ssl-redirect - servicePort: use-annotation + service: + name: ssl-redirect + port: + name: use-annotation {{- end }} # This is useful only for frontend development {{- if .Values.common.ingress.webpackHMR }} - path: /__webpack_hmr pathType: ImplementationSpecific backend: - serviceName: flyteconsole - servicePort: 80 + service: + name: flyteconsole + port: + number: 80 {{- end }} # Port 87 in FlyteAdmin maps to the redoc container. - path: /openapi pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 87 + service: + name: flyteadmin + port: + number: 87 # NOTE: If you change this, you must update the BASE_URL value in flyteconsole.yaml - path: /console pathType: ImplementationSpecific backend: - serviceName: flyteconsole - servicePort: 80 + service: + name: flyteconsole + port: + number: 80 - path: /console/* pathType: ImplementationSpecific backend: - serviceName: flyteconsole - servicePort: 80 + service: + name: flyteconsole + port: + number: 80 - path: /api pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /api/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /healthcheck pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /v1/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 # Port 87 in FlyteAdmin maps to the redoc container. - path: /openapi/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 87 + service: + name: flyteadmin + port: + number: 87 - path: /.well-known pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /.well-known/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /login pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /login/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /logout pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /logout/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /callback pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /callback/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /me pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /config pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /config/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /oauth2 pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 - path: /oauth2/* pathType: ImplementationSpecific backend: - serviceName: flyteadmin - servicePort: 80 + service: + name: flyteadmin + port: + number: 80 {{- if not .Values.common.ingress.separateGrpcIngress }} {{- include "grpcRoutes" . | nindent 10 -}} {{- end }} @@ -193,7 +255,7 @@ spec: # Certain ingress controllers like nginx cannot serve HTTP 1 and GRPC with a single ingress because GRPC can only # enabled on the ingress object, not on backend services (GRPC annotation is set on the ingress, not on the services). --- -apiVersion: networking.k8s.io/v1beta1 +apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ template "flyte.name" . }}-grpc diff --git a/charts/flyte-core/templates/propeller/crds/flyteworkflow.yaml b/charts/flyte-core/templates/propeller/crds/flyteworkflow.yaml index 98bdce59d1a..f7314e12a41 100644 --- a/charts/flyte-core/templates/propeller/crds/flyteworkflow.yaml +++ b/charts/flyte-core/templates/propeller/crds/flyteworkflow.yaml @@ -1,5 +1,5 @@ {{- if .Values.flytepropeller.enabled }} -apiVersion: apiextensions.k8s.io/v1beta1 +apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: name: flyteworkflows.flyte.lyft.com @@ -12,5 +12,13 @@ spec: - fly singular: flyteworkflow scope: Namespaced - version: v1alpha1 + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + {{- end }} diff --git a/charts/flyte-core/templates/propeller/rbac.yaml b/charts/flyte-core/templates/propeller/rbac.yaml index 3a27fdffab7..0164c9945d1 100644 --- a/charts/flyte-core/templates/propeller/rbac.yaml +++ b/charts/flyte-core/templates/propeller/rbac.yaml @@ -83,7 +83,7 @@ rules: - deletecollection --- -apiVersion: rbac.authorization.k8s.io/v1beta1 +apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "flytepropeller.name" . }}