Skip to content

Commit

Permalink
Split flyte-binary services into http and grpc, and some cleanups
Browse files Browse the repository at this point in the history
Signed-off-by: Jeev B <[email protected]>
  • Loading branch information
jeevb committed Mar 31, 2023
1 parent 42a2467 commit 2a7d9ec
Show file tree
Hide file tree
Showing 12 changed files with 162 additions and 51 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
14 changes: 14 additions & 0 deletions charts/flyte-binary/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@ 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.
*/}}
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "flyte-binary.fullname" . }}
name: {{ include "flyte-binary.service.grpc.name" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "flyte-binary.labels" . | nindent 4 }}
{{- if .Values.commonLabels }}
Expand All @@ -17,6 +17,12 @@ metadata:
{{- 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") }}
Expand All @@ -32,14 +38,6 @@ spec:
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
Expand Down
52 changes: 52 additions & 0 deletions charts/flyte-binary/templates/service/http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
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.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.httpAnnotations }}
{{- tpl ( .Values.service.httpAnnotations | 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 }}
{{- if .Values.service.extraPorts }}
{{- tpl ( .Values.service.extraPorts | toYaml ) . | nindent 4 }}
{{- end }}
selector: {{- include "flyte-binary.selectorLabels" . | nindent 4 }}
3 changes: 3 additions & 0 deletions charts/flyte-binary/templates/service/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ metadata:
{{- if .Values.service.annotations }}
{{- tpl ( .Values.service.annotations | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.service.commonAnnotations }}
{{- tpl ( .Values.service.commonAnnotations | toYaml ) . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
ports:
Expand Down
12 changes: 8 additions & 4 deletions charts/flyte-binary/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,12 @@ service:
clusterIP: ""
# labels Add labels to Flyte services
labels: {}
# annotations Add annotations to Flyte services
annotations: {}
# commonAnnotations Add annotations to Flyte services
commonAnnotations: {}
# httpAnnotations Add annotations to http service resource
httpAnnotations: {}
# grpcAnnotations Add annotations to grpc service resource
grpcAnnotations: {}
# loadBalancerIP Set static IP if service type is `LoadBalancer`
loadBalancerIP: ""
# externalTrafficPolicy Enable client source IP preservation if service type is `NodePort` or `LoadBalancer`
Expand All @@ -270,9 +274,9 @@ ingress:
host: ""
# commonAnnotations Add common annotations to all ingress resources
commonAnnotations: {}
# httpAnnotations Add common annotations to http ingress resource
# httpAnnotations Add annotations to http ingress resource
httpAnnotations: {}
# grpcAnnotations Add common annotations to grpc ingress resource
# grpcAnnotations Add annotations to grpc ingress resource
grpcAnnotations: {}
# httpExtraPaths Add extra paths to http ingress rule
httpExtraPaths:
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-sandbox/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ dependencies:
repository: https://charts.bitnami.com/bitnami
version: 12.1.9
digest: sha256:e7155e540bbdb98f690eb12e2bd301a19d8b36833336f6991410cb44d8d9bb5e
generated: "2023-03-23T20:15:22.877977-07:00"
generated: "2023-03-31T09:15:26.449028-07:00"
4 changes: 2 additions & 2 deletions charts/flyte-sandbox/templates/proxy/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand Down
32 changes: 26 additions & 6 deletions deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,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
Expand All @@ -242,10 +242,6 @@ metadata:
spec:
type: ClusterIP
ports:
- name: http
port: 8088
targetPort: http
nodePort: null
- name: grpc
port: 8089
targetPort: grpc
Expand All @@ -254,6 +250,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
Expand Down
62 changes: 40 additions & 22 deletions docker/sandbox-bundled/manifests/complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ data:
- endpoint:
address:
socket_address:
address: flyte-sandbox
address: flyte-sandbox-http
port_value: 8088
- name: flyte_grpc
connect_timeout: 0.25s
Expand All @@ -696,7 +696,7 @@ data:
- endpoint:
address:
socket_address:
address: flyte-sandbox
address: flyte-sandbox-grpc
port_value: 8089
- name: kubernetes-dashboard
connect_timeout: 0.25s
Expand Down Expand Up @@ -765,7 +765,7 @@ type: Opaque
---
apiVersion: v1
data:
haSharedSecret: VnBOU0tUSU41Q2xCcnlQeA==
haSharedSecret: ZjlGakUxd2tRWDczVm1TWQ==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -849,21 +849,39 @@ 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
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
name: flyte-sandbox-grpc
namespace: flyte
spec:
ports:
- name: http
nodePort: null
port: 8088
targetPort: http
- name: grpc
nodePort: null
port: 8089
Expand All @@ -877,23 +895,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
Expand Down Expand Up @@ -1249,7 +1267,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: 91c457e16b511b53b62ae35de8ee25922d4f6bdd9314080917d35a4371913dfe
checksum/secret: 9c63831797751a963fbd5a46d2b160687aa4bb10019dfd0c5f799255fddb337c
labels:
app: docker-registry
release: flyte-sandbox
Expand Down
4 changes: 2 additions & 2 deletions docker/sandbox-bundled/manifests/dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ metadata:
---
apiVersion: v1
data:
haSharedSecret: VVEybHJXNFB1dG1MOGFHMw==
haSharedSecret: UkpOMFBRUmJXVExpalNuaw==
proxyPassword: ""
proxyUsername: ""
kind: Secret
Expand Down Expand Up @@ -875,7 +875,7 @@ spec:
metadata:
annotations:
checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81
checksum/secret: c6c04852c5465cb16c65eece01dad679035d630a275fe214868372580cbfffc3
checksum/secret: 73dd63243008802c6d42ecf42acc8f113b877704a0f0fb747682d87ee5e93fc6
labels:
app: docker-registry
release: flyte-sandbox
Expand Down

0 comments on commit 2a7d9ec

Please sign in to comment.