diff --git a/incubator/moodle/Chart.yaml b/incubator/moodle/Chart.yaml index f5b2fd499..8af6828fc 100644 --- a/incubator/moodle/Chart.yaml +++ b/incubator/moodle/Chart.yaml @@ -1,5 +1,5 @@ name: moodle -version: 0.1.7 +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 @@ -12,4 +12,4 @@ maintainers: - name: Bitnami email: containers@bitnami.com engine: gotpl -icon: https://moodle.org/theme/image.php/moodleorgcleaned_moodleorg/theme_moodleorgcleaned/1479806622/moodle-logo +icon: https://bitnami.com/assets/stacks/moodle/img/moodle-stack-110x117.png diff --git a/incubator/moodle/README.md b/incubator/moodle/README.md index b66071fda..b12caeed3 100644 --- a/incubator/moodle/README.md +++ b/incubator/moodle/README.md @@ -1,4 +1,4 @@ -# moodle +# 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 @@ -12,7 +12,7 @@ $ helm install . 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. +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 @@ -27,7 +27,7 @@ To install the chart with the release name `my-release`: $ helm install --name my-release ./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. +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` @@ -43,30 +43,34 @@ The command removes all the Kubernetes components associated with the chart and ## Configuration -The following tables lists the configurable parameters of the moodle chart and their default values. +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 | `8Gi` | -| `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. @@ -78,7 +82,7 @@ $ helm install --name my-release \ 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`. +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, @@ -90,7 +94,7 @@ $ helm install --name my-release -f values.yaml stable/moodle ## Persistence -The [Bitnami moodle](https://github.com/bitnami/bitnami-docker-moodle) image stores the moodle data and configurations at the `/bitnami/moodle` path of the container. +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/incubator/moodle/requirements.lock b/incubator/moodle/requirements.lock index d9c242f59..d499de062 100644 --- a/incubator/moodle/requirements.lock +++ b/incubator/moodle/requirements.lock @@ -6,4 +6,4 @@ dependencies: tags: null version: 0.5.9 digest: sha256:ffd85614e09ad85c32cff0ab8a60aaf8780c3aaa3c7c46d80548973818bf12d3 -generated: 2017-02-24T10:39:04.975364721+05:30 +generated: 2017-02-24T10:48:01.064141178+05:30 diff --git a/incubator/moodle/templates/NOTES.txt b/incubator/moodle/templates/NOTES.txt index de1a9afd1..220c67d7c 100644 --- a/incubator/moodle/templates/NOTES.txt +++ b/incubator/moodle/templates/NOTES.txt @@ -1,5 +1,7 @@ -1. Get the moodle URL by running: +** Please be patient while the chart is being deployed ** + +1. Get the Moodle URL by running: {{- if contains "NodePort" .Values.serviceType }} @@ -9,8 +11,8 @@ {{- else if contains "LoadBalancer" .Values.serviceType }} - NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc -w {{ template "fullname" . }} --namespace {{ .Release.Namespace }}' +** 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/ @@ -21,7 +23,7 @@ kubectl port-forward $POD_NAME 8080:80 {{- end }} -2. Get your moodle login credentials by running: +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 Username: {{ .Values.moodleUsername }} + echo Password: $(kubectl get secret --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath="{.data.moodle-password}" | base64 --decode) diff --git a/incubator/moodle/templates/_helpers.tpl b/incubator/moodle/templates/_helpers.tpl index 4355810df..3d76d82dd 100644 --- a/incubator/moodle/templates/_helpers.tpl +++ b/incubator/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 -}} diff --git a/incubator/moodle/templates/apache-pvc.yaml b/incubator/moodle/templates/apache-pvc.yaml index 95a0e576c..166feb8b9 100644 --- a/incubator/moodle/templates/apache-pvc.yaml +++ b/incubator/moodle/templates/apache-pvc.yaml @@ -2,14 +2,18 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: + name: {{ template "fullname" . }}-apache labels: app: {{ template "fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - name: {{ template "fullname" . }}-apache 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/incubator/moodle/templates/deployment.yaml b/incubator/moodle/templates/deployment.yaml index 5d39e4905..f66a41c52 100644 --- a/incubator/moodle/templates/deployment.yaml +++ b/incubator/moodle/templates/deployment.yaml @@ -36,8 +36,6 @@ spec: key: moodle-password - name: MOODLE_EMAIL value: {{ default "" .Values.moodleEmail | quote }} - - name: SMTP_PROTOCOL - value: {{ default "" .Values.smtpProtocol | quote }} - name: SMTP_HOST value: {{ default "" .Values.smtpHost | quote }} - name: SMTP_PORT @@ -49,6 +47,8 @@ spec: secretKeyRef: name: {{ template "fullname" . }} key: smtp-password + - name: SMTP_PROTOCOL + value: {{ default "" .Values.smtpProtocol | quote }} ports: - name: http containerPort: 80 @@ -64,7 +64,7 @@ spec: httpGet: path: / port: http - initialDelaySeconds: 30 + initialDelaySeconds: 5 timeoutSeconds: 1 resources: {{ toYaml .Values.resources | indent 10 }} @@ -85,6 +85,6 @@ spec: {{- if .Values.persistence.enabled }} persistentVolumeClaim: claimName: {{ template "fullname" . }}-apache - {{- else }} - emptyDir: {} - {{- end }} + {{- else }} + emptyDir: {} + {{- end }} diff --git a/incubator/moodle/templates/moodle-pvc.yaml b/incubator/moodle/templates/moodle-pvc.yaml index 46a8d470e..493dafaf7 100644 --- a/incubator/moodle/templates/moodle-pvc.yaml +++ b/incubator/moodle/templates/moodle-pvc.yaml @@ -2,14 +2,18 @@ kind: PersistentVolumeClaim apiVersion: v1 metadata: + name: {{ template "fullname" . }}-moodle labels: app: {{ template "fullname" . }} chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" - name: {{ template "fullname" . }}-moodle 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/incubator/moodle/templates/secrets.yaml b/incubator/moodle/templates/secrets.yaml index 11a8fc791..2f5602270 100644 --- a/incubator/moodle/templates/secrets.yaml +++ b/incubator/moodle/templates/secrets.yaml @@ -9,9 +9,9 @@ metadata: heritage: "{{ .Release.Service }}" type: Opaque data: - {{- if .Values.moodlePassword }} + {{ if .Values.moodlePassword }} moodle-password: {{ default "" .Values.moodlePassword | b64enc | quote }} - {{- else }} + {{ else }} moodle-password: {{ randAlphaNum 10 | b64enc | quote }} - {{- end }} + {{ end }} smtp-password: {{ default "" .Values.smtpPassword | b64enc | quote }} diff --git a/incubator/moodle/values.yaml b/incubator/moodle/values.yaml index c5da89bfa..dce12964a 100644 --- a/incubator/moodle/values.yaml +++ b/incubator/moodle/values.yaml @@ -1,32 +1,31 @@ -## Bitnami moodle image version +## Bitnami Moodle` image version ## ref: https://hub.docker.com/r/bitnami/moodle/tags/ ## image: bitnami/moodle:3.2.1-r3 ## 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: IfNotPresent ## User of the application -## ref: https://github.com/bitnami/bitnami-docker-moodle#environment-variables +## 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#environment-variables +## ref: https://github.com/bitnami/bitnami-docker-moodle#configuration +## # moodlePassword: ## Admin email -## ref: https://github.com/bitnami/bitnami-docker-moodle#environment-variables -## +## 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 -## +## ref: https://github.com/bitnami/bitnami-docker-moodle/#smtp-configuration # smtpHost: # smtpPort: # smtpUser: @@ -39,14 +38,18 @@ moodleEmail: user@example.com mariadb: ## MariaDB admin password ## ref: https://github.com/bitnami/bitnami-docker-mariadb/blob/master/README.md#setting-the-root-password-on-first-run - ## mariadbRootPassword: secretpassword + ## + # mariadbRootPassword: ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## persistence: enabled: true - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: generic accessMode: ReadWriteOnce size: 8Gi @@ -61,11 +64,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: generic accessMode: ReadWriteOnce size: 1Gi moodle: - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: generic accessMode: ReadWriteOnce size: 8Gi