From 10a3ab3be3c0c1bd04e532dccd5d928ccc12f6d3 Mon Sep 17 00:00:00 2001 From: Mike Splain Date: Mon, 4 Sep 2017 15:31:51 -0400 Subject: [PATCH] Add tolerations and node selector to postgresql (#1850) --- stable/postgresql/Chart.yaml | 2 +- stable/postgresql/README.md | 2 ++ stable/postgresql/templates/deployment.yaml | 8 ++++++++ stable/postgresql/values.yaml | 6 ++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index 8b770cfb8d..c497fd4c53 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,5 +1,5 @@ name: postgresql -version: 0.8.1 +version: 0.8.2 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 e213b2e85a..ade7a25cc5 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -70,6 +70,8 @@ The following tables lists the configurable parameters of the PostgresSQL chart | `service.type` | k8s service type exposing ports, e.g. `NodePort`| `ClusterIP` | | `networkPolicy.enabled` | Enable NetworkPolicy | `false` | | `networkPolicy.allowExternal` | Don't require client label for connections | `true` | +| `nodeSelector` | Node labels for pod assignment | {} | +| `tolerations` | Toleration labels for pod assignment | [] | The above parameters map to the env variables defined in [postgres](http://github.com/docker-library/postgres). For more information please refer to the [postgres](http://github.com/docker-library/postgres) image documentation. diff --git a/stable/postgresql/templates/deployment.yaml b/stable/postgresql/templates/deployment.yaml index 99e69e7d09..c080048458 100644 --- a/stable/postgresql/templates/deployment.yaml +++ b/stable/postgresql/templates/deployment.yaml @@ -13,6 +13,14 @@ spec: labels: app: {{ template "postgresql.fullname" . }} spec: + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 8 }} + {{- end }} containers: - name: {{ template "postgresql.fullname" . }} image: "{{ .Values.image }}:{{ .Values.imageTag }}" diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index c092fe471b..432fcfe2b4 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -89,3 +89,9 @@ networkPolicy: ## (with the correct destination port). ## allowExternal: true + +## Node labels and tolerations for pod assignment +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector +## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature +nodeSelector: {} +tolerations: []