Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prefect-server helm chart enhancement to support multi-port service #318

Merged
merged 5 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions charts/prefect-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ Prefect Agent application bundle
| serviceAccount.create | bool | `true` | specifies whether a ServiceAccount should be created |
| serviceAccount.name | string | `""` | the name of the ServiceAccount to use. if not set and create is true, a name is generated using the common.names.fullname template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
4 changes: 4 additions & 0 deletions charts/prefect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ No secrets are created when providing an existing secret.
| ingress.host.path | string | `"/"` | default path for the ingress record |
| ingress.host.pathType | string | `"ImplementationSpecific"` | ingress path type |
| ingress.selfSigned | bool | `false` | create a TLS secret for this ingress record using self-signed certificates generated by Helm |
| ingress.servicePort | string | `"server-svc-port"` | port for the ingress' main path |
| ingress.tls | bool | `false` | enable TLS configuration for the host defined at `ingress.host.hostname` parameter |
| nameOverride | string | `""` | partially overrides common.names.name |
| namespaceOverride | string | `""` | fully override common.names.namespace |
Expand Down Expand Up @@ -188,6 +189,7 @@ No secrets are created when providing an existing secret.
| service.annotations | object | `{}` | |
| service.clusterIP | string | `""` | service Cluster IP |
| service.externalTrafficPolicy | string | `"Cluster"` | service external traffic policy |
| service.extraPorts | list | `[]` | |
| service.nodePort | string | `""` | service port if defining service as type nodeport |
| service.port | int | `4200` | service port |
| service.targetPort | int | `4200` | target port of the server pod; also sets PREFECT_SERVER_API_PORT |
Expand All @@ -196,3 +198,5 @@ No secrets are created when providing an existing secret.
| serviceAccount.create | bool | `true` | specifies whether a ServiceAccount should be created |
| serviceAccount.name | string | `""` | the name of the ServiceAccount to use. if not set and create is true, a name is generated using the common.names.fullname template |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
4 changes: 2 additions & 2 deletions charts/prefect-server/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: {{ .Values.ingress.host.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" "server-svc-port" "context" $) | nindent 14 }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" .) "servicePort" .Values.ingress.servicePort "context" $) | nindent 14 }}
{{- end }}
{{- range .Values.ingress.extraHosts }}
- host: {{ .name | quote }}
Expand All @@ -45,7 +45,7 @@ spec:
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default "ImplementationSpecific" .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "server-svc-port" "context" $) | nindent 14 }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" .Values.ingress.servicePort "context" $) | nindent 14 }}
{{- end }}
{{- if .Values.ingress.extraRules }}
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.extraRules "context" $) | nindent 4 }}
Expand Down
11 changes: 11 additions & 0 deletions charts/prefect-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,16 @@ spec:
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- range .Values.service.extraPorts }}
- name: {{ .name }}
protocol: TCP
port: {{ .port }}
targetPort: {{ .targetPort }}
{{- if and (eq $.Values.service.type "NodePort") (not (empty .nodePort)) }}
nodePort: {{ .nodePort }}
{{- else if eq $.Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- end }}
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: server
24 changes: 24 additions & 0 deletions charts/prefect-server/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,24 @@
"description": "service port",
"form": true
},
"extraPorts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"port": {
"type": "integer"
},
"targetPort": {
"type": "integer"
}
},
"required": ["name", "port", "targetPort"]
}
},
"clusterIP": {
"type": "string",
"title": "Cluster IP",
Expand Down Expand Up @@ -575,6 +593,12 @@
"description": "enable ingress record generation for server",
"form": true
},
"servicePort": {
"type": "string",
"title": "Service Port Name",
"description": "service port name",
"form": true
},
"className": {
"type": "string",
"title": "Class Name",
Expand Down
24 changes: 20 additions & 4 deletions charts/prefect-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,17 +185,29 @@ serviceAccount:

## Service configuration
service:
# -- service type
type: ClusterIP
# -- service port
port: 4200
# -- target port of the server pod; also sets PREFECT_SERVER_API_PORT
targetPort: 4200
# -- service Cluster IP
clusterIP: ""
# -- service port if defining service as type nodeport
nodePort: ""

extraPorts: []
# # example extra ports
# - name: sample-svc-port
# # -- service port
# port: 8080
# # -- target port
# targetPort: 8080
# # -- service port if defining service as type nodeport
# nodePort: ""

# -- service type
type: ClusterIP
# -- service Cluster IP
clusterIP: ""


## ref http://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
# -- service external traffic policy
externalTrafficPolicy: Cluster
Expand All @@ -206,6 +218,10 @@ service:
ingress:
# -- enable ingress record generation for server
enabled: false

# -- port for the ingress' main path
servicePort: server-svc-port

## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster .
## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
# -- IngressClass that will be used to implement the Ingress (Kubernetes 1.18+)
Expand Down
2 changes: 2 additions & 0 deletions charts/prefect-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,3 +302,5 @@ helm install prefect-worker prefect/prefect-worker -f values.yaml --set-file wor
| worker.serverApiConfig.uiUrl | string | `"http://localhost:4200"` | prefect UI url |
| worker.tolerations | list | `[]` | tolerations for worker pods assignment |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
2 changes: 2 additions & 0 deletions charts/prometheus-prefect-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ Shoutout to @ialejandro for the original work on this chart!
| serviceMonitor.enabled | bool | `false` | Enable or disable |
| tolerations | list | `[]` | Tolerations for pod assignment |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)