From 79feb6ca8f162e0a1d6bd7171f3a2d754923a1df Mon Sep 17 00:00:00 2001 From: Charles Vallance Date: Tue, 30 Jan 2018 09:23:34 +1300 Subject: [PATCH] [stable/postgresql] Added ability to set the NodePort for the postgresql chart. (#3349) * Added ability to set the NodePort for the postgresql chart. * Update Chart.yaml --- stable/postgresql/Chart.yaml | 2 +- stable/postgresql/README.md | 1 + stable/postgresql/templates/svc.yaml | 5 ++++- stable/postgresql/values.yaml | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index f9cc919813..8749a18ea9 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,5 +1,5 @@ name: postgresql -version: 0.8.8 +version: 0.8.9 description: Object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. keywords: - postgresql diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index fd65f606fb..fbcab9c8d3 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -71,6 +71,7 @@ The following tables lists the configurable parameters of the PostgresSQL chart | `service.externalIPs` | External IPs to listen on | `[]` | | `service.port` | TCP port | `5432` | | `service.type` | k8s service type exposing ports, e.g. `NodePort`| `ClusterIP` | +| `service.nodePort` | NodePort value if service.type is `NodePort` | `nil` | | `networkPolicy.enabled` | Enable NetworkPolicy | `false` | | `networkPolicy.allowExternal` | Don't require client label for connections | `true` | | `nodeSelector` | Node labels for pod assignment | {} | diff --git a/stable/postgresql/templates/svc.yaml b/stable/postgresql/templates/svc.yaml index 6446db5340..38c1fa2fba 100644 --- a/stable/postgresql/templates/svc.yaml +++ b/stable/postgresql/templates/svc.yaml @@ -18,9 +18,12 @@ spec: - name: postgresql port: {{ .Values.service.port }} targetPort: postgresql + {{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} {{- if .Values.service.externalIPs }} externalIPs: {{ toYaml .Values.service.externalIPs | indent 4 }} {{- end }} selector: - app: {{ template "postgresql.fullname" . }} \ No newline at end of file + app: {{ template "postgresql.fullname" . }} diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index 0254fb4fc8..83673e5738 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -89,6 +89,9 @@ service: type: ClusterIP port: 5432 externalIPs: [] + ## Manually set NodePort value + ## Requires service.type: NodePort + # nodePort: networkPolicy: ## Enable creation of NetworkPolicy resources.