-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Currently, when setting service.type: NodePort in the service.yaml, it is not possible to configure nodePort values directly through values.yaml.
This requires manual intervention, such as running:
kubectl patch svc seq -n seq --type=json -p="[{\"op\": \"replace\", \"path\": \"/spec/ports/0/nodePort\", \"value\": 30038}, {\"op\": \"replace\", \"path\": \"/spec/ports/1/nodePort\", \"value\": 30039}]"
To avoid this, I propose allowing nodePort configuration directly via values.yaml.
For example, the first two ports in the service.yaml could be modified like this:
ports:
- port: {{ .Values.ui.service.port }}
targetPort: ui
protocol: TCP
name: ui
{{- if eq .Values.service.type "NodePort" }}
nodePort: {{ .Values.ui.service.nodePort }}
{{- end }}
- port: {{ .Values.ingestion.service.port }}
targetPort: ingestion
protocol: TCP
name: ingestion
{{- if eq .Values.service.type "NodePort" }}
nodePort: {{ .Values.ingestion.service.nodePort }}
{{- end }}This would allow users to specify nodePort in values.yaml like so:
# The complete Seq API and UI.
# This API can accept events and serve API requests.
ui:
containerPort: 80
service:
port: 80
nodePort: 30038
ingress:
enabled: false
path: /
hosts: []
# The ingestion-only API.
# This API is a subset of ui that can only ingest events.
ingestion:
containerPort: 5341
service:
port: 5341
nodePort: 30039
ingress:
enabled: false
path: /
hosts: []This approach could also be extended to other ports such as gelf and syslog, making the chart more flexible and user-friendly. Each port can have its nodePort configured explicitly in values.yaml.
kamilzzz
Metadata
Metadata
Assignees
Labels
No labels