[stable/opencart] Update to the recommended pvc patterns. (#457)

* Convert chart opencart to use the recommended pvc patterns

* update mariadb dep

* fix notes for 1.5

* truncate to 63 and trim trailing dashes

* remove annotations and fix trunc in pvc

* bump version

* document alpha storage class fallback

* fix NOTES when no mariadb password
This commit is contained in:
Amanda Cameron
2017-01-30 16:50:12 -08:00
committed by Adnan Abdulhussein
parent 11f64eeea6
commit 323f7f2ab6
8 changed files with 39 additions and 20 deletions
+2 -2
View File
@@ -62,10 +62,10 @@ The following tables lists the configurable parameters of the OpenCart chart and
| `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.opencart.storageClass` | PVC Storage Class for OpenCart volume | `generic` |
| `persistence.opencart.storageClass` | PVC Storage Class for OpenCart volume | `nil` (uses alpha storage class annotation) |
| `persistence.opencart.accessMode` | PVC Access Mode for OpenCart volume | `ReadWriteOnce` |
| `persistence.opencart.size` | PVC Storage Request for OpenCart volume | `8Gi` |
| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` |
+3 -3
View File
@@ -1,6 +1,6 @@
dependencies:
- name: mariadb
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.5.6
digest: sha256:1b3aad03b4383d1a24dfbfef6ba1beb45f7ace2baa399c66f5a4d56d0f7bc717
generated: 2017-01-25T15:57:36.670458211-08:00
version: 0.5.7
digest: sha256:409eefb841b53ef1aa91d0607d87e6c475297df40101180c787260d766657d95
generated: 2017-01-27T18:02:06.574333356-08:00
+1 -1
View File
@@ -1,4 +1,4 @@
dependencies:
- name: mariadb
version: 0.5.x
version: 0.5.7
repository: https://kubernetes-charts.storage.googleapis.com/
+6 -4
View File
@@ -19,14 +19,16 @@ host. To configure OpenCart 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.opencart-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.opencart-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 OpenCart deployment by running:
helm upgrade {{ .Release.Name }} \
--set opencartHost=$APP_HOST,opencartPassword=$APP_PASSWORD,mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD stable/opencart
--set opencartHost=$APP_HOST,opencartPassword=$APP_PASSWORD{{ if .Values.mariadb.mariadbRootPassword }},mariadb.mariadbRootPassword=$APP_DATABASE_PASSWORD{{ end }} stable/opencart
{{- else -}}
1. Get the OpenCart URL by running:
@@ -44,5 +46,5 @@ host. To configure OpenCart with the URL of your service:
2. Get your OpenCart login credentials by running:
echo Admin Username: {{ .Values.opencartUsername }}
echo Admin Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.opencart-password[*]}"`))
echo Admin Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.opencart-password}" | base64 --decode)
{{- end }}
+5 -5
View File
@@ -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 -}}
{{/*
+5 -1
View File
@@ -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 }}
+5 -1
View File
@@ -9,7 +9,11 @@ metadata:
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.opencart.storageClass | quote }}
{{- if .Values.persistence.opencart.storageClass }}
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.opencart.storageClass | quote }}
{{- else }}
volume.alpha.kubernetes.io/storage-class: default
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.opencart.accessMode | quote }}
+12 -3
View File
@@ -58,7 +58,10 @@ mariadb:
##
persistence:
enabled: true
storageClass: generic
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
accessMode: ReadWriteOnce
size: 8Gi
@@ -73,11 +76,17 @@ serviceType: LoadBalancer
persistence:
enabled: true
apache:
storageClass: generic
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
accessMode: ReadWriteOnce
size: 1Gi
opencart:
storageClass: generic
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
## Default: volume.alpha.kubernetes.io/storage-class: default
##
# storageClass:
accessMode: ReadWriteOnce
size: 8Gi