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

Split flyte-binary services into http and grpc, and some cleanups #3518

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion charts/flyte-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ Chart for basic single Flyte executable deployment
| rbac.create | bool | `true` | |
| rbac.extraRules | list | `[]` | |
| rbac.labels | object | `{}` | |
| service.annotations | object | `{}` | |
| service.clusterIP | string | `""` | |
| service.commonAnnotations | object | `{}` | |
| service.externalTrafficPolicy | string | `"Cluster"` | |
| service.extraPorts | list | `[]` | |
| service.grpcAnnotations | object | `{}` | |
| service.httpAnnotations | object | `{}` | |
| service.labels | object | `{}` | |
| service.loadBalancerIP | string | `""` | |
| service.loadBalancerSourceRanges | list | `[]` | |
Expand Down
18 changes: 16 additions & 2 deletions charts/flyte-binary/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,31 @@ 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" -}}
{{- define "flyte-binary.service.http.port" -}}
{{- default 8088 .Values.service.ports.http -}}
{{- end -}}

{{/*
Get the Flyte service GRPC port.
*/}}
{{- define "flyte-binary.service.grpcPort" -}}
{{- define "flyte-binary.service.grpc.port" -}}
{{- default 8089 .Values.service.ports.grpc -}}
{{- end -}}

Expand Down
8 changes: 4 additions & 4 deletions charts/flyte-binary/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,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 }}
Expand Down
24 changes: 12 additions & 12 deletions charts/flyte-binary/templates/ingress/grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,84 +32,84 @@ spec:
service:
name: {{ include "flyte-binary.fullname" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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 }}
Expand Down
38 changes: 19 additions & 19 deletions charts/flyte-binary/templates/ingress/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,133 +32,133 @@ spec:
service:
name: {{ include "flyte-binary.fullname" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
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" . }}
port:
number: {{ include "flyte-binary.service.httpPort" . }}
number: {{ include "flyte-binary.service.http.port" . }}
path: /oauth2/*
pathType: ImplementationSpecific
{{- if .Values.ingress.httpExtraPaths.append }}
Expand Down
49 changes: 49 additions & 0 deletions charts/flyte-binary/templates/service/grpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
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.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 }}
{{- if .Values.service.commonAnnotations }}
{{- tpl ( .Values.service.commonAnnotations | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.service.grpcAnnotations }}
{{- tpl ( .Values.service.grpcAnnotations | 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: grpc
port: {{ include "flyte-binary.service.grpc.port" . }}
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 }}
selector: {{- include "flyte-binary.selectorLabels" . | nindent 4 }}
Loading