Skip to content

Commit

Permalink
Make the nodePort configurable in case NodePort is used as a service.
Browse files Browse the repository at this point in the history
  • Loading branch information
bebehei authored and dunglas committed Oct 23, 2024
1 parent bf5e08d commit 6c511ee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/mercure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ To install the chart with the release name `my-release`, run the following comma
| securityContext | object | `{}` | Container [security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container). See the [API reference](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) for details. |
| service.annotations | object | `{}` | |
| service.port | int | `80` | Service port. |
| service.nodePort | int | 0 | The exposed nodePort. Required when `service.type` is [`"NodePort"`](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport). |
| service.targetPort | int | `80` | Service target port. |
| service.type | string | `"ClusterIP"` | Kubernetes [service type](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types). |
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account. |
Expand Down
3 changes: 3 additions & 0 deletions charts/mercure/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ spec:
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
name: http
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
{{- include "mercure.selectorLabels" . | nindent 4 }}
---
Expand Down
2 changes: 2 additions & 0 deletions charts/mercure/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ service:
port: 80
# -- Service target port.
targetPort: 80
# -- Set this, to pin the external nodePort in case `service.type` is `NodePort`.
nodePort:
annotations: {}

ingress:
Expand Down

0 comments on commit 6c511ee

Please sign in to comment.