From a7dbd5565509e453d7633a8f2811e7ee28c32d80 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sat, 5 Nov 2016 01:06:30 -0700 Subject: [PATCH] Separate postgres resource requests/limits. Also bring them in line with our toYaml resources pattern that a growing number of charts are using. --- stable/postgresql/Chart.yaml | 2 +- stable/postgresql/README.md | 1 + stable/postgresql/templates/deployment.yaml | 9 ++------- stable/postgresql/values.yaml | 10 ++++++++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index fa571d8bcd..95eab54e76 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,5 +1,5 @@ name: postgresql -version: 0.1.1 +version: 0.2.0 description: Chart for PostgreSQL keywords: - postgresql diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index ba08531763..e56be8842b 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -54,6 +54,7 @@ The following tables lists the configurable parameters of the PostgresSQL chart | `persistence.storageClass` | Storage class of backing PVC | `generic` | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `100m` | 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 dc571ee732..718f5e25dd 100644 --- a/stable/postgresql/templates/deployment.yaml +++ b/stable/postgresql/templates/deployment.yaml @@ -31,13 +31,6 @@ spec: - name: {{ template "fullname" . }} image: "postgres:{{ .Values.imageTag }}" imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} - resources: - requests: - cpu: "{{.Values.cpu}}" - memory: "{{.Values.memory}}" - limits: - cpu: "{{.Values.cpu}}" - memory: "{{.Values.memory}}" env: - name: POSTGRES_USER value: {{ default "postgres" .Values.postgresUser | quote }} @@ -68,6 +61,8 @@ spec: - pg_isready initialDelaySeconds: 60 timeoutSeconds: 3 + resources: +{{ toYaml .Values.resources | indent 10 }} volumeMounts: - name: data mountPath: /var/lib/postgresql/data/pgdata diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index 311e7095e4..3f89cda875 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -2,8 +2,6 @@ ## ref: https://hub.docker.com/r/library/postgres/tags/ ## imageTag: "9.5.4" -cpu: 100m -memory: 256Mi ## Specify a imagePullPolicy ## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' @@ -27,3 +25,11 @@ persistence: storageClass: generic accessMode: ReadWriteOnce size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + requests: + memory: 256Mi + cpu: 100m