From fbf4d8df7424670e5f120ce29d14a07dc37264bd Mon Sep 17 00:00:00 2001 From: Amanda Cameron Date: Mon, 30 Jan 2017 19:50:35 -0500 Subject: [PATCH] [stable/phabricator] Update to the recommended pvc patterns. (#459) * Convert chart phabricator to use the recommended pvc patterns * truncate to 63 and trim trailing dashes * remove annotations and fix trunc in pvc * document alpha storage class fallback * update mariadb dep * truncate to 63 and trim trailing dashes * bump version * fix NOTES when no mariadb password --- stable/phabricator/README.md | 4 ++-- stable/phabricator/requirements.lock | 6 +++--- stable/phabricator/requirements.yaml | 2 +- stable/phabricator/templates/NOTES.txt | 10 ++++++---- stable/phabricator/templates/_helpers.tpl | 10 +++++----- stable/phabricator/templates/apache-pvc.yaml | 6 +++++- stable/phabricator/templates/phabricator-pvc.yaml | 6 +++++- stable/phabricator/values.yaml | 15 ++++++++++++--- 8 files changed, 39 insertions(+), 20 deletions(-) diff --git a/stable/phabricator/README.md b/stable/phabricator/README.md index 7c6aadc9b3..6b919cc06b 100644 --- a/stable/phabricator/README.md +++ b/stable/phabricator/README.md @@ -64,10 +64,10 @@ The following tables lists the configurable parameters of the Phabricator chart | `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` | | `serviceType` | Kubernetes Service type | `LoadBalancer` | | `persistence.enabled` | Enable persistence using PVC | `true` | -| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `generic` | +| `persistence.apache.storageClass` | PVC Storage Class for Apache volume | `nil` (uses alpha storage class annotation) | | `persistence.apache.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | | `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.phabricator.storageClass` | PVC Storage Class for Phabricator volume | `generic` | +| `persistence.phabricator.storageClass` | PVC Storage Class for Phabricator volume | `nil` (uses alpha storage class annotation) | | `persistence.phabricator.accessMode` | PVC Access Mode for Phabricator volume | `ReadWriteOnce` | | `persistence.phabricator.size` | PVC Storage Request for Phabricator volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | diff --git a/stable/phabricator/requirements.lock b/stable/phabricator/requirements.lock index 7eb30f6161..6915cf457a 100644 --- a/stable/phabricator/requirements.lock +++ b/stable/phabricator/requirements.lock @@ -1,6 +1,6 @@ dependencies: - name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 0.5.4 -digest: sha256:7388428c9d365911ec0431462cd31a7feb89dd9b8488e387448f598017dea49d -generated: 2016-12-08T15:17:52.50703327+05:30 + version: 0.5.7 +digest: sha256:409eefb841b53ef1aa91d0607d87e6c475297df40101180c787260d766657d95 +generated: 2017-01-27T18:15:33.428097822-08:00 diff --git a/stable/phabricator/requirements.yaml b/stable/phabricator/requirements.yaml index 1820a6ff63..ac65eec118 100644 --- a/stable/phabricator/requirements.yaml +++ b/stable/phabricator/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: mariadb - version: 0.5.6 + version: 0.5.7 repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/stable/phabricator/templates/NOTES.txt b/stable/phabricator/templates/NOTES.txt index 9a7fa51804..183ef003d7 100644 --- a/stable/phabricator/templates/NOTES.txt +++ b/stable/phabricator/templates/NOTES.txt @@ -19,14 +19,16 @@ host. To configure Phabricator with the URL of your service: Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' export APP_HOST=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") - export APP_PASSWORD=$(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password[*]}"`)) - export APP_DATABASE_PASSWORD=$(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password[*]}"`)) + export APP_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) + {{- if .Values.mariadb.mariadbRootPassword }} + export APP_DATABASE_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "mariadb.fullname" . }} -o jsonpath="{.data.mariadb-root-password}" | base64 --decode) + {{- end }} {{- end }} 2. Complete your Phabricator deployment by running: helm upgrade {{ .Release.Name }} \ - --set phabricatorHost=$APP_HOST,phabricatorPassword=$APP_PASSWORD,mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD stable/phabricator + --set phabricatorHost=$APP_HOST,phabricatorPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} stable/phabricator {{- else -}} 1. Get the Phabricator URL by running: @@ -44,5 +46,5 @@ host. To configure Phabricator with the URL of your service: 2. Get your Phabricator login credentials by running: echo Username: {{ .Values.phabricatorUsername }} - echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password[*]}"`)) + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.phabricator-password}" | base64 --decode) {{- end }} diff --git a/stable/phabricator/templates/_helpers.tpl b/stable/phabricator/templates/_helpers.tpl index 77da2c6a6e..2463906531 100644 --- a/stable/phabricator/templates/_helpers.tpl +++ b/stable/phabricator/templates/_helpers.tpl @@ -3,24 +3,24 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "mariadb.fullname" -}} -{{- printf "%s-%s" .Release.Name "mariadb" | trunc 24 -}} +{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* diff --git a/stable/phabricator/templates/apache-pvc.yaml b/stable/phabricator/templates/apache-pvc.yaml index 39fd689744..166feb8b9f 100644 --- a/stable/phabricator/templates/apache-pvc.yaml +++ b/stable/phabricator/templates/apache-pvc.yaml @@ -9,7 +9,11 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.apache.storageClass | quote }} + {{- if .Values.persistence.apache.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.apache.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} spec: accessModes: - {{ .Values.persistence.apache.accessMode | quote }} diff --git a/stable/phabricator/templates/phabricator-pvc.yaml b/stable/phabricator/templates/phabricator-pvc.yaml index 99dfdab46b..fc7cb2497d 100644 --- a/stable/phabricator/templates/phabricator-pvc.yaml +++ b/stable/phabricator/templates/phabricator-pvc.yaml @@ -9,7 +9,11 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.phabricator.storageClass | quote }} + {{- if .Values.persistence.phabricator.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.phabricator.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} spec: accessModes: - {{ .Values.persistence.phabricator.accessMode | quote }} diff --git a/stable/phabricator/values.yaml b/stable/phabricator/values.yaml index e3f22c1c96..b1b0eaa222 100644 --- a/stable/phabricator/values.yaml +++ b/stable/phabricator/values.yaml @@ -68,7 +68,10 @@ mariadb: ## persistence: enabled: true - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi @@ -83,11 +86,17 @@ serviceType: LoadBalancer persistence: enabled: true apache: - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 1Gi phabricator: - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi