From a68d3b584e015a109f464f7478055f0df4208628 Mon Sep 17 00:00:00 2001 From: Jeev B Date: Tue, 21 Mar 2023 15:54:44 -0700 Subject: [PATCH] Split flyte-binary services into http and grpc, and some cleanups (#3495) Signed-off-by: Jeev B --- charts/flyte-binary/README.md | 50 +++++--- charts/flyte-binary/templates/_helpers.tpl | 22 +++- charts/flyte-binary/templates/configmap.yaml | 8 +- .../flyte-binary/templates/ingress/grpc.yaml | 67 +++++----- .../flyte-binary/templates/ingress/http.yaml | 95 ++++++++------- .../flyte-binary/templates/service/grpc.yaml | 54 +++++++++ .../flyte-binary/templates/service/http.yaml | 54 +++++++++ .../flyte-binary/templates/service/main.yaml | 54 --------- .../templates/service/webhook.yaml | 8 +- charts/flyte-binary/values.yaml | 114 +++++++++++------- charts/flyte-sandbox/Chart.lock | 2 +- .../templates/proxy/configmap.yaml | 4 +- .../flyte_sandbox_binary_helm_generated.yaml | 32 ++++- .../sandbox-bundled/manifests/complete.yaml | 62 ++++++---- docker/sandbox-bundled/manifests/dev.yaml | 4 +- 15 files changed, 392 insertions(+), 238 deletions(-) create mode 100644 charts/flyte-binary/templates/service/grpc.yaml create mode 100644 charts/flyte-binary/templates/service/http.yaml delete mode 100644 charts/flyte-binary/templates/service/main.yaml diff --git a/charts/flyte-binary/README.md b/charts/flyte-binary/README.md index bad7b5bc7d..1eb0f32ed8 100644 --- a/charts/flyte-binary/README.md +++ b/charts/flyte-binary/README.md @@ -93,32 +93,44 @@ Chart for basic single Flyte executable deployment | deployment.waitForDB.image.tag | string | `"15-alpine"` | | | fullnameOverride | string | `""` | | | ingress.commonAnnotations | object | `{}` | | +| ingress.commonLabels | object | `{}` | | | ingress.create | bool | `false` | | -| ingress.grpcAnnotations | object | `{}` | | -| ingress.grpcExtraPaths.append | list | `[]` | | -| ingress.grpcExtraPaths.prepend | list | `[]` | | +| ingress.grpc.annotations | object | `{}` | | +| ingress.grpc.extraPaths.append | list | `[]` | | +| ingress.grpc.extraPaths.prepend | list | `[]` | | +| ingress.grpc.labels | object | `{}` | | | ingress.host | string | `""` | | -| ingress.httpAnnotations | object | `{}` | | -| ingress.httpExtraPaths.append | list | `[]` | | -| ingress.httpExtraPaths.prepend | list | `[]` | | -| ingress.labels | object | `{}` | | +| ingress.http.annotations | object | `{}` | | +| ingress.http.extraPaths.append | list | `[]` | | +| ingress.http.extraPaths.prepend | list | `[]` | | +| ingress.http.labels | object | `{}` | | | nameOverride | string | `""` | | | rbac.annotations | object | `{}` | | | rbac.create | bool | `true` | | | rbac.extraRules | list | `[]` | | | rbac.labels | object | `{}` | | -| service.annotations | object | `{}` | | -| service.clusterIP | string | `""` | | -| service.externalTrafficPolicy | string | `"Cluster"` | | -| service.extraPorts | list | `[]` | | -| service.labels | object | `{}` | | -| service.loadBalancerIP | string | `""` | | -| service.loadBalancerSourceRanges | list | `[]` | | -| service.nodePorts.grpc | string | `""` | | -| service.nodePorts.http | string | `""` | | -| service.ports.grpc | string | `""` | | -| service.ports.http | string | `""` | | -| service.type | string | `"ClusterIP"` | | +| service.commonAnnotations | object | `{}` | | +| service.commonLabels | object | `{}` | | +| service.grpc.annotations | object | `{}` | | +| service.grpc.clusterIP | string | `""` | | +| service.grpc.externalTrafficPolicy | string | `"Cluster"` | | +| service.grpc.extraPorts | list | `[]` | | +| service.grpc.labels | object | `{}` | | +| service.grpc.loadBalancerIP | string | `""` | | +| service.grpc.loadBalancerSourceRanges | list | `[]` | | +| service.grpc.nodePort | string | `""` | | +| service.grpc.port | string | `""` | | +| service.grpc.type | string | `"ClusterIP"` | | +| service.http.annotations | object | `{}` | | +| service.http.clusterIP | string | `""` | | +| service.http.externalTrafficPolicy | string | `"Cluster"` | | +| service.http.extraPorts | list | `[]` | | +| service.http.labels | object | `{}` | | +| service.http.loadBalancerIP | string | `""` | | +| service.http.loadBalancerSourceRanges | list | `[]` | | +| service.http.nodePort | string | `""` | | +| service.http.port | string | `""` | | +| service.http.type | string | `"ClusterIP"` | | | serviceAccount.annotations | object | `{}` | | | serviceAccount.create | bool | `true` | | | serviceAccount.labels | object | `{}` | | diff --git a/charts/flyte-binary/templates/_helpers.tpl b/charts/flyte-binary/templates/_helpers.tpl index 2ddcaf6911..a2005b4035 100644 --- a/charts/flyte-binary/templates/_helpers.tpl +++ b/charts/flyte-binary/templates/_helpers.tpl @@ -138,18 +138,32 @@ Get the Flyte cluster resource templates ConfigMap name. {{- printf "%s-cluster-resource-templates" (include "flyte-binary.fullname" .) -}} {{- end -}} +{{/* +Get the Flyte HTTP service name +*/}} +{{- define "flyte-binary.service.http.name" -}} +{{- printf "%s-http" (include "flyte-binary.fullname" .) -}} +{{- end -}} + +{{/* +Get the Flyte GRPC service name +*/}} +{{- define "flyte-binary.service.grpc.name" -}} +{{- printf "%s-grpc" (include "flyte-binary.fullname" .) -}} +{{- end -}} + {{/* Get the Flyte service HTTP port. */}} -{{- define "flyte-binary.service.httpPort" -}} -{{- default 8088 .Values.service.ports.http -}} +{{- define "flyte-binary.service.http.port" -}} +{{- default 8088 .Values.service.http.port -}} {{- end -}} {{/* Get the Flyte service GRPC port. */}} -{{- define "flyte-binary.service.grpcPort" -}} -{{- default 8089 .Values.service.ports.grpc -}} +{{- define "flyte-binary.service.grpc.port" -}} +{{- default 8089 .Values.service.grpc.port -}} {{- end -}} {{/* diff --git a/charts/flyte-binary/templates/configmap.yaml b/charts/flyte-binary/templates/configmap.yaml index 6715cf17df..50f75f2f13 100644 --- a/charts/flyte-binary/templates/configmap.yaml +++ b/charts/flyte-binary/templates/configmap.yaml @@ -170,10 +170,10 @@ data: {{- if .Values.configuration.auth.authorizedUris }} {{- tpl ( .Values.configuration.auth.authorizedUris | toYaml ) . | nindent 6 }} {{- end }} - - http://{{ include "flyte-binary.fullname" . }}:{{ include "flyte-binary.service.httpPort" . }} - - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}:{{ include "flyte-binary.service.httpPort" . }} - - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}.svc:{{ include "flyte-binary.service.httpPort" . }} - - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ include "flyte-binary.service.httpPort" . }} + - http://{{ include "flyte-binary.fullname" . }}:{{ include "flyte-binary.service.http.port" . }} + - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}:{{ include "flyte-binary.service.http.port" . }} + - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}.svc:{{ include "flyte-binary.service.http.port" . }} + - http://{{ include "flyte-binary.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ include "flyte-binary.service.http.port" . }} userAuth: openId: baseUrl: {{ required "OIDC base URL required when authentication is enabled" .Values.configuration.auth.oidc.baseUrl | quote }} diff --git a/charts/flyte-binary/templates/ingress/grpc.yaml b/charts/flyte-binary/templates/ingress/grpc.yaml index ac4fda8bda..ac6315c573 100644 --- a/charts/flyte-binary/templates/ingress/grpc.yaml +++ b/charts/flyte-binary/templates/ingress/grpc.yaml @@ -8,8 +8,11 @@ metadata: {{- if .Values.commonLabels }} {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.ingress.labels }} - {{- tpl ( .Values.ingress.labels | toYaml ) . | nindent 4 }} + {{- if .Values.ingress.commonLabels }} + {{- tpl ( .Values.ingress.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.ingress.grpc.abels }} + {{- tpl ( .Values.ingress.grpc.labels | toYaml ) . | nindent 4 }} {{- end }} annotations: {{- if .Values.commonAnnotations }} @@ -18,102 +21,102 @@ metadata: {{- if .Values.ingress.commonAnnotations }} {{- tpl ( .Values.ingress.commonAnnotations | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.ingress.grpcAnnotations }} - {{- tpl ( .Values.ingress.grpcAnnotations | toYaml ) . | nindent 4 }} + {{- if .Values.ingress.grpc.annotations }} + {{- tpl ( .Values.ingress.grpc.annotations | toYaml ) . | nindent 4 }} {{- end }} spec: rules: - http: paths: - {{- if .Values.ingress.grpcExtraPaths.prepend }} - {{- tpl ( .Values.ingress.grpcExtraPaths.prepend | toYaml ) . | nindent 6 }} + {{- if .Values.ingress.grpc.extraPaths.prepend }} + {{- tpl ( .Values.ingress.grpc.extraPaths.prepend | toYaml ) . | nindent 6 }} {{- end }} - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.AdminService pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.AdminService/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.DataProxyService pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.DataProxyService/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.AuthMetadataService pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.AuthMetadataService/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.IdentityService pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.IdentityService/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /grpc.health.v1.Health pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /grpc.health.v1.Health/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.SignalService pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.grpc.name" . }} port: - number: {{ include "flyte-binary.service.grpcPort" . }} + number: {{ include "flyte-binary.service.grpc.port" . }} path: /flyteidl.service.SignalService/* pathType: ImplementationSpecific - {{- if .Values.ingress.grpcExtraPaths.append }} - {{- tpl ( .Values.ingress.grpcExtraPaths.append | toYaml ) . | nindent 6 }} + {{- if .Values.ingress.grpc.extraPaths.append }} + {{- tpl ( .Values.ingress.grpc.extraPaths.append | toYaml ) . | nindent 6 }} {{- end }} {{- if .Values.ingress.host }} host: {{ tpl .Values.ingress.host . | quote }} diff --git a/charts/flyte-binary/templates/ingress/http.yaml b/charts/flyte-binary/templates/ingress/http.yaml index 9591d15cb9..0d53f290dc 100644 --- a/charts/flyte-binary/templates/ingress/http.yaml +++ b/charts/flyte-binary/templates/ingress/http.yaml @@ -8,8 +8,11 @@ metadata: {{- if .Values.commonLabels }} {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.ingress.labels }} - {{- tpl ( .Values.ingress.labels | toYaml ) . | nindent 4 }} + {{- if .Values.ingress.commonLabels }} + {{- tpl ( .Values.ingress.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.ingress.http.abels }} + {{- tpl ( .Values.ingress.http.labels | toYaml ) . | nindent 4 }} {{- end }} annotations: {{- if .Values.commonAnnotations }} @@ -18,151 +21,151 @@ metadata: {{- if .Values.ingress.commonAnnotations }} {{- tpl ( .Values.ingress.commonAnnotations | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.ingress.httpAnnotations }} - {{- tpl ( .Values.ingress.httpAnnotations | toYaml ) . | nindent 4 }} + {{- if .Values.ingress.http.annotations }} + {{- tpl ( .Values.ingress.http.annotations | toYaml ) . | nindent 4 }} {{- end }} spec: rules: - http: paths: - {{- if .Values.ingress.httpExtraPaths.prepend }} - {{- tpl ( .Values.ingress.httpExtraPaths.prepend | toYaml ) . | nindent 6 }} + {{- if .Values.ingress.http.extraPaths.prepend }} + {{- tpl ( .Values.ingress.http.extraPaths.prepend | toYaml ) . | nindent 6 }} {{- end }} - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /console pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /console/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /api pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /api/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /healthcheck pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /v1/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /.well-known pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /.well-known/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /login pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /login/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /logout pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /logout/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /callback pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /callback/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /me pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /config pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /config/* pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /oauth2 pathType: ImplementationSpecific - backend: service: - name: {{ include "flyte-binary.fullname" . }} + name: {{ include "flyte-binary.service.http.name" . }} port: - number: {{ include "flyte-binary.service.httpPort" . }} + number: {{ include "flyte-binary.service.http.port" . }} path: /oauth2/* pathType: ImplementationSpecific - {{- if .Values.ingress.httpExtraPaths.append }} - {{- tpl ( .Values.ingress.httpExtraPaths.append | toYaml ) . | nindent 6 }} + {{- if .Values.ingress.http.extraPaths.append }} + {{- tpl ( .Values.ingress.http.extraPaths.append | toYaml ) . | nindent 6 }} {{- end }} {{- if .Values.ingress.host }} host: {{ tpl .Values.ingress.host . | quote }} diff --git a/charts/flyte-binary/templates/service/grpc.yaml b/charts/flyte-binary/templates/service/grpc.yaml new file mode 100644 index 0000000000..0815556735 --- /dev/null +++ b/charts/flyte-binary/templates/service/grpc.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "flyte-binary.service.grpc.name" . }} + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "flyte-binary.labels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.commonLabels }} + {{- tpl ( .Values.service.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.grpc.labels }} + {{- tpl ( .Values.service.grpc.labels | toYaml ) . | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.commonAnnotations }} + {{- tpl ( .Values.commonAnnotations | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.commonAnnotations }} + {{- tpl ( .Values.service.commonAnnotations | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.grpc.annotations }} + {{- tpl ( .Values.service.grpc.annotations | toYaml ) . | nindent 4 }} + {{- end }} +spec: +{{- with .Values.service.grpc }} + type: {{ .type }} + {{- if or (eq .type "LoadBalancer") (eq .type "NodePort") }} + externalTrafficPolicy: {{ .externalTrafficPolicy | quote }} + {{- end }} + {{- if and (eq .type "LoadBalancer") (not (empty .loadBalancerSourceRanges)) }} + loadBalancerSourceRanges: {{ .loadBalancerSourceRanges }} + {{- end }} + {{- if and (eq .type "LoadBalancer") (not (empty .loadBalancerIP)) }} + loadBalancerIP: {{ .loadBalancerIP }} + {{- end }} + {{- if and .clusterIP (eq .type "ClusterIP") }} + clusterIP: {{ .clusterIP }} + {{- end }} + ports: + - name: grpc + port: {{ include "flyte-binary.service.grpc.port" $ }} + targetPort: grpc + {{- if and (or (eq .type "NodePort") (eq .type "LoadBalancer")) (not (empty .nodePort)) }} + nodePort: {{ .nodePort }} + {{- else if eq .type "ClusterIP" }} + nodePort: null + {{- end }} + {{- if .extraPorts }} + {{- tpl ( .extraPorts | toYaml ) . | nindent 4 }} + {{- end }} +{{- end }} + selector: {{- include "flyte-binary.selectorLabels" . | nindent 4 }} diff --git a/charts/flyte-binary/templates/service/http.yaml b/charts/flyte-binary/templates/service/http.yaml new file mode 100644 index 0000000000..3f572dea1f --- /dev/null +++ b/charts/flyte-binary/templates/service/http.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "flyte-binary.service.http.name" . }} + namespace: {{ .Release.Namespace | quote }} + labels: {{- include "flyte-binary.labels" . | nindent 4 }} + {{- if .Values.commonLabels }} + {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.commonLabels }} + {{- tpl ( .Values.service.commonLabels | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.http.labels }} + {{- tpl ( .Values.service.http.labels | toYaml ) . | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.commonAnnotations }} + {{- tpl ( .Values.commonAnnotations | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.commonAnnotations }} + {{- tpl ( .Values.service.commonAnnotations | toYaml ) . | nindent 4 }} + {{- end }} + {{- if .Values.service.http.annotations }} + {{- tpl ( .Values.service.http.annotations | toYaml ) . | nindent 4 }} + {{- end }} +spec: +{{- with .Values.service.http }} + type: {{ .type }} + {{- if or (eq .type "LoadBalancer") (eq .type "NodePort") }} + externalTrafficPolicy: {{ .externalTrafficPolicy | quote }} + {{- end }} + {{- if and (eq .type "LoadBalancer") (not (empty .loadBalancerSourceRanges)) }} + loadBalancerSourceRanges: {{ .loadBalancerSourceRanges }} + {{- end }} + {{- if and (eq .type "LoadBalancer") (not (empty .loadBalancerIP)) }} + loadBalancerIP: {{ .loadBalancerIP }} + {{- end }} + {{- if and .clusterIP (eq .type "ClusterIP") }} + clusterIP: {{ .clusterIP }} + {{- end }} + ports: + - name: http + port: {{ include "flyte-binary.service.http.port" $ }} + targetPort: http + {{- if and (or (eq .type "NodePort") (eq .type "LoadBalancer")) (not (empty .nodePort)) }} + nodePort: {{ .nodePort }} + {{- else if eq .type "ClusterIP" }} + nodePort: null + {{- end }} + {{- if .extraPorts }} + {{- tpl ( .extraPorts | toYaml ) . | nindent 4 }} + {{- end }} +{{- end }} + selector: {{- include "flyte-binary.selectorLabels" . | nindent 4 }} diff --git a/charts/flyte-binary/templates/service/main.yaml b/charts/flyte-binary/templates/service/main.yaml deleted file mode 100644 index 9c93ff38d5..0000000000 --- a/charts/flyte-binary/templates/service/main.yaml +++ /dev/null @@ -1,54 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "flyte-binary.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: {{- include "flyte-binary.labels" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} - {{- end }} - {{- if .Values.service.labels }} - {{- tpl ( .Values.service.labels | toYaml ) . | nindent 4 }} - {{- end }} - annotations: - {{- if .Values.commonAnnotations }} - {{- tpl ( .Values.commonAnnotations | toYaml ) . | nindent 4 }} - {{- end }} - {{- if .Values.service.annotations }} - {{- tpl ( .Values.service.annotations | toYaml ) . | nindent 4 }} - {{- end }} -spec: - type: {{ .Values.service.type }} - {{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }} - externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }} - {{- end }} - {{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerSourceRanges)) }} - loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }} - {{- end }} - {{- if and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP)) }} - loadBalancerIP: {{ .Values.service.loadBalancerIP }} - {{- end }} - {{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }} - clusterIP: {{ .Values.service.clusterIP }} - {{- end }} - ports: - - name: http - port: {{ include "flyte-binary.service.httpPort" . }} - targetPort: http - {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.http)) }} - nodePort: {{ .Values.service.nodePorts.http }} - {{- else if eq .Values.service.type "ClusterIP" }} - nodePort: null - {{- end }} - - name: grpc - port: {{ include "flyte-binary.service.grpcPort" . }} - targetPort: grpc - {{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.grpc)) }} - nodePort: {{ .Values.service.nodePorts.grpc }} - {{- else if eq .Values.service.type "ClusterIP" }} - nodePort: null - {{- end }} - {{- if .Values.service.extraPorts }} - {{- tpl ( .Values.service.extraPorts | toYaml ) . | nindent 4 }} - {{- end }} - selector: {{- include "flyte-binary.selectorLabels" . | nindent 4 }} diff --git a/charts/flyte-binary/templates/service/webhook.yaml b/charts/flyte-binary/templates/service/webhook.yaml index f5375b1f70..f6aba9d32f 100644 --- a/charts/flyte-binary/templates/service/webhook.yaml +++ b/charts/flyte-binary/templates/service/webhook.yaml @@ -7,15 +7,15 @@ metadata: {{- if .Values.commonLabels }} {{- tpl ( .Values.commonLabels | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.service.labels }} - {{- tpl ( .Values.service.labels | toYaml ) . | nindent 4 }} + {{- if .Values.service.commonLabels }} + {{- tpl ( .Values.service.commonLabels | toYaml ) . | nindent 4 }} {{- end }} annotations: {{- if .Values.commonAnnotations }} {{- tpl ( .Values.commonAnnotations | toYaml ) . | nindent 4 }} {{- end }} - {{- if .Values.service.annotations }} - {{- tpl ( .Values.service.annotations | toYaml ) . | nindent 4 }} + {{- if .Values.service.commonAnnotations }} + {{- tpl ( .Values.service.commonAnnotations | toYaml ) . | nindent 4 }} {{- end }} spec: type: ClusterIP diff --git a/charts/flyte-binary/values.yaml b/charts/flyte-binary/values.yaml index a65bc06694..b1850f9ca1 100644 --- a/charts/flyte-binary/values.yaml +++ b/charts/flyte-binary/values.yaml @@ -225,55 +225,85 @@ deployment: # service Configure service for Flyte service: - # type Kubernetes service type - type: ClusterIP - # ports Flyte service ports - # If not specified, defaults to corresponding container ports - ports: - http: "" - grpc: "" - # nodePorts Node ports for Flyte service if service type is `NodePort` or `LoadBalancer` - nodePorts: - http: "" - grpc: "" - # clusterIP Set static IP if service type is `ClusterIP` - clusterIP: "" - # labels Add labels to Flyte services - labels: {} - # annotations Add annotations to Flyte services - annotations: {} - # loadBalancerIP Set static IP if service type is `LoadBalancer` - loadBalancerIP: "" - # externalTrafficPolicy Enable client source IP preservation if service type is `NodePort` or `LoadBalancer` - # See: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip - externalTrafficPolicy: Cluster - # loadBalancerSourceRanges Addresses that are allowed when service is `LoadBalancer` - loadBalancerSourceRanges: [] - # extraPorts Additional ports to add to Flyte service - extraPorts: [] + # commonLabels Add common labels to Flyte services + commonLabels: {} + # commonAnnotations Add common annotations to Flyte services + commonAnnotations: {} + http: + # labels Add labels to Flyte service + labels: {} + # annotations Add annotations to service + annotations: {} + # type Kubernetes service type + type: ClusterIP + # port Flyte service port + # If not specified, defaults to corresponding container port + port: "" + # nodePort Node port for Flyte service if service type is `NodePort` or `LoadBalancer` + nodePort: "" + # clusterIP Set static IP if service type is `ClusterIP` + clusterIP: "" + # loadBalancerIP Set static IP if service type is `LoadBalancer` + loadBalancerIP: "" + # externalTrafficPolicy Enable client source IP preservation if service type is `NodePort` or `LoadBalancer` + # See: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + externalTrafficPolicy: Cluster + # loadBalancerSourceRanges Addresses that are allowed when service is `LoadBalancer` + loadBalancerSourceRanges: [] + # extraPorts Additional ports to add to Flyte service + extraPorts: [] + grpc: + # labels Add labels to Flyte service + labels: {} + # annotations Add annotations to service + annotations: {} + # type Kubernetes service type + type: ClusterIP + # port Flyte service port + # If not specified, defaults to corresponding container port + port: "" + # nodePort Node port for Flyte service if service type is `NodePort` or `LoadBalancer` + nodePort: "" + # clusterIP Set static IP if service type is `ClusterIP` + clusterIP: "" + # loadBalancerIP Set static IP if service type is `LoadBalancer` + loadBalancerIP: "" + # externalTrafficPolicy Enable client source IP preservation if service type is `NodePort` or `LoadBalancer` + # See: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip + externalTrafficPolicy: Cluster + # loadBalancerSourceRanges Addresses that are allowed when service is `LoadBalancer` + loadBalancerSourceRanges: [] + # extraPorts Additional ports to add to Flyte service + extraPorts: [] # ingress Configure ingress for Flyte ingress: # create Create ingress resources create: false - # labels Add labels to ingress resources - labels: {} + # commonLabels Add common labels to ingress resources + commonLabels: {} + # commonAnnotations Add common annotations to ingress resources + commonAnnotations: {} # host Hostname to bind to ingress resources host: "" - # commonAnnotations Add common annotations to all ingress resources - commonAnnotations: {} - # httpAnnotations Add common annotations to http ingress resource - httpAnnotations: {} - # grpcAnnotations Add common annotations to grpc ingress resource - grpcAnnotations: {} - # httpExtraPaths Add extra paths to http ingress rule - httpExtraPaths: - prepend: [] - append: [] - # grpcExtraPaths Add extra paths to grpc ingress rule - grpcExtraPaths: - prepend: [] - append: [] + http: + # labels Add labels to ingress resource + labels: {} + # annotations Add annotations to ingress resource + annotations: {} + # extraPaths Add extra paths to ingress rule + extraPaths: + prepend: [] + append: [] + grpc: + # labels Add labels to ingress resource + labels: {} + # annotations Add annotations to ingress resource + annotations: {} + # extraPaths Add extra paths to ingress rule + extraPaths: + prepend: [] + append: [] # rbac Configure Kubernetes RBAC for Flyte rbac: diff --git a/charts/flyte-sandbox/Chart.lock b/charts/flyte-sandbox/Chart.lock index b26ddcbf63..639767e02f 100644 --- a/charts/flyte-sandbox/Chart.lock +++ b/charts/flyte-sandbox/Chart.lock @@ -15,4 +15,4 @@ dependencies: repository: https://charts.bitnami.com/bitnami version: 12.1.9 digest: sha256:e7155e540bbdb98f690eb12e2bd301a19d8b36833336f6991410cb44d8d9bb5e -generated: "2023-03-07T10:02:34.169731-08:00" +generated: "2023-03-17T16:50:03.343008-07:00" diff --git a/charts/flyte-sandbox/templates/proxy/configmap.yaml b/charts/flyte-sandbox/templates/proxy/configmap.yaml index 83ec877ce0..362597aa9e 100644 --- a/charts/flyte-sandbox/templates/proxy/configmap.yaml +++ b/charts/flyte-sandbox/templates/proxy/configmap.yaml @@ -149,7 +149,7 @@ data: address: socket_address: {{- if index .Values "flyte-binary" "enabled" }} - address: {{ include "flyte-sandbox.fullname" .}} + address: {{ include "flyte-binary.service.http.name" .}} {{- else }} address: {{ include "flyte-sandbox.localHeadlessService" . }} {{- end }} @@ -167,7 +167,7 @@ data: address: socket_address: {{- if index .Values "flyte-binary" "enabled" }} - address: {{ include "flyte-sandbox.fullname" .}} + address: {{ include "flyte-binary.service.grpc.name" .}} {{- else }} address: {{ include "flyte-sandbox.localHeadlessService" . }} {{- end }} diff --git a/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml b/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml index 24c67b8aa1..0ae10ae95f 100644 --- a/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml +++ b/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml @@ -223,11 +223,11 @@ subjects: name: flyte-flyte-binary namespace: "flyte" --- -# Source: flyte-binary/templates/service/main.yaml +# Source: flyte-binary/templates/service/grpc.yaml apiVersion: v1 kind: Service metadata: - name: flyte-flyte-binary + name: flyte-flyte-binary-grpc namespace: "flyte" labels: helm.sh/chart: flyte-binary-v0.1.10 @@ -239,10 +239,6 @@ metadata: spec: type: ClusterIP ports: - - name: http - port: 8088 - targetPort: http - nodePort: null - name: grpc port: 8089 targetPort: grpc @@ -251,6 +247,30 @@ spec: app.kubernetes.io/name: flyte-binary app.kubernetes.io/instance: flyte --- +# Source: flyte-binary/templates/service/http.yaml +apiVersion: v1 +kind: Service +metadata: + name: flyte-flyte-binary-http + namespace: "flyte" + labels: + helm.sh/chart: flyte-binary-v0.1.10 + app.kubernetes.io/name: flyte-binary + app.kubernetes.io/instance: flyte + app.kubernetes.io/version: "1.16.0" + app.kubernetes.io/managed-by: Helm + annotations: +spec: + type: ClusterIP + ports: + - name: http + port: 8088 + targetPort: http + nodePort: null + selector: + app.kubernetes.io/name: flyte-binary + app.kubernetes.io/instance: flyte +--- # Source: flyte-binary/templates/service/webhook.yaml apiVersion: v1 kind: Service diff --git a/docker/sandbox-bundled/manifests/complete.yaml b/docker/sandbox-bundled/manifests/complete.yaml index ccbf3432a7..4b60aff3fe 100644 --- a/docker/sandbox-bundled/manifests/complete.yaml +++ b/docker/sandbox-bundled/manifests/complete.yaml @@ -679,7 +679,7 @@ data: - endpoint: address: socket_address: - address: flyte-sandbox + address: flyte-sandbox-http port_value: 8088 - name: flyte_grpc connect_timeout: 0.25s @@ -693,7 +693,7 @@ data: - endpoint: address: socket_address: - address: flyte-sandbox + address: flyte-sandbox-grpc port_value: 8089 - name: kubernetes-dashboard connect_timeout: 0.25s @@ -762,7 +762,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: R2ZBT0pkdGtuZ0tQeHFuSg== + haSharedSecret: b2VKUWRRdHhxRFZTdjBoZw== proxyPassword: "" proxyUsername: "" kind: Secret @@ -846,6 +846,28 @@ type: Opaque --- apiVersion: v1 kind: Service +metadata: + labels: + app: docker-registry + chart: docker-registry-2.2.2 + heritage: Helm + release: flyte-sandbox + name: flyte-sandbox-docker-registry + namespace: flyte +spec: + ports: + - name: http-5000 + nodePort: 30000 + port: 5000 + protocol: TCP + targetPort: 5000 + selector: + app: docker-registry + release: flyte-sandbox + type: NodePort +--- +apiVersion: v1 +kind: Service metadata: labels: app.kubernetes.io/instance: flyte-sandbox @@ -853,14 +875,10 @@ metadata: app.kubernetes.io/name: flyte-sandbox app.kubernetes.io/version: 1.16.0 helm.sh/chart: flyte-binary-v0.1.10 - name: flyte-sandbox + name: flyte-sandbox-grpc namespace: flyte spec: ports: - - name: http - nodePort: null - port: 8088 - targetPort: http - name: grpc nodePort: null port: 8089 @@ -874,23 +892,23 @@ apiVersion: v1 kind: Service metadata: labels: - app: docker-registry - chart: docker-registry-2.2.2 - heritage: Helm - release: flyte-sandbox - name: flyte-sandbox-docker-registry + app.kubernetes.io/instance: flyte-sandbox + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/name: flyte-sandbox + app.kubernetes.io/version: 1.16.0 + helm.sh/chart: flyte-binary-v0.1.10 + name: flyte-sandbox-http namespace: flyte spec: ports: - - name: http-5000 - nodePort: 30000 - port: 5000 - protocol: TCP - targetPort: 5000 + - name: http + nodePort: null + port: 8088 + targetPort: http selector: - app: docker-registry - release: flyte-sandbox - type: NodePort + app.kubernetes.io/instance: flyte-sandbox + app.kubernetes.io/name: flyte-sandbox + type: ClusterIP --- apiVersion: v1 kind: Service @@ -1246,7 +1264,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: b7af65b89a798a2365e092b31a46eaacce978a64328b65fea14f014dee5e5d79 + checksum/secret: 48e64be9ebcd5c9ff9ad152978104552589aa88ff0bd550670a9ec8455151979 labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/dev.yaml b/docker/sandbox-bundled/manifests/dev.yaml index 184dc92ca5..edd99470d3 100644 --- a/docker/sandbox-bundled/manifests/dev.yaml +++ b/docker/sandbox-bundled/manifests/dev.yaml @@ -499,7 +499,7 @@ metadata: --- apiVersion: v1 data: - haSharedSecret: NjRUSFFsdTFmWTRIMjdidA== + haSharedSecret: SDlDRTkxTjJVR1RWR3FoYw== proxyPassword: "" proxyUsername: "" kind: Secret @@ -875,7 +875,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 65be01926fb2783a4fb52f21e30f126a85ff29b0e0fead341247f06035e07118 + checksum/secret: 75a31dd053629254067f5affbf3616f39d3bdfab6e1ee176bf358ef248dabe2c labels: app: docker-registry release: flyte-sandbox