diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index 242087fe55..fbce9d641b 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,5 +1,5 @@ name: postgresql -version: 2.7.10 +version: 3.0.0 appVersion: 10.6.0 description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. keywords: diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index d1153e820f..8f1b9c61d5 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -82,9 +82,12 @@ The following tables lists the configurable parameters of the PostgreSQL chart a | `persistence.accessMode` | PVC Access Mode for PostgreSQL volume | `ReadWriteOnce` | | `persistence.size` | PVC Storage Request for PostgreSQL volume | `8Gi` | | `persistence.annotations` | Annotations for the PVC | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `affinity` | Affinity labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | +| `master.nodeSelector` | Node labels for pod assignment (postgresql master) | `{}` | +| `master.affinity` | Affinity labels for pod assignment (postgresql master) | `{}` | +| `master.tolerations` | Toleration labels for pod assignment (postgresql master) | `[]` | +| `slave.nodeSelector` | Node labels for pod assignment (postgresql slave) | `{}` | +| `slave.affinity` | Affinity labels for pod assignment (postgresql slave) | `{}` | +| `slave.tolerations` | Toleration labels for pod assignment (postgresql slave) | `[]` | | `terminationGracePeriodSeconds` | Seconds the pod needs to terminate gracefully | `nil` | | `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | | `securityContext.enabled` | Enable security context | `true` | @@ -190,6 +193,19 @@ This label will be displayed in the output of a successful install. ## Upgrade +### 3.0.0 + +This releases make it possible to specify different nodeSelector, affinity and tolerations for master and slave pods. +It also fixes an issue with `postgresql.master.fullname` helper template not obeying fullnameOverride. + +#### Breaking changes + +- `affinty` has been renamed to `master.affinity` and `slave.affinity`. +- `tolerations` has been renamed to `master.tolerations` and `slave.tolerations`. +- `nodeSelector` has been renamed to `master.nodeSelector` and `slave.nodeSelector`. + +### 2.0.0 + In order to upgrade from the `0.X.X` branch to `1.X.X`, you should follow the below steps: - Obtain the service name (`SERVICE_NAME`) and password (`OLD_PASSWORD`) of the existing postgresql chart. You can find the instructions to obtain the password in the NOTES.txt, the service name can be obtained by running diff --git a/stable/postgresql/templates/_helpers.tpl b/stable/postgresql/templates/_helpers.tpl index f62c720d29..4447c99555 100644 --- a/stable/postgresql/templates/_helpers.tpl +++ b/stable/postgresql/templates/_helpers.tpl @@ -25,10 +25,11 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this */}} {{- define "postgresql.master.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- $fullname := default (printf "%s-%s" .Release.Name $name) .Values.fullnameOverride -}} {{- if .Values.replication.enabled -}} -{{- printf "%s-%s-%s" .Release.Name $name "master" | trunc 63 | trimSuffix "-" -}} +{{- printf "%s-%s" $fullname "master" | trunc 63 | trimSuffix "-" -}} {{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- printf "%s" $fullname | trunc 63 | trimSuffix "-" -}} {{- end -}} {{- end -}} diff --git a/stable/postgresql/templates/statefulset-slaves.yaml b/stable/postgresql/templates/statefulset-slaves.yaml index 674aa20413..825a6371c9 100644 --- a/stable/postgresql/templates/statefulset-slaves.yaml +++ b/stable/postgresql/templates/statefulset-slaves.yaml @@ -39,17 +39,17 @@ spec: - name: {{ . }} {{- end}} {{- end }} - {{- if .Values.nodeSelector }} + {{- if .Values.slave.nodeSelector }} nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} +{{ toYaml .Values.slave.nodeSelector | indent 8 }} {{- end }} - {{- if .Values.affinity }} + {{- if .Values.slave.affinity }} affinity: -{{ toYaml .Values.affinity | indent 8 }} +{{ toYaml .Values.slave.affinity | indent 8 }} {{- end }} - {{- if .Values.tolerations }} + {{- if .Values.slave.tolerations }} tolerations: -{{ toYaml .Values.tolerations | indent 8 }} +{{ toYaml .Values.slave.tolerations | indent 8 }} {{- end }} {{- if .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} diff --git a/stable/postgresql/templates/statefulset.yaml b/stable/postgresql/templates/statefulset.yaml index 321dc8ced7..01da91b35f 100644 --- a/stable/postgresql/templates/statefulset.yaml +++ b/stable/postgresql/templates/statefulset.yaml @@ -41,17 +41,17 @@ spec: - name: {{ . }} {{- end}} {{- end }} - {{- if .Values.nodeSelector }} + {{- if .Values.master.nodeSelector }} nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} +{{ toYaml .Values.master.nodeSelector | indent 8 }} {{- end }} - {{- if .Values.affinity }} + {{- if .Values.master.affinity }} affinity: -{{ toYaml .Values.affinity | indent 8 }} +{{ toYaml .Values.master.affinity | indent 8 }} {{- end }} - {{- if .Values.tolerations }} + {{- if .Values.master.tolerations }} tolerations: -{{ toYaml .Values.tolerations | indent 8 }} +{{ toYaml .Values.master.tolerations | indent 8 }} {{- end }} {{- if .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} diff --git a/stable/postgresql/values-production.yaml b/stable/postgresql/values-production.yaml index 0e7232417a..2c28021f4f 100644 --- a/stable/postgresql/values-production.yaml +++ b/stable/postgresql/values-production.yaml @@ -133,11 +133,29 @@ persistence: size: 8Gi annotations: {} -## 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: [] +## +## PostgreSQL Master parameters +## +master: + ## Node, affinity and tolerations labels for pod assignment + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature + nodeSelector: {} + affinity: {} + tolerations: [] + +## +## PostgreSQL Slave parameters +## +slave: + ## Node, affinity and tolerations labels for pod assignment + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature + nodeSelector: {} + affinity: {} + tolerations: [] ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index 9d2f435479..a9114872b8 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -138,13 +138,29 @@ persistence: size: 8Gi annotations: {} -## Node, affinity and tolerations labels for pod assignment -## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector -## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature -nodeSelector: {} -affinity: {} -tolerations: [] +## +## PostgreSQL Master parameters +## +master: + ## Node, affinity and tolerations labels for pod assignment + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature + nodeSelector: {} + affinity: {} + tolerations: [] + +## +## PostgreSQL Slave parameters +## +slave: + ## Node, affinity and tolerations labels for pod assignment + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity + ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#taints-and-tolerations-beta-feature + nodeSelector: {} + affinity: {} + tolerations: [] ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/