Skip to content

Commit

Permalink
Create separate grpc service for flyteadmin
Browse files Browse the repository at this point in the history
This allows setting annotations that are required for some ingress controllers
for grpc communication only on the parts that actually use grpc.
Without this separation either the console or the grpc endpoints did not
work properly with some ingress controllers, e.g. traefik.

Signed-off-by: Julian Einhaus <[email protected]>
  • Loading branch information
Jeinhaus committed Apr 3, 2024
1 parent dc1294e commit 44eaba8
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 27 deletions.
29 changes: 29 additions & 0 deletions charts/flyte-core/templates/admin/service-grpc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.flyteadmin.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "flyteadmin.name" . }}-grpc
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flyteadmin.labels" . | nindent 4 }}
annotations:
{{- if .Values.flyteadmin.service.annotations }}
{{ tpl ( .Values.flyteadmin.service.annotations | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.flyteadmin.service.grpcAnnotations }}
{{ tpl ( .Values.flyteadmin.service.grpcAnnotations | toYaml ) . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.flyteadmin.service.type}}
type: {{ . }}
{{- end }}
{{- with .Values.flyteadmin.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ . }}
{{- end }}
ports:
- name: grpc
port: 81
protocol: TCP
targetPort: 8089
selector: {{ include "flyteadmin.selectorLabels" . | nindent 4 }}
{{- end }}
14 changes: 7 additions & 7 deletions charts/flyte-core/templates/admin/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ metadata:
name: {{ template "flyteadmin.name" . }}
namespace: {{ template "flyte.namespace" . }}
labels: {{ include "flyteadmin.labels" . | nindent 4 }}
{{- with .Values.flyteadmin.service.annotations }}
annotations: {{ tpl (toYaml .) $ | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.flyteadmin.service.annotations }}
{{ tpl ( .Values.flyteadmin.service.annotations | toYaml ) . | nindent 4 }}
{{- end }}
{{- if .Values.flyteadmin.service.httpAnnotations }}
{{ tpl ( .Values.flyteadmin.service.httpAnnotations | toYaml ) . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.flyteadmin.service.type}}
type: {{ . }}
Expand All @@ -21,10 +25,6 @@ spec:
port: 80
protocol: TCP
targetPort: 8088
- name: grpc
port: 81
protocol: TCP
targetPort: 8089
- name: redoc
protocol: TCP
port: 87
Expand Down
24 changes: 12 additions & 12 deletions charts/flyte-core/templates/common/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,84 +8,84 @@
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.SignalService/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.AdminService
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.AdminService/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.DataProxyService
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.DataProxyService/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.AuthMetadataService
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.AuthMetadataService/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.IdentityService
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /flyteidl.service.IdentityService/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /grpc.health.v1.Health
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
- path: /grpc.health.v1.Health/*
pathType: ImplementationSpecific
backend:
service:
name: flyteadmin
name: flyteadmin-grpc
port:
number: {{ $grpcPort }}
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/flyte-core/values-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ userSettings:
dbHost: <CLOUD-SQL-IP>
dbPassword: <DBPASSWORD>
# These two storage buckets could be the same or you could specify different buckets if required. Both keys are required.
# Learn more https://docs.flyte.org/en/latest/concepts/data_management.html#understand-how-flyte-handles-data
bucketName: <METADATA_BUCKET_NAME>
rawDataBucketName: <RAW_DATA_BUCKET_NAME>
# Learn more https://docs.flyte.org/en/latest/concepts/data_management.html#understand-how-flyte-handles-data
bucketName: <METADATA_BUCKET_NAME>
rawDataBucketName: <RAW_DATA_BUCKET_NAME>
hostName: <HOSTNAME>

#
Expand All @@ -35,7 +35,7 @@ flyteadmin:
ephemeral-storage: 2Gi
memory: 1G
service:
annotations:
grpcAnnotations:
# Required for the ingress to properly route grpc traffic to grpc port
cloud.google.com/app-protocols: '{"grpc":"HTTP2"}'
affinity:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ flyteadmin:
- flyteexamples
# -- Service settings for Flyteadmin
service:
annotations:
grpcAnnotations:
projectcontour.io/upstream-protocol.h2c: grpc
type: ClusterIP
loadBalancerSourceRanges: []
Expand Down
2 changes: 1 addition & 1 deletion charts/flyte-core/values-sandbox.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ flyteadmin:
serviceMonitor:
enabled: false
service:
annotations:
grpcAnnotations:
projectcontour.io/upstream-protocol.h2c: grpc
type: ClusterIP
loadBalancerSourceRanges: []
Expand Down
7 changes: 5 additions & 2 deletions charts/flyte-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ flyteadmin:
- flyteexamples
# -- Service settings for Flyteadmin
service:
annotations:
projectcontour.io/upstream-protocol.h2c: grpc
annotations: {}
httpAnnotations: {}
grpcAnnotations: {}
# projectcontour.io/upstream-protocol.h2c: grpc
# traefik.ingress.kubernetes.io/service.serversscheme: h2c
type: ClusterIP
loadBalancerSourceRanges: []
# -- Configuration for service accounts for FlyteAdmin
Expand Down

0 comments on commit 44eaba8

Please sign in to comment.