From ebd2b9d4900de04626bdad1fa472c7822e60212d Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sat, 17 Dec 2016 14:08:57 +0530 Subject: [PATCH 01/13] adds moodle chart --- stable/moodle/.helmignore | 1 + stable/moodle/Chart.yaml | 15 ++++ stable/moodle/README.md | 96 +++++++++++++++++++++++++ stable/moodle/requirements.lock | 6 ++ stable/moodle/requirements.yaml | 4 ++ stable/moodle/templates/NOTES.txt | 29 ++++++++ stable/moodle/templates/_helpers.tpl | 24 +++++++ stable/moodle/templates/apache-pvc.yaml | 19 +++++ stable/moodle/templates/deployment.yaml | 90 +++++++++++++++++++++++ stable/moodle/templates/moodle-pvc.yaml | 19 +++++ stable/moodle/templates/secrets.yaml | 17 +++++ stable/moodle/templates/svc.yaml | 20 ++++++ stable/moodle/values.yaml | 78 ++++++++++++++++++++ 13 files changed, 418 insertions(+) create mode 100644 stable/moodle/.helmignore create mode 100644 stable/moodle/Chart.yaml create mode 100644 stable/moodle/README.md create mode 100644 stable/moodle/requirements.lock create mode 100644 stable/moodle/requirements.yaml create mode 100644 stable/moodle/templates/NOTES.txt create mode 100644 stable/moodle/templates/_helpers.tpl create mode 100644 stable/moodle/templates/apache-pvc.yaml create mode 100644 stable/moodle/templates/deployment.yaml create mode 100644 stable/moodle/templates/moodle-pvc.yaml create mode 100644 stable/moodle/templates/secrets.yaml create mode 100644 stable/moodle/templates/svc.yaml create mode 100644 stable/moodle/values.yaml diff --git a/stable/moodle/.helmignore b/stable/moodle/.helmignore new file mode 100644 index 000000000000..6b8710a711f3 --- /dev/null +++ b/stable/moodle/.helmignore @@ -0,0 +1 @@ +.git diff --git a/stable/moodle/Chart.yaml b/stable/moodle/Chart.yaml new file mode 100644 index 000000000000..8af6828fc593 --- /dev/null +++ b/stable/moodle/Chart.yaml @@ -0,0 +1,15 @@ +name: moodle +version: 0.1.2 +description: Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments +keywords: +- moodle +- learning +- php +home: http://www.moodle.org/ +sources: +- https://github.com/bitnami/bitnami-docker-moodle +maintainers: +- name: Bitnami + email: containers@bitnami.com +engine: gotpl +icon: https://bitnami.com/assets/stacks/moodle/img/moodle-stack-110x117.png diff --git a/stable/moodle/README.md b/stable/moodle/README.md new file mode 100644 index 000000000000..e7ae296fb2d6 --- /dev/null +++ b/stable/moodle/README.md @@ -0,0 +1,96 @@ +# Moodle + +[Moodle](https://www.moodle.org) Moodle is a learning platform designed to provide educators, administrators and learners with a single robust, secure and integrated system to create personalised learning environments + +## TL;DR; + +```console +$ helm install stable/moodle +``` + +## Introduction + +This chart bootstraps a [Moodle](https://github.com/bitnami/bitnami-docker-moodle) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +It also packages the [Bitnami MariaDB chart](https://github.com/kubernetes/charts/tree/master/stable/mariadb) which is required for bootstrapping a MariaDB deployment for the database requirements of the Moodle application. + +## Prerequisites + +- Kubernetes 1.4+ with Beta APIs enabled +- PV provisioner support in the underlying infrastructure + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release stable/moodle +``` + +The command deploys Moodle on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following tables lists the configurable parameters of the Moodle chart and their default values. + +| Parameter | Description | Default | +|-----------------------------------|---------------------------------------|----------------------------------------------------------| +| `image` | Moodle image | `bitnami/moodle:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `Always` if `image` tag is `latest`, else `IfNotPresent` | +| `moodleUsername` | User of the application | `user` | +| `moodlePassword` | Application password | _random 10 character alphanumeric string_ | +| `moodleEmail` | Admin email | `user@example.com` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` | +| `smtpProtocol` | SMTP Protocol | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `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.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | +| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | +| `persistence.moodle.storageClass` | PVC Storage Class for Moodle volume | `generic` | +| `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | +| `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | + +The above parameters map to the env variables defined in [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle). For more information please refer to the [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle) image documentation. + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```console +$ helm install --name my-release \ + --set moodleUsername=admin,moodlePassword=password,mariadb.mariadbRootPassword=secretpassword \ + stable/moodle +``` + +The above command sets the Moodle administrator account username and password to `admin` and `password` respectively. Additionally it sets the MariaDB `root` user password to `secretpassword`. + +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, + +```console +$ helm install --name my-release -f values.yaml stable/moodle +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +## Persistence + +The [Bitnami Moodle](https://github.com/bitnami/bitnami-docker-moodle) image stores the Moodle data and configurations at the `/bitnami/moodle` and `/bitnami/apache` paths of the container. + +Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +See the [Configuration](#configuration) section to configure the PVC or to disable persistence. diff --git a/stable/moodle/requirements.lock b/stable/moodle/requirements.lock new file mode 100644 index 000000000000..7eb30f61613b --- /dev/null +++ b/stable/moodle/requirements.lock @@ -0,0 +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 diff --git a/stable/moodle/requirements.yaml b/stable/moodle/requirements.yaml new file mode 100644 index 000000000000..31911a0284a5 --- /dev/null +++ b/stable/moodle/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: +- name: mariadb + version: 0.5.4 + repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/stable/moodle/templates/NOTES.txt b/stable/moodle/templates/NOTES.txt new file mode 100644 index 000000000000..d7fd83511a25 --- /dev/null +++ b/stable/moodle/templates/NOTES.txt @@ -0,0 +1,29 @@ + +** Please be patient while the chart is being deployed ** + +1. Get the Moodle URL by running: + +{{- if contains "NodePort" .Values.serviceType }} + + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + echo http://$NODE_IP:$NODE_PORT/ + +{{- else if contains "LoadBalancer" .Values.serviceType }} + +** Please ensure an external IP is associated to the {{ template "fullname" . }} service before proceeding ** +** Watch the status using: kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }} ** + + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + echo http://$SERVICE_IP/ +{{- else if contains "ClusterIP" .Values.serviceType }} + + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}") + echo http://127.0.0.1:8080/ + kubectl port-forward $POD_NAME 8080:80 +{{- end }} + +2. Login with the following credentials + + echo Username: {{ .Values.moodleUsername }} + echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.moodle-password[*]}"`)) diff --git a/stable/moodle/templates/_helpers.tpl b/stable/moodle/templates/_helpers.tpl new file mode 100644 index 000000000000..4355810df459 --- /dev/null +++ b/stable/moodle/templates/_helpers.tpl @@ -0,0 +1,24 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- 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). +*/}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- 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). +*/}} +{{- define "mariadb.fullname" -}} +{{- printf "%s-%s" .Release.Name "mariadb" | trunc 24 -}} +{{- end -}} diff --git a/stable/moodle/templates/apache-pvc.yaml b/stable/moodle/templates/apache-pvc.yaml new file mode 100644 index 000000000000..39fd689744be --- /dev/null +++ b/stable/moodle/templates/apache-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistence.enabled -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "fullname" . }}-apache + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.apache.storageClass | quote }} +spec: + accessModes: + - {{ .Values.persistence.apache.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.apache.size | quote }} +{{- end -}} diff --git a/stable/moodle/templates/deployment.yaml b/stable/moodle/templates/deployment.yaml new file mode 100644 index 000000000000..f66a41c5248c --- /dev/null +++ b/stable/moodle/templates/deployment.yaml @@ -0,0 +1,90 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + template: + metadata: + labels: + app: {{ template "fullname" . }} + spec: + containers: + - name: {{ template "fullname" . }} + image: "{{ .Values.image }}" + imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} + env: + - name: MARIADB_HOST + value: {{ template "mariadb.fullname" . }} + - name: MARIADB_PORT + value: "3306" + - name: MARIADB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "mariadb.fullname" . }} + key: mariadb-root-password + - name: MOODLE_USERNAME + value: {{ default "" .Values.moodleUsername | quote }} + - name: MOODLE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: moodle-password + - name: MOODLE_EMAIL + value: {{ default "" .Values.moodleEmail | quote }} + - name: SMTP_HOST + value: {{ default "" .Values.smtpHost | quote }} + - name: SMTP_PORT + value: {{ default "" .Values.smtpPort | quote }} + - name: SMTP_USER + value: {{ default "" .Values.smtpUser | quote }} + - name: SMTP_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "fullname" . }} + key: smtp-password + - name: SMTP_PROTOCOL + value: {{ default "" .Values.smtpProtocol | quote }} + ports: + - name: http + containerPort: 80 + - name: https + containerPort: 443 + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 120 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 5 + timeoutSeconds: 1 + resources: +{{ toYaml .Values.resources | indent 10 }} + volumeMounts: + - name: moodle-data + mountPath: /bitnami/moodle + - name: apache-data + mountPath: /bitnami/apache + volumes: + - name: moodle-data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "fullname" . }}-moodle + {{- else }} + emptyDir: {} + {{- end }} + - name: apache-data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "fullname" . }}-apache + {{- else }} + emptyDir: {} + {{- end }} diff --git a/stable/moodle/templates/moodle-pvc.yaml b/stable/moodle/templates/moodle-pvc.yaml new file mode 100644 index 000000000000..a117abca18cd --- /dev/null +++ b/stable/moodle/templates/moodle-pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistence.enabled -}} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "fullname" . }}-moodle + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" + annotations: + volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.moodle.storageClass | quote }} +spec: + accessModes: + - {{ .Values.persistence.moodle.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.moodle.size | quote }} +{{- end -}} diff --git a/stable/moodle/templates/secrets.yaml b/stable/moodle/templates/secrets.yaml new file mode 100644 index 000000000000..2f560227088e --- /dev/null +++ b/stable/moodle/templates/secrets.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + {{ if .Values.moodlePassword }} + moodle-password: {{ default "" .Values.moodlePassword | b64enc | quote }} + {{ else }} + moodle-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }} diff --git a/stable/moodle/templates/svc.yaml b/stable/moodle/templates/svc.yaml new file mode 100644 index 000000000000..6736e047692a --- /dev/null +++ b/stable/moodle/templates/svc.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + type: {{ .Values.serviceType }} + ports: + - name: http + port: 80 + targetPort: http + - name: https + port: 443 + targetPort: https + selector: + app: {{ template "fullname" . }} diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml new file mode 100644 index 000000000000..1b99eecec215 --- /dev/null +++ b/stable/moodle/values.yaml @@ -0,0 +1,78 @@ +## Bitnami Moodle` image version +## ref: https://hub.docker.com/r/bitnami/moodle/tags/ +## +image: bitnami/moodle:3.1.3-r5 + +## Specify a imagePullPolicy +## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' +## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images +## +# imagePullPolicy: + +## User of the application +## ref: https://github.com/bitnami/bitnami-docker-moodle#configuration +## +moodleUsername: user + +## Application password +## Defaults to a random 10-character alphanumeric string if not set +## ref: https://github.com/bitnami/bitnami-docker-moodle#configuration +## +# moodlePassword: + +## Admin email +## ref: https://github.com/bitnami/bitnami-docker-moodle#configuration +moodleEmail: user@example.com + +## SMTP mail delivery configuration +## ref: https://github.com/bitnami/bitnami-docker-moodle/#smtp-configuration +# smtpHost: +# smtpPort: +# smtpUser: +# smtpPassword: +# smtpProtocol: + +## +## MariaDB chart configuration +## +mariadb: + ## MariaDB admin password + ## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run + ## + # mariadbRootPassword: + + ## Enable persistence using Persistent Volume Claims + ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ + ## + persistence: + enabled: true + storageClass: generic + accessMode: ReadWriteOnce + size: 8Gi + +## Kubernetes configuration +## For minikube, set this to NodePort, elsewhere use LoadBalancer +## +serviceType: LoadBalancer + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + enabled: true + apache: + storageClass: generic + accessMode: ReadWriteOnce + size: 1Gi + moodle: + storageClass: generic + accessMode: ReadWriteOnce + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + requests: + memory: 512Mi + cpu: 300m From e1d24b2f33cfeee3e1ea4c65b99601d3d8f39fb1 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 5 Jan 2017 12:36:46 +0530 Subject: [PATCH 02/13] lock mariadb chart requirement to 0.5.x series --- stable/moodle/requirements.lock | 6 +++--- stable/moodle/requirements.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stable/moodle/requirements.lock b/stable/moodle/requirements.lock index 7eb30f61613b..6fa5f5db14f6 100644 --- a/stable/moodle/requirements.lock +++ b/stable/moodle/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.6 +digest: sha256:1b3aad03b4383d1a24dfbfef6ba1beb45f7ace2baa399c66f5a4d56d0f7bc717 +generated: 2017-01-06T23:32:57.055006893+05:30 diff --git a/stable/moodle/requirements.yaml b/stable/moodle/requirements.yaml index 31911a0284a5..9303bd388a42 100644 --- a/stable/moodle/requirements.yaml +++ b/stable/moodle/requirements.yaml @@ -1,4 +1,4 @@ dependencies: - name: mariadb - version: 0.5.4 + version: 0.5.x repository: https://kubernetes-charts.storage.googleapis.com/ From 1364f8939bcff2333ec17141d3ac3dfef43cfd92 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 5 Jan 2017 12:36:52 +0530 Subject: [PATCH 03/13] explicitly set default `imagePullPolicy` to `IfNotPresent` --- stable/moodle/README.md | 44 +++++++++++++++++++-------------------- stable/moodle/values.yaml | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/stable/moodle/README.md b/stable/moodle/README.md index e7ae296fb2d6..82086a9cd689 100644 --- a/stable/moodle/README.md +++ b/stable/moodle/README.md @@ -45,28 +45,28 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Moodle chart and their default values. -| Parameter | Description | Default | -|-----------------------------------|---------------------------------------|----------------------------------------------------------| -| `image` | Moodle image | `bitnami/moodle:{VERSION}` | -| `imagePullPolicy` | Image pull policy | `Always` if `image` tag is `latest`, else `IfNotPresent` | -| `moodleUsername` | User of the application | `user` | -| `moodlePassword` | Application password | _random 10 character alphanumeric string_ | -| `moodleEmail` | Admin email | `user@example.com` | -| `smtpHost` | SMTP host | `nil` | -| `smtpPort` | SMTP port | `nil` | -| `smtpProtocol` | SMTP Protocol | `nil` | -| `smtpUser` | SMTP user | `nil` | -| `smtpPassword` | SMTP password | `nil` | -| `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.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.moodle.storageClass` | PVC Storage Class for Moodle volume | `generic` | -| `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | -| `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| Parameter | Description | Default | +|-----------------------------------|---------------------------------------|-------------------------------------------| +| `image` | Moodle image | `bitnami/moodle:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `IfNotPresent` | +| `moodleUsername` | User of the application | `user` | +| `moodlePassword` | Application password | _random 10 character alphanumeric string_ | +| `moodleEmail` | Admin email | `user@example.com` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` | +| `smtpProtocol` | SMTP Protocol | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `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.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | +| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | +| `persistence.moodle.storageClass` | PVC Storage Class for Moodle volume | `generic` | +| `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | +| `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | The above parameters map to the env variables defined in [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle). For more information please refer to the [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle) image documentation. diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 1b99eecec215..2917b80812bd 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -7,7 +7,7 @@ image: bitnami/moodle:3.1.3-r5 ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## -# imagePullPolicy: +imagePullPolicy: IfNotPresent ## User of the application ## ref: https://github.com/bitnami/bitnami-docker-moodle#configuration From 696f345c0f1cf649c04b5de5f14d5b8763f8bd1c Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Tue, 10 Jan 2017 15:02:18 +0530 Subject: [PATCH 04/13] moodle: add alpha and beta storageclass annotation support --- stable/moodle/README.md | 48 +++++++++++++------------ stable/moodle/templates/apache-pvc.yaml | 6 +++- stable/moodle/templates/moodle-pvc.yaml | 6 +++- stable/moodle/values.yaml | 10 ++++-- 4 files changed, 44 insertions(+), 26 deletions(-) diff --git a/stable/moodle/README.md b/stable/moodle/README.md index 82086a9cd689..3a060856de79 100644 --- a/stable/moodle/README.md +++ b/stable/moodle/README.md @@ -45,28 +45,32 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Moodle chart and their default values. -| Parameter | Description | Default | -|-----------------------------------|---------------------------------------|-------------------------------------------| -| `image` | Moodle image | `bitnami/moodle:{VERSION}` | -| `imagePullPolicy` | Image pull policy | `IfNotPresent` | -| `moodleUsername` | User of the application | `user` | -| `moodlePassword` | Application password | _random 10 character alphanumeric string_ | -| `moodleEmail` | Admin email | `user@example.com` | -| `smtpHost` | SMTP host | `nil` | -| `smtpPort` | SMTP port | `nil` | -| `smtpProtocol` | SMTP Protocol | `nil` | -| `smtpUser` | SMTP user | `nil` | -| `smtpPassword` | SMTP password | `nil` | -| `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.accessMode` | PVC Access Mode for Apache volume | `ReadWriteOnce` | -| `persistence.apache.size` | PVC Storage Request for Apache volume | `1Gi` | -| `persistence.moodle.storageClass` | PVC Storage Class for Moodle volume | `generic` | -| `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | -| `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| Parameter | Description | Default | +|------------------------------------|----------------------------------------|---------------------------------------------| +| `image` | Moodle image | `bitnami/moodle:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `IfNotPresent` | +| `moodleUsername` | User of the application | `user` | +| `moodlePassword` | Application password | _random 10 character alphanumeric string_ | +| `moodleEmail` | Admin email | `user@example.com` | +| `smtpHost` | SMTP host | `nil` | +| `smtpPort` | SMTP port | `nil` | +| `smtpProtocol` | SMTP Protocol | `nil` | +| `smtpUser` | SMTP user | `nil` | +| `smtpPassword` | SMTP password | `nil` | +| `serviceType` | Kubernetes Service type | `LoadBalancer` | +| `resources` | CPU/Memory resource requests/limits | Memory: `512Mi`, CPU: `300m` | +| `persistence.enabled` | Enable persistence using PVC | `true` | +| `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.moodle.storageClass` | PVC Storage Class for Moodle volume | `nil` (uses alpha storage class annotation) | +| `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | +| `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | +| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` | +| `mariadb.persistence.enabled` | Enable MariaDB persistence using PVC | `true` | +| `mariadb.persistence.storageClass` | PVC Storage Class for MariaDB volume | `generic` | +| `mariadb.persistence.accessMode` | PVC Access Mode for MariaDB volume | `ReadWriteOnce` | +| `mariadb.persistence.size` | PVC Storage Request for MariaDB volume | `8Gi` | The above parameters map to the env variables defined in [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle). For more information please refer to the [bitnami/moodle](http://github.com/bitnami/bitnami-docker-moodle) image documentation. diff --git a/stable/moodle/templates/apache-pvc.yaml b/stable/moodle/templates/apache-pvc.yaml index 39fd689744be..166feb8b9f47 100644 --- a/stable/moodle/templates/apache-pvc.yaml +++ b/stable/moodle/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/moodle/templates/moodle-pvc.yaml b/stable/moodle/templates/moodle-pvc.yaml index a117abca18cd..493dafaf7254 100644 --- a/stable/moodle/templates/moodle-pvc.yaml +++ b/stable/moodle/templates/moodle-pvc.yaml @@ -9,7 +9,11 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.moodle.storageClass | quote }} + {{- if .Values.persistence.moodle.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.moodle.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} spec: accessModes: - {{ .Values.persistence.moodle.accessMode | quote }} diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 2917b80812bd..865e267e8ffb 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -61,11 +61,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 moodle: - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi From ed02c98f96dbc2b8f8cb0d8fb4055a4f9cbc9c1b Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Tue, 10 Jan 2017 15:02:35 +0530 Subject: [PATCH 05/13] moodle: increase resource name truncation and trim - suffix --- stable/moodle/templates/_helpers.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stable/moodle/templates/_helpers.tpl b/stable/moodle/templates/_helpers.tpl index 4355810df459..3d76d82dd670 100644 --- a/stable/moodle/templates/_helpers.tpl +++ b/stable/moodle/templates/_helpers.tpl @@ -3,7 +3,7 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* @@ -12,7 +12,7 @@ We truncate at 24 chars because some Kubernetes name fields are limited to this */}} {{- 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 -}} {{/* @@ -20,5 +20,5 @@ 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). */}} {{- define "mariadb.fullname" -}} -{{- printf "%s-%s" .Release.Name "mariadb" | trunc 24 -}} +{{- printf "%s-%s" .Release.Name "mariadb" | trunc 63 | trimSuffix "-" -}} {{- end -}} From f9542f01c6337061d8fd31d23efdef14ca2d3828 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 19 Jan 2017 19:38:12 +0530 Subject: [PATCH 06/13] update moodle image to `bitnami/moodle:3.2.1-r1` --- stable/moodle/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 865e267e8ffb..67594cf067a4 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -1,7 +1,7 @@ ## Bitnami Moodle` image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## -image: bitnami/moodle:3.1.3-r5 +image: bitnami/moodle:3.2.1-r1 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' From 29cebbde16f20088cc66afa6eacce4ac94070b6d Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Tue, 24 Jan 2017 21:04:38 +0530 Subject: [PATCH 07/13] moodle: updated to image `bitnami/moodle:3.2.1-r2` Contains fix for https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-5340 --- stable/moodle/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 67594cf067a4..3b976c6a6838 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -1,7 +1,7 @@ ## Bitnami Moodle` image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## -image: bitnami/moodle:3.2.1-r1 +image: bitnami/moodle:3.2.1-r2 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' From 3d46eaa279b0d8ffe67ffd3f5df0f75be60851ca Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 10:08:50 +0530 Subject: [PATCH 08/13] moodle: updated to image `bitnami/moodle:3.2.1-r3` --- stable/moodle/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 3b976c6a6838..5e57be18d6b3 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -1,7 +1,7 @@ ## Bitnami Moodle` image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## -image: bitnami/moodle:3.2.1-r2 +image: bitnami/moodle:3.2.1-r3 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' From 1a78c8fcbe01efcc605e3be167b16f72556d5e1c Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 10:48:21 +0530 Subject: [PATCH 09/13] moodle: updated requirements.lock --- stable/moodle/requirements.lock | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/stable/moodle/requirements.lock b/stable/moodle/requirements.lock index 6fa5f5db14f6..d499de062788 100644 --- a/stable/moodle/requirements.lock +++ b/stable/moodle/requirements.lock @@ -1,6 +1,9 @@ dependencies: -- name: mariadb +- condition: "" + enabled: false + name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ - version: 0.5.6 -digest: sha256:1b3aad03b4383d1a24dfbfef6ba1beb45f7ace2baa399c66f5a4d56d0f7bc717 -generated: 2017-01-06T23:32:57.055006893+05:30 + tags: null + version: 0.5.9 +digest: sha256:ffd85614e09ad85c32cff0ab8a60aaf8780c3aaa3c7c46d80548973818bf12d3 +generated: 2017-02-24T10:48:01.064141178+05:30 From 97ab094853fcf8ce1dc279fc9a01b83d93ee11ce Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 10:53:17 +0530 Subject: [PATCH 10/13] moodle: fix command to fetch moodle-password from secrets volume --- stable/moodle/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stable/moodle/templates/NOTES.txt b/stable/moodle/templates/NOTES.txt index d7fd83511a25..220c67d7c5d3 100644 --- a/stable/moodle/templates/NOTES.txt +++ b/stable/moodle/templates/NOTES.txt @@ -26,4 +26,4 @@ 2. Login with the following credentials echo Username: {{ .Values.moodleUsername }} - echo Password: $(printf $(printf '\%o' `kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.moodle-password[*]}"`)) + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.moodle-password}" | base64 --decode) From 872de7a18b338062d5560082b58137f5ed726616 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 11:00:15 +0530 Subject: [PATCH 11/13] moodle: remove mariadb persistent volume `storageClass` default --- stable/moodle/README.md | 2 +- stable/moodle/values.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stable/moodle/README.md b/stable/moodle/README.md index 3a060856de79..bd5ffbe68a50 100644 --- a/stable/moodle/README.md +++ b/stable/moodle/README.md @@ -66,7 +66,7 @@ The following tables lists the configurable parameters of the Moodle chart and t | `persistence.moodle.storageClass` | PVC Storage Class for Moodle volume | `nil` (uses alpha storage class annotation) | | `persistence.moodle.accessMode` | PVC Access Mode for Moodle volume | `ReadWriteOnce` | | `persistence.moodle.size` | PVC Storage Request for Moodle volume | `8Gi` | -| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` | +| `mariadb.mariadbRootPassword` | MariaDB admin password | `nil` (uses alpha storage class annotation) | | `mariadb.persistence.enabled` | Enable MariaDB persistence using PVC | `true` | | `mariadb.persistence.storageClass` | PVC Storage Class for MariaDB volume | `generic` | | `mariadb.persistence.accessMode` | PVC Access Mode for MariaDB volume | `ReadWriteOnce` | diff --git a/stable/moodle/values.yaml b/stable/moodle/values.yaml index 5e57be18d6b3..12f713986ebf 100644 --- a/stable/moodle/values.yaml +++ b/stable/moodle/values.yaml @@ -46,7 +46,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 From 9ec57060415d5163ac8046b5059b5b44e96853c1 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 10 Mar 2017 09:45:12 +0530 Subject: [PATCH 12/13] moodle: regernerated requirements.lock --- stable/moodle/requirements.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/moodle/requirements.lock b/stable/moodle/requirements.lock index d499de062788..5f6c228b1bf5 100644 --- a/stable/moodle/requirements.lock +++ b/stable/moodle/requirements.lock @@ -4,6 +4,6 @@ dependencies: name: mariadb repository: https://kubernetes-charts.storage.googleapis.com/ tags: null - version: 0.5.9 + version: 0.5.10 digest: sha256:ffd85614e09ad85c32cff0ab8a60aaf8780c3aaa3c7c46d80548973818bf12d3 -generated: 2017-02-24T10:48:01.064141178+05:30 +generated: 2017-03-10T09:44:49.316375601+05:30 From fadd62b7053f07e553bd6a820f333413c34c1359 Mon Sep 17 00:00:00 2001 From: Sean Knox Date: Wed, 22 Mar 2017 15:49:27 -0700 Subject: [PATCH 13/13] Update .helmignore --- stable/moodle/.helmignore | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/stable/moodle/.helmignore b/stable/moodle/.helmignore index 6b8710a711f3..f0c131944441 100644 --- a/stable/moodle/.helmignore +++ b/stable/moodle/.helmignore @@ -1 +1,21 @@ -.git +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj