Skip to content

Commit

Permalink
Split flyte-binary services into http and grpc, and some cleanups (#3518
Browse files Browse the repository at this point in the history
)

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

Signed-off-by: Jeev B <[email protected]>

* Point ingress to correct service

Signed-off-by: Jeev B <[email protected]>

---------

Signed-off-by: Jeev B <[email protected]>
  • Loading branch information
jeevb authored Mar 31, 2023
1 parent 4bc87b9 commit ee90abe
Show file tree
Hide file tree
Showing 14 changed files with 224 additions and 116 deletions.
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
48 changes: 24 additions & 24 deletions charts/flyte-binary/templates/ingress/grpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,86 +30,86 @@ spec:
{{- 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 }}
Expand Down
76 changes: 38 additions & 38 deletions charts/flyte-binary/templates/ingress/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,135 +30,135 @@ spec:
{{- 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 }}
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

0 comments on commit ee90abe

Please sign in to comment.