Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Added feature to set a fixed nodePort in values. (#10)
Browse files Browse the repository at this point in the history
Added setting to set a fixed nodePort.
  • Loading branch information
derjohn authored Mar 1, 2022
1 parent d08152d commit 8117cfc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ The following table lists the configurable parameters of the Adminer chart and t
| **Service** |
| `service.type` | Service type | `NodePort` |
| `service.port` | The service port | `80` |
| `service.nodePort` | The nodePort port | `nil` |
| `service.annotations` | Custom annotations for service | `{}` |
| `service.labels` | Additional custom labels for the service | `{}` |
| `service.loadBalancerIP` | LoadBalancerIP if service type is `LoadBalancer` | `nil` |
Expand Down
3 changes: 3 additions & 0 deletions templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- if and .Values.service.nodePort (eq .Values.service.type "NodePort") }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app.kubernetes.io/name: {{ include "adminer.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ service:
type: NodePort
port: 80
annotations: {}
# To set a nodePort. Otherwise kubernetes will use a random nodePort.
# nodePort:
## Set the LoadBalancer service type to internal only.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
##
Expand Down

0 comments on commit 8117cfc

Please sign in to comment.