Skip to content

Commit

Permalink
move paths in values.yaml to _helpers.tpl
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Lo <[email protected]>
  • Loading branch information
lowc1012 committed Feb 25, 2024
1 parent c8402d0 commit b6c54d8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
12 changes: 0 additions & 12 deletions charts/flyte-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,18 +129,6 @@ Chart for basic single Flyte executable deployment
| ingress.grpcExtraPaths.append | list | `[]` | |
| ingress.grpcExtraPaths.prepend | list | `[]` | |
| ingress.grpcIngressClassName | string | `""` | |
| ingress.grpcPaths[0] | string | `"/flyteidl.service.AdminService"` | |
| ingress.grpcPaths[10] | string | `"/flyteidl.service.SignalService"` | |
| ingress.grpcPaths[11] | string | `"/flyteidl.service.SignalService/*"` | |
| ingress.grpcPaths[1] | string | `"/flyteidl.service.AdminService/*"` | |
| ingress.grpcPaths[2] | string | `"/flyteidl.service.DataProxyService"` | |
| ingress.grpcPaths[3] | string | `"/flyteidl.service.DataProxyService/*"` | |
| ingress.grpcPaths[4] | string | `"/flyteidl.service.AuthMetadataService"` | |
| ingress.grpcPaths[5] | string | `"/flyteidl.service.AuthMetadataService/*"` | |
| ingress.grpcPaths[6] | string | `"/flyteidl.service.IdentityService"` | |
| ingress.grpcPaths[7] | string | `"/flyteidl.service.IdentityService/*"` | |
| ingress.grpcPaths[8] | string | `"/grpc.health.v1.Health"` | |
| ingress.grpcPaths[9] | string | `"/grpc.health.v1.Health/*"` | |
| ingress.grpcTls | list | `[]` | |
| ingress.host | string | `""` | |
| ingress.httpAnnotations | object | `{}` | |
Expand Down
18 changes: 18 additions & 0 deletions charts/flyte-binary/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,24 @@ Get the Flyte service GRPC port.
{{- default 8089 .Values.service.ports.grpc -}}
{{- end -}}

{{/*
Get the Flyte service GRPC paths.
*/}}
{{- define "flyte-binary.ingress.grpcPaths" -}}
- /flyteidl.service.AdminService
- /flyteidl.service.AdminService/*
- /flyteidl.service.AuthMetadataService
- /flyteidl.service.AuthMetadataService/
- /flyteidl.service.DataProxyService
- /flyteidl.service.DataProxyService/*
- /flyteidl.service.IdentityService
- /flyteidl.service.IdentityService/*
- /flyteidl.service.SignalService
- /flyteidl.service.SignalService/*
- /grpc.health.v1.Health
- /grpc.health.v1.Health/*
{{- end -}}

{{/*
Get the Flyte agent service GRPC port.
*/}}
Expand Down
9 changes: 5 additions & 4 deletions charts/flyte-binary/templates/ingress/grpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if and .Values.ingress.create .Values.ingress.separateGrpcIngress }}
{{- $paths := (include "flyte-binary.ingress.grpcPaths" .) | fromYamlArray }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
Expand Down Expand Up @@ -38,8 +39,8 @@ spec:
{{- if .Values.ingress.grpcExtraPaths.prepend }}
{{- tpl ( .Values.ingress.grpcExtraPaths.prepend | toYaml ) . | nindent 6 }}
{{- end }}
{{- range .Values.ingress.grpcPaths }}
- path: {{ . }}
{{- range $path := $paths }}
- path: {{ $path }}
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: ImplementationSpecific
{{- end }}
Expand All @@ -50,8 +51,8 @@ spec:
port:
number: {{ include "flyte-binary.service.grpc.port" $ }}
{{- else }}
serviceName: {{ include "flyte-binary.service.grpc.name" $ }}
servicePort: {{ include "flyte-binary.service.grpc.port" $ }}
serviceName: {{ include "flyte-binary.service.grpc.name" $ }}
servicePort: {{ include "flyte-binary.service.grpc.port" $ }}
{{- end }}
{{- end }}
{{- if .Values.ingress.grpcExtraPaths.append }}
Expand Down
13 changes: 7 additions & 6 deletions charts/flyte-binary/templates/ingress/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,13 @@ spec:
path: /oauth2/*
pathType: ImplementationSpecific
{{- if not .Values.ingress.separateGrpcIngress }}
{{- range .Values.ingress.grpcPaths }}
- backend:
{{- $paths := (include "flyte-binary.ingress.grpcPaths" .) | fromYamlArray }}
{{- range $path := $paths }}
- path: {{ $path }}
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: ImplementationSpecific
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "flyte-binary.service.http.name" $ }}
Expand All @@ -186,10 +191,6 @@ spec:
serviceName: {{ include "flyte-binary.service.http.name" $ }}
servicePort: {{ include "flyte-binary.service.grpc.port" $ }}
{{- end }}
path: {{ . }}
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
pathType: ImplementationSpecific
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.ingress.httpExtraPaths.append }}
Expand Down

0 comments on commit b6c54d8

Please sign in to comment.