diff --git a/charts/flyte-binary/README.md b/charts/flyte-binary/README.md index 4955ed2233b..d04bed0f6dd 100644 --- a/charts/flyte-binary/README.md +++ b/charts/flyte-binary/README.md @@ -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 | `[]` | | diff --git a/charts/flyte-binary/templates/_helpers.tpl b/charts/flyte-binary/templates/_helpers.tpl index 2ddcaf69111..890ba074b6f 100644 --- a/charts/flyte-binary/templates/_helpers.tpl +++ b/charts/flyte-binary/templates/_helpers.tpl @@ -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. */}} diff --git a/charts/flyte-binary/templates/configmap.yaml b/charts/flyte-binary/templates/configmap.yaml index d8b17d48c4a..06cdbc700a2 100644 --- a/charts/flyte-binary/templates/configmap.yaml +++ b/charts/flyte-binary/templates/configmap.yaml @@ -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 }} diff --git a/charts/flyte-binary/templates/service/main.yaml b/charts/flyte-binary/templates/service/grpc.yaml similarity index 81% rename from charts/flyte-binary/templates/service/main.yaml rename to charts/flyte-binary/templates/service/grpc.yaml index 9c93ff38d5a..b4e952cbf1e 100644 --- a/charts/flyte-binary/templates/service/main.yaml +++ b/charts/flyte-binary/templates/service/grpc.yaml @@ -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 }} @@ -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") }} @@ -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 diff --git a/charts/flyte-binary/templates/service/http.yaml b/charts/flyte-binary/templates/service/http.yaml new file mode 100644 index 00000000000..21e2ac0e6f6 --- /dev/null +++ b/charts/flyte-binary/templates/service/http.yaml @@ -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 }} diff --git a/charts/flyte-binary/templates/service/webhook.yaml b/charts/flyte-binary/templates/service/webhook.yaml index f5375b1f709..b39c1d3661e 100644 --- a/charts/flyte-binary/templates/service/webhook.yaml +++ b/charts/flyte-binary/templates/service/webhook.yaml @@ -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: diff --git a/charts/flyte-binary/values.yaml b/charts/flyte-binary/values.yaml index eae7461b9de..c4aafd88de9 100644 --- a/charts/flyte-binary/values.yaml +++ b/charts/flyte-binary/values.yaml @@ -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` @@ -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: diff --git a/charts/flyte-sandbox/Chart.lock b/charts/flyte-sandbox/Chart.lock index 121a13f8780..4393af9bd24 100644 --- a/charts/flyte-sandbox/Chart.lock +++ b/charts/flyte-sandbox/Chart.lock @@ -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" diff --git a/charts/flyte-sandbox/templates/proxy/configmap.yaml b/charts/flyte-sandbox/templates/proxy/configmap.yaml index 83ec877ce04..362597aa9e6 100644 --- a/charts/flyte-sandbox/templates/proxy/configmap.yaml +++ b/charts/flyte-sandbox/templates/proxy/configmap.yaml @@ -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 }} @@ -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 }} diff --git a/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml b/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml index c0de679b737..467dd9b4a21 100644 --- a/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml +++ b/deployment/sandbox-binary/flyte_sandbox_binary_helm_generated.yaml @@ -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 @@ -242,10 +242,6 @@ metadata: spec: type: ClusterIP ports: - - name: http - port: 8088 - targetPort: http - nodePort: null - name: grpc port: 8089 targetPort: grpc @@ -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 diff --git a/docker/sandbox-bundled/manifests/complete.yaml b/docker/sandbox-bundled/manifests/complete.yaml index 7945ef1cef5..a69a24cacf3 100644 --- a/docker/sandbox-bundled/manifests/complete.yaml +++ b/docker/sandbox-bundled/manifests/complete.yaml @@ -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 @@ -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 @@ -765,7 +765,7 @@ type: Opaque --- apiVersion: v1 data: - haSharedSecret: VnBOU0tUSU41Q2xCcnlQeA== + haSharedSecret: ZjlGakUxd2tRWDczVm1TWQ== proxyPassword: "" proxyUsername: "" kind: Secret @@ -849,6 +849,28 @@ 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 @@ -856,14 +878,10 @@ metadata: 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 @@ -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 @@ -1249,7 +1267,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: 91c457e16b511b53b62ae35de8ee25922d4f6bdd9314080917d35a4371913dfe + checksum/secret: 9c63831797751a963fbd5a46d2b160687aa4bb10019dfd0c5f799255fddb337c labels: app: docker-registry release: flyte-sandbox diff --git a/docker/sandbox-bundled/manifests/dev.yaml b/docker/sandbox-bundled/manifests/dev.yaml index 5825ca4aba7..6dd828e9593 100644 --- a/docker/sandbox-bundled/manifests/dev.yaml +++ b/docker/sandbox-bundled/manifests/dev.yaml @@ -499,7 +499,7 @@ metadata: --- apiVersion: v1 data: - haSharedSecret: VVEybHJXNFB1dG1MOGFHMw== + haSharedSecret: UkpOMFBRUmJXVExpalNuaw== proxyPassword: "" proxyUsername: "" kind: Secret @@ -875,7 +875,7 @@ spec: metadata: annotations: checksum/config: 8f50e768255a87f078ba8b9879a0c174c3e045ffb46ac8723d2eedbe293c8d81 - checksum/secret: c6c04852c5465cb16c65eece01dad679035d630a275fe214868372580cbfffc3 + checksum/secret: 73dd63243008802c6d42ecf42acc8f113b877704a0f0fb747682d87ee5e93fc6 labels: app: docker-registry release: flyte-sandbox