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 b37fdcc
Show file tree
Hide file tree
Showing 5 changed files with 263 additions and 26 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
5 changes: 3 additions & 2 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 Down
18 changes: 6 additions & 12 deletions charts/flyte-binary/templates/ingress/http.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,21 +175,15 @@ spec:
path: /oauth2/*
pathType: ImplementationSpecific
{{- if not .Values.ingress.separateGrpcIngress }}
{{- range .Values.ingress.grpcPaths }}
- backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
{{- $paths := (include "flyte-binary.ingress.grpcPaths" .) | fromYamlArray -}}
{{- range $path := $paths }}
- path: {{ $path }}
pathType: ImplementationSpecific
backend:
service:
name: {{ include "flyte-binary.service.http.name" $ }}
name: {{ include "flyte-binary.service.grpc.name" $ }}
port:
number: {{ include "flyte-binary.service.grpc.port" $ }}
{{- else }}
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
236 changes: 236 additions & 0 deletions deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,239 @@ spec:
name: flyte-flyte-binary-config-secret
- name: state
emptyDir: {}
---
# Source: flyte-binary/templates/ingress/http.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
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:
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
spec:
rules:
- http:
paths:
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /console
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /console/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /api
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /api/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /healthcheck
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /v1/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /.well-known
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /.well-known/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /login
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /login/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /logout
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /logout/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /callback
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /callback/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /me
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /config
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /config/*
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /oauth2
pathType: ImplementationSpecific
- backend:
service:
name: flyte-flyte-binary-http
port:
number: 8088
path: /oauth2/*
pathType: ImplementationSpecific
- path: /flyteidl.service.AdminService
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.AdminService/*
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.DataProxyService
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.DataProxyService/*
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.AuthMetadataService
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.AuthMetadataService/
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.IdentityService
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.IdentityService/*
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /grpc.health.v1.Health
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /grpc.health.v1.Health/*
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.SignalService
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089
- path: /flyteidl.service.SignalService/*
pathType: ImplementationSpecific
backend:
service:
name: flyte-flyte-binary-grpc
port:
number: 8089

0 comments on commit b37fdcc

Please sign in to comment.