From 9bd1189f8b8df3ee1092b2717ea9f1ddc8e1132a Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Fri, 24 Feb 2017 16:51:58 +0530 Subject: [PATCH] moodle: chart has been accepted into kubernetes/charts repo --- README.md | 2 +- incubator/moodle/.helmignore | 1 - incubator/moodle/Chart.yaml | 15 ---- incubator/moodle/README.md | 100 --------------------- incubator/moodle/requirements.lock | 9 -- incubator/moodle/requirements.yaml | 4 - incubator/moodle/templates/NOTES.txt | 29 ------ incubator/moodle/templates/_helpers.tpl | 24 ----- incubator/moodle/templates/apache-pvc.yaml | 23 ----- incubator/moodle/templates/deployment.yaml | 90 ------------------- incubator/moodle/templates/moodle-pvc.yaml | 23 ----- incubator/moodle/templates/secrets.yaml | 17 ---- incubator/moodle/templates/svc.yaml | 20 ----- incubator/moodle/values.yaml | 87 ------------------ 14 files changed, 1 insertion(+), 443 deletions(-) delete mode 100644 incubator/moodle/.helmignore delete mode 100644 incubator/moodle/Chart.yaml delete mode 100644 incubator/moodle/README.md delete mode 100644 incubator/moodle/requirements.lock delete mode 100644 incubator/moodle/requirements.yaml delete mode 100644 incubator/moodle/templates/NOTES.txt delete mode 100644 incubator/moodle/templates/_helpers.tpl delete mode 100644 incubator/moodle/templates/apache-pvc.yaml delete mode 100644 incubator/moodle/templates/deployment.yaml delete mode 100644 incubator/moodle/templates/moodle-pvc.yaml delete mode 100644 incubator/moodle/templates/secrets.yaml delete mode 100644 incubator/moodle/templates/svc.yaml delete mode 100644 incubator/moodle/values.yaml diff --git a/README.md b/README.md index e48294120..54ceef605 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Popular applications, provided by [Bitnami](https://bitnami.com), ready to launc - [MediaWiki (stable)](https://github.com/kubernetes/charts/tree/master/stable/mediawiki) - [Memcached (incubator)](https://github.com/bitnami/charts/tree/master/incubator/memcached) - [MongoDB (stable)](https://github.com/kubernetes/charts/tree/master/stable/mongodb) -- [Moodle (incubator)](https://github.com/bitnami/charts/tree/master/incubator/moodle) +- [Moodle (stable)](https://github.com/kubernetes/charts/tree/master/stable/moodle) - [MySQL (incubator)](https://github.com/bitnami/charts/tree/master/incubator/mysql) - [nginx (incubator)](https://github.com/bitnami/charts/tree/master/incubator/nginx) - [NodeJS (incubator)](https://github.com/bitnami/charts/tree/master/incubator/node) diff --git a/incubator/moodle/.helmignore b/incubator/moodle/.helmignore deleted file mode 100644 index 6b8710a71..000000000 --- a/incubator/moodle/.helmignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/incubator/moodle/Chart.yaml b/incubator/moodle/Chart.yaml deleted file mode 100644 index 8af6828fc..000000000 --- a/incubator/moodle/Chart.yaml +++ /dev/null @@ -1,15 +0,0 @@ -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/incubator/moodle/README.md b/incubator/moodle/README.md deleted file mode 100644 index b12caeed3..000000000 --- a/incubator/moodle/README.md +++ /dev/null @@ -1,100 +0,0 @@ -# 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 . -``` - -## 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 ./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 | `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. - -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/incubator/moodle/requirements.lock b/incubator/moodle/requirements.lock deleted file mode 100644 index d499de062..000000000 --- a/incubator/moodle/requirements.lock +++ /dev/null @@ -1,9 +0,0 @@ -dependencies: -- condition: "" - enabled: false - name: mariadb - repository: https://kubernetes-charts.storage.googleapis.com/ - tags: null - version: 0.5.9 -digest: sha256:ffd85614e09ad85c32cff0ab8a60aaf8780c3aaa3c7c46d80548973818bf12d3 -generated: 2017-02-24T10:48:01.064141178+05:30 diff --git a/incubator/moodle/requirements.yaml b/incubator/moodle/requirements.yaml deleted file mode 100644 index 9303bd388..000000000 --- a/incubator/moodle/requirements.yaml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: -- name: mariadb - version: 0.5.x - repository: https://kubernetes-charts.storage.googleapis.com/ diff --git a/incubator/moodle/templates/NOTES.txt b/incubator/moodle/templates/NOTES.txt deleted file mode 100644 index 220c67d7c..000000000 --- a/incubator/moodle/templates/NOTES.txt +++ /dev/null @@ -1,29 +0,0 @@ - -** 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: $(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 deleted file mode 100644 index 3d76d82dd..000000000 --- a/incubator/moodle/templates/_helpers.tpl +++ /dev/null @@ -1,24 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "name" -}} -{{- 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). -*/}} -{{- define "fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- 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). -*/}} -{{- define "mariadb.fullname" -}} -{{- 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 deleted file mode 100644 index 166feb8b9..000000000 --- a/incubator/moodle/templates/apache-pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- 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: - {{- 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 }} - resources: - requests: - storage: {{ .Values.persistence.apache.size | quote }} -{{- end -}} diff --git a/incubator/moodle/templates/deployment.yaml b/incubator/moodle/templates/deployment.yaml deleted file mode 100644 index f66a41c52..000000000 --- a/incubator/moodle/templates/deployment.yaml +++ /dev/null @@ -1,90 +0,0 @@ -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/incubator/moodle/templates/moodle-pvc.yaml b/incubator/moodle/templates/moodle-pvc.yaml deleted file mode 100644 index 493dafaf7..000000000 --- a/incubator/moodle/templates/moodle-pvc.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- 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: - {{- 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 }} - resources: - requests: - storage: {{ .Values.persistence.moodle.size | quote }} -{{- end -}} diff --git a/incubator/moodle/templates/secrets.yaml b/incubator/moodle/templates/secrets.yaml deleted file mode 100644 index 2f5602270..000000000 --- a/incubator/moodle/templates/secrets.yaml +++ /dev/null @@ -1,17 +0,0 @@ -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/incubator/moodle/templates/svc.yaml b/incubator/moodle/templates/svc.yaml deleted file mode 100644 index 6736e0476..000000000 --- a/incubator/moodle/templates/svc.yaml +++ /dev/null @@ -1,20 +0,0 @@ -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/incubator/moodle/values.yaml b/incubator/moodle/values.yaml deleted file mode 100644 index dce12964a..000000000 --- a/incubator/moodle/values.yaml +++ /dev/null @@ -1,87 +0,0 @@ -## 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#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 - ## If defined, volume.beta.kubernetes.io/storage-class: - ## Default: volume.alpha.kubernetes.io/storage-class: default - ## - # 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: - ## If defined, volume.beta.kubernetes.io/storage-class: - ## Default: volume.alpha.kubernetes.io/storage-class: default - ## - # storageClass: generic - accessMode: ReadWriteOnce - size: 1Gi - moodle: - ## If defined, volume.beta.kubernetes.io/storage-class: - ## Default: volume.alpha.kubernetes.io/storage-class: default - ## - # 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