From 6c17edcce90b982dea56e6c76754796c5114c603 Mon Sep 17 00:00:00 2001 From: amirgabay Date: Tue, 16 Jan 2018 14:00:41 +0200 Subject: [PATCH 1/3] adding helm chart for demochat --- demochatChart/.helmignore | 21 +++++ demochatChart/Chart.yaml | 4 + demochatChart/app.rc.yaml | 61 ++++++++++++++ demochatChart/charts/mongodb/.helmignore | 1 + demochatChart/charts/mongodb/Chart.yaml | 16 ++++ demochatChart/charts/mongodb/README.md | 84 +++++++++++++++++++ .../charts/mongodb/templates/NOTES.txt | 7 ++ .../charts/mongodb/templates/_helpers.tpl | 16 ++++ .../charts/mongodb/templates/deployment.yaml | 66 +++++++++++++++ .../charts/mongodb/templates/pvc.yaml | 19 +++++ .../charts/mongodb/templates/secrets.yaml | 13 +++ .../charts/mongodb/templates/svc.yaml | 17 ++++ demochatChart/charts/mongodb/values.yaml | 49 +++++++++++ demochatChart/requirements.yaml | 4 + demochatChart/templates/_helpers.tpl | 21 +++++ demochatChart/templates/configMap.yaml | 9 ++ demochatChart/templates/deployment.yaml | 32 +++++++ demochatChart/templates/secrets.yaml | 0 demochatChart/templates/service.yaml | 22 +++++ demochatChart/values.yaml | 20 +++++ 20 files changed, 482 insertions(+) create mode 100644 demochatChart/.helmignore create mode 100644 demochatChart/Chart.yaml create mode 100644 demochatChart/app.rc.yaml create mode 100644 demochatChart/charts/mongodb/.helmignore create mode 100644 demochatChart/charts/mongodb/Chart.yaml create mode 100644 demochatChart/charts/mongodb/README.md create mode 100644 demochatChart/charts/mongodb/templates/NOTES.txt create mode 100644 demochatChart/charts/mongodb/templates/_helpers.tpl create mode 100644 demochatChart/charts/mongodb/templates/deployment.yaml create mode 100644 demochatChart/charts/mongodb/templates/pvc.yaml create mode 100644 demochatChart/charts/mongodb/templates/secrets.yaml create mode 100644 demochatChart/charts/mongodb/templates/svc.yaml create mode 100644 demochatChart/charts/mongodb/values.yaml create mode 100644 demochatChart/requirements.yaml create mode 100644 demochatChart/templates/_helpers.tpl create mode 100644 demochatChart/templates/configMap.yaml create mode 100644 demochatChart/templates/deployment.yaml create mode 100644 demochatChart/templates/secrets.yaml create mode 100644 demochatChart/templates/service.yaml create mode 100644 demochatChart/values.yaml diff --git a/demochatChart/.helmignore b/demochatChart/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/demochatChart/.helmignore @@ -0,0 +1,21 @@ +# 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 diff --git a/demochatChart/Chart.yaml b/demochatChart/Chart.yaml new file mode 100644 index 000000000..4c8200b9a --- /dev/null +++ b/demochatChart/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: demochat +name: demochat +version: 0.0.2 diff --git a/demochatChart/app.rc.yaml b/demochatChart/app.rc.yaml new file mode 100644 index 000000000..921ebbe15 --- /dev/null +++ b/demochatChart/app.rc.yaml @@ -0,0 +1,61 @@ +apiVersion: extensions/v1beta1 +kind: deployment +metadata: + name: mattermost-app +spec: + replicas: 1 + selector: + app: mattermost-app + template: + metadata: + labels: + app: mattermost-app + spec: + containers: + - name: app + image: redspreadapps/mattermost-app:1 + imagePullPolicy: Always + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: pgauth + mountPath: /etc/pgsecrets + # Uncomment this for production use + # + # - name: assets + # mountPath: /mattermost/data + ports: + - containerPort: 80 + protocol: TCP + - name: postgres + image: redspreadapps/mattermost-db:1 + imagePullPolicy: Always + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: pgauth + mountPath: /etc/secrets + # Uncomment this for production use + # - name: postgres + # mountPath: /var/lib/postgresql/data + env: + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: pgauth + secret: + secretName: postgres-creds + # Google Cloud Platform Persistent Volume Disk + # - name: assets + # gcePersistentDisk: + # pdName: mattermost-assets + # fsType: "ext4" + # + # - name: postgres + # gcePersistentDisk: + # pdName: mattermost-postgres + # fsType: "ext4" + restartPolicy: Always diff --git a/demochatChart/charts/mongodb/.helmignore b/demochatChart/charts/mongodb/.helmignore new file mode 100644 index 000000000..6b8710a71 --- /dev/null +++ b/demochatChart/charts/mongodb/.helmignore @@ -0,0 +1 @@ +.git diff --git a/demochatChart/charts/mongodb/Chart.yaml b/demochatChart/charts/mongodb/Chart.yaml new file mode 100644 index 000000000..c0d9e96ab --- /dev/null +++ b/demochatChart/charts/mongodb/Chart.yaml @@ -0,0 +1,16 @@ +name: mongodb +version: 0.4.18 +appVersion: 3.4.10 +description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. +keywords: +- mongodb +- database +- nosql +home: https://mongodb.org +icon: https://bitnami.com/assets/stacks/mongodb/img/mongodb-stack-220x234.png +sources: +- https://github.com/bitnami/bitnami-docker-mongodb +maintainers: +- name: Bitnami + email: containers@bitnami.com +engine: gotpl diff --git a/demochatChart/charts/mongodb/README.md b/demochatChart/charts/mongodb/README.md new file mode 100644 index 000000000..bac5168a3 --- /dev/null +++ b/demochatChart/charts/mongodb/README.md @@ -0,0 +1,84 @@ +# MongoDB + +[MongoDB](https://www.mongodb.com/) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster. + +## TL;DR; + +```bash +$ helm install stable/mongodb +``` + +## Introduction + +This chart bootstraps a [MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## 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`: + +```bash +$ helm install --name my-release stable/mongodb +``` + +The command deploys MongoDB 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: + +```bash +$ 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 MongoDB chart and their default values. + +| Parameter | Description | Default | +|----------------------------|-------------------------------------|----------------------------------------------------------| +| `image` | MongoDB image | `bitnami/mongodb:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent`. | +| `mongodbRootPassword` | MongoDB admin password | `nil` | +| `mongodbUsername` | MongoDB custom user | `nil` | +| `mongodbPassword` | MongoDB custom user password | `nil` | +| `mongodbDatabase` | Database to create | `nil` | +| `serviceType` | Kubernetes Service type | `ClusterIP` | +| `persistence.enabled` | Use a PVC to persist data | `true` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | + +The above parameters map to the env variables defined in [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb). For more information please refer to the [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb) image documentation. + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```bash +$ helm install --name my-release \ + --set mongodbRootPassword=secretpassword,mongodbUsername=my-user,mongodbPassword=my-password,mongodbDatabase=my-database \ + stable/mongodb +``` + +The above command sets the MongoDB `root` account password to `secretpassword`. Additionally it creates a standard database user named `my-user`, with the password `my-password`, who has access to a database named `my-database`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```bash +$ helm install --name my-release -f values.yaml stable/mongodb +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +## Persistence + +The [Bitnami MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) image stores the MongoDB data and configurations at the `/bitnami/mongodb` path of the container. + +The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. diff --git a/demochatChart/charts/mongodb/templates/NOTES.txt b/demochatChart/charts/mongodb/templates/NOTES.txt new file mode 100644 index 000000000..24c5d200b --- /dev/null +++ b/demochatChart/charts/mongodb/templates/NOTES.txt @@ -0,0 +1,7 @@ +MongoDB can be accessed via port 27017 on the following DNS name from within your cluster: +{{ template "mongodb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + +To connect to your database run the following command: + + kubectl run {{ template "mongodb.fullname" . }}-client --rm --tty -i --image bitnami/mongodb --command -- mongo --host {{ template "mongodb.fullname" . }} {{- if .Values.mongodbRootPassword }} -p {{ .Values.mongodbRootPassword }}{{- end -}} + diff --git a/demochatChart/charts/mongodb/templates/_helpers.tpl b/demochatChart/charts/mongodb/templates/_helpers.tpl new file mode 100644 index 000000000..ad4a3f5ef --- /dev/null +++ b/demochatChart/charts/mongodb/templates/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "mongodb.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "mongodb.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/demochatChart/charts/mongodb/templates/deployment.yaml b/demochatChart/charts/mongodb/templates/deployment.yaml new file mode 100644 index 000000000..55901ecd7 --- /dev/null +++ b/demochatChart/charts/mongodb/templates/deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + template: + metadata: + labels: + app: {{ template "mongodb.fullname" . }} + spec: + containers: + - name: {{ template "mongodb.fullname" . }} + image: "{{ .Values.image }}" + imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} + env: + - name: MONGODB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "mongodb.fullname" . }} + key: mongodb-root-password + - name: MONGODB_USERNAME + value: {{ default "" .Values.mongodbUsername | quote }} + - name: MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "mongodb.fullname" . }} + key: mongodb-password + - name: MONGODB_DATABASE + value: {{ default "" .Values.mongodbDatabase | quote }} + ports: + - name: mongodb + containerPort: 27017 + livenessProbe: + exec: + command: + - mongo + - --eval + - "db.adminCommand('ping')" + initialDelaySeconds: 30 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - mongo + - --eval + - "db.adminCommand('ping')" + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: data + mountPath: /bitnami/mongodb + resources: +{{ toYaml .Values.resources | indent 10 }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "mongodb.fullname" . }} + {{- else }} + emptyDir: {} + {{- end -}} diff --git a/demochatChart/charts/mongodb/templates/pvc.yaml b/demochatChart/charts/mongodb/templates/pvc.yaml new file mode 100644 index 000000000..f53516f90 --- /dev/null +++ b/demochatChart/charts/mongodb/templates/pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "mongodb.fullname" . }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/demochatChart/charts/mongodb/templates/secrets.yaml b/demochatChart/charts/mongodb/templates/secrets.yaml new file mode 100644 index 000000000..d95e7a451 --- /dev/null +++ b/demochatChart/charts/mongodb/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + mongodb-root-password: {{ default "" .Values.mongodbRootPassword | b64enc | quote }} + mongodb-password: {{ default "" .Values.mongodbPassword | b64enc | quote }} diff --git a/demochatChart/charts/mongodb/templates/svc.yaml b/demochatChart/charts/mongodb/templates/svc.yaml new file mode 100644 index 000000000..6c58b54c5 --- /dev/null +++ b/demochatChart/charts/mongodb/templates/svc.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + type: {{ .Values.serviceType }} + ports: + - name: mongodb + port: 27017 + targetPort: mongodb + selector: + app: {{ template "mongodb.fullname" . }} diff --git a/demochatChart/charts/mongodb/values.yaml b/demochatChart/charts/mongodb/values.yaml new file mode 100644 index 000000000..e0acd16c7 --- /dev/null +++ b/demochatChart/charts/mongodb/values.yaml @@ -0,0 +1,49 @@ +## Bitnami MongoDB image version +## ref: https://hub.docker.com/r/bitnami/mongodb/tags/ +## +image: bitnami/mongodb:3.4.10-r0 + +## Specify a imagePullPolicy +## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' +## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images +## +# imagePullPolicy: + +## MongoDB admin password +## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run +## +# mongodbRootPassword: + +## MongoDB custom user and database +## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#creating-a-user-and-database-on-first-run +## +# mongodbUsername: +# mongodbPassword: +# mongodbDatabase: + +## Kubernetes service type +serviceType: ClusterIP + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + enabled: false + ## mongodb data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + requests: + memory: 256Mi + cpu: 100m diff --git a/demochatChart/requirements.yaml b/demochatChart/requirements.yaml new file mode 100644 index 000000000..32855b0cd --- /dev/null +++ b/demochatChart/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: mongodb + version: 0.4.18 + repository: mongodb diff --git a/demochatChart/templates/_helpers.tpl b/demochatChart/templates/_helpers.tpl new file mode 100644 index 000000000..2aea674f2 --- /dev/null +++ b/demochatChart/templates/_helpers.tpl @@ -0,0 +1,21 @@ +{{/* 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 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{/* KUBECON_DEMOCHAT_SERVICE_HOST */}} +{{- define "demochat" -}} +{{- $service :=default .Release.Name -}} +{{- printf "%s_DEMOCHAT_SERVICE_HOST" .Release.Namespace| upper -}} +{{- end -}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/demochatChart/templates/configMap.yaml b/demochatChart/templates/configMap.yaml new file mode 100644 index 000000000..b1ee53f35 --- /dev/null +++ b/demochatChart/templates/configMap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{.Release.Name }}-config + namespace: default +data: + sha: "{{ .Values.commit.sha }}" + branch: "{{ .Values.commit.branch }}" + repo: "{{ .Values.commit.repo }}" diff --git a/demochatChart/templates/deployment.yaml b/demochatChart/templates/deployment.yaml new file mode 100644 index 000000000..92c4326fe --- /dev/null +++ b/demochatChart/templates/deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + commit: {{ .Values.commit.sha }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ template "name" . }} + release: {{ .Release.Name }} + appversion: "{{.Values.appversion}}" + spec: + containers: + - image: {{.Values.image.repository}}:{{.Values.image.tag}} + name: app + imagePullPolicy: Always + env: + - name : MONGO_HELM + value: {{.Release.Name }}-mongodb + ports: + - containerPort: {{ .Values.service.internalPort }} + resources: {} + strategy: + type: Recreate + diff --git a/demochatChart/templates/secrets.yaml b/demochatChart/templates/secrets.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/demochatChart/templates/service.yaml b/demochatChart/templates/service.yaml new file mode 100644 index 000000000..1ce3ab949 --- /dev/null +++ b/demochatChart/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-{{ .Values.service.name}} + labels: + app: {{ template "name" . }} + #chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + #release: {{ .Release.Name }} + #heritage: {{ .Release.Service }} + #sha: {{ .Values.commit.sha }} + #branch: "{{ .Values.commit.branch }}" + #repo: "{{ .Values.commit.repo }}" +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + protocol: TCP + name: {{ .Values.service.name }} + selector: + app: {{ template "name" . }} + release: {{ .Release.Name }} diff --git a/demochatChart/values.yaml b/demochatChart/values.yaml new file mode 100644 index 000000000..6f6023d63 --- /dev/null +++ b/demochatChart/values.yaml @@ -0,0 +1,20 @@ +# Default values for demoservice1. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +replicaCount: 1 +chartVersion: "0.0.2" +appversion: 10 +build : "1" +image: + repository: containers101/demochat + tag: master + pullPolicy: Always +service: + name: demochat + type: LoadBalancer + externalPort: 80 + internalPort: 5000 +commit: + sha: "i1234" + branch: "master" + repo : "verchol/demochat" From f0df961d5999c3f1fc88ae781e359d45e319befc Mon Sep 17 00:00:00 2001 From: amir-codefresh Date: Wed, 17 Jan 2018 12:13:31 +0200 Subject: [PATCH 2/3] restructure charts folder --- deploy/demochat/.helmignore | 21 +++++ deploy/demochat/Chart.yaml | 4 + deploy/demochat/app.rc.yaml | 61 ++++++++++++++ deploy/demochat/charts/mongodb/.helmignore | 1 + deploy/demochat/charts/mongodb/Chart.yaml | 16 ++++ deploy/demochat/charts/mongodb/README.md | 84 +++++++++++++++++++ .../charts/mongodb/templates/NOTES.txt | 7 ++ .../charts/mongodb/templates/_helpers.tpl | 16 ++++ .../charts/mongodb/templates/deployment.yaml | 66 +++++++++++++++ .../charts/mongodb/templates/pvc.yaml | 19 +++++ .../charts/mongodb/templates/secrets.yaml | 13 +++ .../charts/mongodb/templates/svc.yaml | 17 ++++ deploy/demochat/charts/mongodb/values.yaml | 49 +++++++++++ deploy/demochat/requirements.yaml | 4 + deploy/demochat/templates/_helpers.tpl | 21 +++++ deploy/demochat/templates/configMap.yaml | 9 ++ deploy/demochat/templates/deployment.yaml | 32 +++++++ deploy/demochat/templates/secrets.yaml | 0 deploy/demochat/templates/service.yaml | 22 +++++ deploy/demochat/values.yaml | 20 +++++ 20 files changed, 482 insertions(+) create mode 100644 deploy/demochat/.helmignore create mode 100644 deploy/demochat/Chart.yaml create mode 100644 deploy/demochat/app.rc.yaml create mode 100644 deploy/demochat/charts/mongodb/.helmignore create mode 100644 deploy/demochat/charts/mongodb/Chart.yaml create mode 100644 deploy/demochat/charts/mongodb/README.md create mode 100644 deploy/demochat/charts/mongodb/templates/NOTES.txt create mode 100644 deploy/demochat/charts/mongodb/templates/_helpers.tpl create mode 100644 deploy/demochat/charts/mongodb/templates/deployment.yaml create mode 100644 deploy/demochat/charts/mongodb/templates/pvc.yaml create mode 100644 deploy/demochat/charts/mongodb/templates/secrets.yaml create mode 100644 deploy/demochat/charts/mongodb/templates/svc.yaml create mode 100644 deploy/demochat/charts/mongodb/values.yaml create mode 100644 deploy/demochat/requirements.yaml create mode 100644 deploy/demochat/templates/_helpers.tpl create mode 100644 deploy/demochat/templates/configMap.yaml create mode 100644 deploy/demochat/templates/deployment.yaml create mode 100644 deploy/demochat/templates/secrets.yaml create mode 100644 deploy/demochat/templates/service.yaml create mode 100644 deploy/demochat/values.yaml diff --git a/deploy/demochat/.helmignore b/deploy/demochat/.helmignore new file mode 100644 index 000000000..f0c131944 --- /dev/null +++ b/deploy/demochat/.helmignore @@ -0,0 +1,21 @@ +# 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 diff --git a/deploy/demochat/Chart.yaml b/deploy/demochat/Chart.yaml new file mode 100644 index 000000000..4c8200b9a --- /dev/null +++ b/deploy/demochat/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +description: demochat +name: demochat +version: 0.0.2 diff --git a/deploy/demochat/app.rc.yaml b/deploy/demochat/app.rc.yaml new file mode 100644 index 000000000..921ebbe15 --- /dev/null +++ b/deploy/demochat/app.rc.yaml @@ -0,0 +1,61 @@ +apiVersion: extensions/v1beta1 +kind: deployment +metadata: + name: mattermost-app +spec: + replicas: 1 + selector: + app: mattermost-app + template: + metadata: + labels: + app: mattermost-app + spec: + containers: + - name: app + image: redspreadapps/mattermost-app:1 + imagePullPolicy: Always + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: pgauth + mountPath: /etc/pgsecrets + # Uncomment this for production use + # + # - name: assets + # mountPath: /mattermost/data + ports: + - containerPort: 80 + protocol: TCP + - name: postgres + image: redspreadapps/mattermost-db:1 + imagePullPolicy: Always + volumeMounts: + - name: localtime + mountPath: /etc/localtime + - name: pgauth + mountPath: /etc/secrets + # Uncomment this for production use + # - name: postgres + # mountPath: /var/lib/postgresql/data + env: + - name: PGDATA + value: /var/lib/postgresql/data/pgdata + volumes: + - name: localtime + hostPath: + path: /etc/localtime + - name: pgauth + secret: + secretName: postgres-creds + # Google Cloud Platform Persistent Volume Disk + # - name: assets + # gcePersistentDisk: + # pdName: mattermost-assets + # fsType: "ext4" + # + # - name: postgres + # gcePersistentDisk: + # pdName: mattermost-postgres + # fsType: "ext4" + restartPolicy: Always diff --git a/deploy/demochat/charts/mongodb/.helmignore b/deploy/demochat/charts/mongodb/.helmignore new file mode 100644 index 000000000..6b8710a71 --- /dev/null +++ b/deploy/demochat/charts/mongodb/.helmignore @@ -0,0 +1 @@ +.git diff --git a/deploy/demochat/charts/mongodb/Chart.yaml b/deploy/demochat/charts/mongodb/Chart.yaml new file mode 100644 index 000000000..c0d9e96ab --- /dev/null +++ b/deploy/demochat/charts/mongodb/Chart.yaml @@ -0,0 +1,16 @@ +name: mongodb +version: 0.4.18 +appVersion: 3.4.10 +description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. +keywords: +- mongodb +- database +- nosql +home: https://mongodb.org +icon: https://bitnami.com/assets/stacks/mongodb/img/mongodb-stack-220x234.png +sources: +- https://github.com/bitnami/bitnami-docker-mongodb +maintainers: +- name: Bitnami + email: containers@bitnami.com +engine: gotpl diff --git a/deploy/demochat/charts/mongodb/README.md b/deploy/demochat/charts/mongodb/README.md new file mode 100644 index 000000000..bac5168a3 --- /dev/null +++ b/deploy/demochat/charts/mongodb/README.md @@ -0,0 +1,84 @@ +# MongoDB + +[MongoDB](https://www.mongodb.com/) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster. + +## TL;DR; + +```bash +$ helm install stable/mongodb +``` + +## Introduction + +This chart bootstraps a [MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## 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`: + +```bash +$ helm install --name my-release stable/mongodb +``` + +The command deploys MongoDB 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: + +```bash +$ 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 MongoDB chart and their default values. + +| Parameter | Description | Default | +|----------------------------|-------------------------------------|----------------------------------------------------------| +| `image` | MongoDB image | `bitnami/mongodb:{VERSION}` | +| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent`. | +| `mongodbRootPassword` | MongoDB admin password | `nil` | +| `mongodbUsername` | MongoDB custom user | `nil` | +| `mongodbPassword` | MongoDB custom user password | `nil` | +| `mongodbDatabase` | Database to create | `nil` | +| `serviceType` | Kubernetes Service type | `ClusterIP` | +| `persistence.enabled` | Use a PVC to persist data | `true` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | + +The above parameters map to the env variables defined in [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb). For more information please refer to the [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb) image documentation. + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```bash +$ helm install --name my-release \ + --set mongodbRootPassword=secretpassword,mongodbUsername=my-user,mongodbPassword=my-password,mongodbDatabase=my-database \ + stable/mongodb +``` + +The above command sets the MongoDB `root` account password to `secretpassword`. Additionally it creates a standard database user named `my-user`, with the password `my-password`, who has access to a database named `my-database`. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```bash +$ helm install --name my-release -f values.yaml stable/mongodb +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +## Persistence + +The [Bitnami MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) image stores the MongoDB data and configurations at the `/bitnami/mongodb` path of the container. + +The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. diff --git a/deploy/demochat/charts/mongodb/templates/NOTES.txt b/deploy/demochat/charts/mongodb/templates/NOTES.txt new file mode 100644 index 000000000..24c5d200b --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/NOTES.txt @@ -0,0 +1,7 @@ +MongoDB can be accessed via port 27017 on the following DNS name from within your cluster: +{{ template "mongodb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + +To connect to your database run the following command: + + kubectl run {{ template "mongodb.fullname" . }}-client --rm --tty -i --image bitnami/mongodb --command -- mongo --host {{ template "mongodb.fullname" . }} {{- if .Values.mongodbRootPassword }} -p {{ .Values.mongodbRootPassword }}{{- end -}} + diff --git a/deploy/demochat/charts/mongodb/templates/_helpers.tpl b/deploy/demochat/charts/mongodb/templates/_helpers.tpl new file mode 100644 index 000000000..ad4a3f5ef --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/_helpers.tpl @@ -0,0 +1,16 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "mongodb.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "mongodb.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/deploy/demochat/charts/mongodb/templates/deployment.yaml b/deploy/demochat/charts/mongodb/templates/deployment.yaml new file mode 100644 index 000000000..55901ecd7 --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + template: + metadata: + labels: + app: {{ template "mongodb.fullname" . }} + spec: + containers: + - name: {{ template "mongodb.fullname" . }} + image: "{{ .Values.image }}" + imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} + env: + - name: MONGODB_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "mongodb.fullname" . }} + key: mongodb-root-password + - name: MONGODB_USERNAME + value: {{ default "" .Values.mongodbUsername | quote }} + - name: MONGODB_PASSWORD + valueFrom: + secretKeyRef: + name: {{ template "mongodb.fullname" . }} + key: mongodb-password + - name: MONGODB_DATABASE + value: {{ default "" .Values.mongodbDatabase | quote }} + ports: + - name: mongodb + containerPort: 27017 + livenessProbe: + exec: + command: + - mongo + - --eval + - "db.adminCommand('ping')" + initialDelaySeconds: 30 + timeoutSeconds: 5 + readinessProbe: + exec: + command: + - mongo + - --eval + - "db.adminCommand('ping')" + initialDelaySeconds: 5 + timeoutSeconds: 1 + volumeMounts: + - name: data + mountPath: /bitnami/mongodb + resources: +{{ toYaml .Values.resources | indent 10 }} + volumes: + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ template "mongodb.fullname" . }} + {{- else }} + emptyDir: {} + {{- end -}} diff --git a/deploy/demochat/charts/mongodb/templates/pvc.yaml b/deploy/demochat/charts/mongodb/templates/pvc.yaml new file mode 100644 index 000000000..f53516f90 --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/pvc.yaml @@ -0,0 +1,19 @@ +{{- if .Values.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ template "mongodb.fullname" . }} +spec: + accessModes: + - {{ .Values.persistence.accessMode | quote }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} +{{- end }} diff --git a/deploy/demochat/charts/mongodb/templates/secrets.yaml b/deploy/demochat/charts/mongodb/templates/secrets.yaml new file mode 100644 index 000000000..d95e7a451 --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + mongodb-root-password: {{ default "" .Values.mongodbRootPassword | b64enc | quote }} + mongodb-password: {{ default "" .Values.mongodbPassword | b64enc | quote }} diff --git a/deploy/demochat/charts/mongodb/templates/svc.yaml b/deploy/demochat/charts/mongodb/templates/svc.yaml new file mode 100644 index 000000000..6c58b54c5 --- /dev/null +++ b/deploy/demochat/charts/mongodb/templates/svc.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "mongodb.fullname" . }} + labels: + app: {{ template "mongodb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + type: {{ .Values.serviceType }} + ports: + - name: mongodb + port: 27017 + targetPort: mongodb + selector: + app: {{ template "mongodb.fullname" . }} diff --git a/deploy/demochat/charts/mongodb/values.yaml b/deploy/demochat/charts/mongodb/values.yaml new file mode 100644 index 000000000..e0acd16c7 --- /dev/null +++ b/deploy/demochat/charts/mongodb/values.yaml @@ -0,0 +1,49 @@ +## Bitnami MongoDB image version +## ref: https://hub.docker.com/r/bitnami/mongodb/tags/ +## +image: bitnami/mongodb:3.4.10-r0 + +## Specify a imagePullPolicy +## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' +## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images +## +# imagePullPolicy: + +## MongoDB admin password +## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run +## +# mongodbRootPassword: + +## MongoDB custom user and database +## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#creating-a-user-and-database-on-first-run +## +# mongodbUsername: +# mongodbPassword: +# mongodbDatabase: + +## Kubernetes service type +serviceType: ClusterIP + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + enabled: false + ## mongodb data Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + accessMode: ReadWriteOnce + size: 8Gi + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: + requests: + memory: 256Mi + cpu: 100m diff --git a/deploy/demochat/requirements.yaml b/deploy/demochat/requirements.yaml new file mode 100644 index 000000000..32855b0cd --- /dev/null +++ b/deploy/demochat/requirements.yaml @@ -0,0 +1,4 @@ +dependencies: + - name: mongodb + version: 0.4.18 + repository: mongodb diff --git a/deploy/demochat/templates/_helpers.tpl b/deploy/demochat/templates/_helpers.tpl new file mode 100644 index 000000000..2aea674f2 --- /dev/null +++ b/deploy/demochat/templates/_helpers.tpl @@ -0,0 +1,21 @@ +{{/* 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 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{/* KUBECON_DEMOCHAT_SERVICE_HOST */}} +{{- define "demochat" -}} +{{- $service :=default .Release.Name -}} +{{- printf "%s_DEMOCHAT_SERVICE_HOST" .Release.Namespace| upper -}} +{{- end -}} +{{- define "fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} diff --git a/deploy/demochat/templates/configMap.yaml b/deploy/demochat/templates/configMap.yaml new file mode 100644 index 000000000..b1ee53f35 --- /dev/null +++ b/deploy/demochat/templates/configMap.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{.Release.Name }}-config + namespace: default +data: + sha: "{{ .Values.commit.sha }}" + branch: "{{ .Values.commit.branch }}" + repo: "{{ .Values.commit.repo }}" diff --git a/deploy/demochat/templates/deployment.yaml b/deploy/demochat/templates/deployment.yaml new file mode 100644 index 000000000..92c4326fe --- /dev/null +++ b/deploy/demochat/templates/deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} + commit: {{ .Values.commit.sha }} +spec: + replicas: {{ .Values.replicaCount }} + template: + metadata: + labels: + app: {{ template "name" . }} + release: {{ .Release.Name }} + appversion: "{{.Values.appversion}}" + spec: + containers: + - image: {{.Values.image.repository}}:{{.Values.image.tag}} + name: app + imagePullPolicy: Always + env: + - name : MONGO_HELM + value: {{.Release.Name }}-mongodb + ports: + - containerPort: {{ .Values.service.internalPort }} + resources: {} + strategy: + type: Recreate + diff --git a/deploy/demochat/templates/secrets.yaml b/deploy/demochat/templates/secrets.yaml new file mode 100644 index 000000000..e69de29bb diff --git a/deploy/demochat/templates/service.yaml b/deploy/demochat/templates/service.yaml new file mode 100644 index 000000000..1ce3ab949 --- /dev/null +++ b/deploy/demochat/templates/service.yaml @@ -0,0 +1,22 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-{{ .Values.service.name}} + labels: + app: {{ template "name" . }} + #chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + #release: {{ .Release.Name }} + #heritage: {{ .Release.Service }} + #sha: {{ .Values.commit.sha }} + #branch: "{{ .Values.commit.branch }}" + #repo: "{{ .Values.commit.repo }}" +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.externalPort }} + targetPort: {{ .Values.service.internalPort }} + protocol: TCP + name: {{ .Values.service.name }} + selector: + app: {{ template "name" . }} + release: {{ .Release.Name }} diff --git a/deploy/demochat/values.yaml b/deploy/demochat/values.yaml new file mode 100644 index 000000000..6f6023d63 --- /dev/null +++ b/deploy/demochat/values.yaml @@ -0,0 +1,20 @@ +# Default values for demoservice1. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +replicaCount: 1 +chartVersion: "0.0.2" +appversion: 10 +build : "1" +image: + repository: containers101/demochat + tag: master + pullPolicy: Always +service: + name: demochat + type: LoadBalancer + externalPort: 80 + internalPort: 5000 +commit: + sha: "i1234" + branch: "master" + repo : "verchol/demochat" From 03ce60314de8a000c924600b2d5e38675cc0fb40 Mon Sep 17 00:00:00 2001 From: amirgabay Date: Wed, 17 Jan 2018 12:19:53 +0200 Subject: [PATCH 3/3] remove old chart folder --- demochatChart/.helmignore | 21 ----- demochatChart/Chart.yaml | 4 - demochatChart/app.rc.yaml | 61 -------------- demochatChart/charts/mongodb/.helmignore | 1 - demochatChart/charts/mongodb/Chart.yaml | 16 ---- demochatChart/charts/mongodb/README.md | 84 ------------------- .../charts/mongodb/templates/NOTES.txt | 7 -- .../charts/mongodb/templates/_helpers.tpl | 16 ---- .../charts/mongodb/templates/deployment.yaml | 66 --------------- .../charts/mongodb/templates/pvc.yaml | 19 ----- .../charts/mongodb/templates/secrets.yaml | 13 --- .../charts/mongodb/templates/svc.yaml | 17 ---- demochatChart/charts/mongodb/values.yaml | 49 ----------- demochatChart/requirements.yaml | 4 - demochatChart/templates/_helpers.tpl | 21 ----- demochatChart/templates/configMap.yaml | 9 -- demochatChart/templates/deployment.yaml | 32 ------- demochatChart/templates/secrets.yaml | 0 demochatChart/templates/service.yaml | 22 ----- demochatChart/values.yaml | 20 ----- 20 files changed, 482 deletions(-) delete mode 100644 demochatChart/.helmignore delete mode 100644 demochatChart/Chart.yaml delete mode 100644 demochatChart/app.rc.yaml delete mode 100644 demochatChart/charts/mongodb/.helmignore delete mode 100644 demochatChart/charts/mongodb/Chart.yaml delete mode 100644 demochatChart/charts/mongodb/README.md delete mode 100644 demochatChart/charts/mongodb/templates/NOTES.txt delete mode 100644 demochatChart/charts/mongodb/templates/_helpers.tpl delete mode 100644 demochatChart/charts/mongodb/templates/deployment.yaml delete mode 100644 demochatChart/charts/mongodb/templates/pvc.yaml delete mode 100644 demochatChart/charts/mongodb/templates/secrets.yaml delete mode 100644 demochatChart/charts/mongodb/templates/svc.yaml delete mode 100644 demochatChart/charts/mongodb/values.yaml delete mode 100644 demochatChart/requirements.yaml delete mode 100644 demochatChart/templates/_helpers.tpl delete mode 100644 demochatChart/templates/configMap.yaml delete mode 100644 demochatChart/templates/deployment.yaml delete mode 100644 demochatChart/templates/secrets.yaml delete mode 100644 demochatChart/templates/service.yaml delete mode 100644 demochatChart/values.yaml diff --git a/demochatChart/.helmignore b/demochatChart/.helmignore deleted file mode 100644 index f0c131944..000000000 --- a/demochatChart/.helmignore +++ /dev/null @@ -1,21 +0,0 @@ -# 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 diff --git a/demochatChart/Chart.yaml b/demochatChart/Chart.yaml deleted file mode 100644 index 4c8200b9a..000000000 --- a/demochatChart/Chart.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -description: demochat -name: demochat -version: 0.0.2 diff --git a/demochatChart/app.rc.yaml b/demochatChart/app.rc.yaml deleted file mode 100644 index 921ebbe15..000000000 --- a/demochatChart/app.rc.yaml +++ /dev/null @@ -1,61 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: deployment -metadata: - name: mattermost-app -spec: - replicas: 1 - selector: - app: mattermost-app - template: - metadata: - labels: - app: mattermost-app - spec: - containers: - - name: app - image: redspreadapps/mattermost-app:1 - imagePullPolicy: Always - volumeMounts: - - name: localtime - mountPath: /etc/localtime - - name: pgauth - mountPath: /etc/pgsecrets - # Uncomment this for production use - # - # - name: assets - # mountPath: /mattermost/data - ports: - - containerPort: 80 - protocol: TCP - - name: postgres - image: redspreadapps/mattermost-db:1 - imagePullPolicy: Always - volumeMounts: - - name: localtime - mountPath: /etc/localtime - - name: pgauth - mountPath: /etc/secrets - # Uncomment this for production use - # - name: postgres - # mountPath: /var/lib/postgresql/data - env: - - name: PGDATA - value: /var/lib/postgresql/data/pgdata - volumes: - - name: localtime - hostPath: - path: /etc/localtime - - name: pgauth - secret: - secretName: postgres-creds - # Google Cloud Platform Persistent Volume Disk - # - name: assets - # gcePersistentDisk: - # pdName: mattermost-assets - # fsType: "ext4" - # - # - name: postgres - # gcePersistentDisk: - # pdName: mattermost-postgres - # fsType: "ext4" - restartPolicy: Always diff --git a/demochatChart/charts/mongodb/.helmignore b/demochatChart/charts/mongodb/.helmignore deleted file mode 100644 index 6b8710a71..000000000 --- a/demochatChart/charts/mongodb/.helmignore +++ /dev/null @@ -1 +0,0 @@ -.git diff --git a/demochatChart/charts/mongodb/Chart.yaml b/demochatChart/charts/mongodb/Chart.yaml deleted file mode 100644 index c0d9e96ab..000000000 --- a/demochatChart/charts/mongodb/Chart.yaml +++ /dev/null @@ -1,16 +0,0 @@ -name: mongodb -version: 0.4.18 -appVersion: 3.4.10 -description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. -keywords: -- mongodb -- database -- nosql -home: https://mongodb.org -icon: https://bitnami.com/assets/stacks/mongodb/img/mongodb-stack-220x234.png -sources: -- https://github.com/bitnami/bitnami-docker-mongodb -maintainers: -- name: Bitnami - email: containers@bitnami.com -engine: gotpl diff --git a/demochatChart/charts/mongodb/README.md b/demochatChart/charts/mongodb/README.md deleted file mode 100644 index bac5168a3..000000000 --- a/demochatChart/charts/mongodb/README.md +++ /dev/null @@ -1,84 +0,0 @@ -# MongoDB - -[MongoDB](https://www.mongodb.com/) is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas, making the integration of data in certain types of applications easier and faster. - -## TL;DR; - -```bash -$ helm install stable/mongodb -``` - -## Introduction - -This chart bootstraps a [MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. - -## 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`: - -```bash -$ helm install --name my-release stable/mongodb -``` - -The command deploys MongoDB 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: - -```bash -$ 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 MongoDB chart and their default values. - -| Parameter | Description | Default | -|----------------------------|-------------------------------------|----------------------------------------------------------| -| `image` | MongoDB image | `bitnami/mongodb:{VERSION}` | -| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent`. | -| `mongodbRootPassword` | MongoDB admin password | `nil` | -| `mongodbUsername` | MongoDB custom user | `nil` | -| `mongodbPassword` | MongoDB custom user password | `nil` | -| `mongodbDatabase` | Database to create | `nil` | -| `serviceType` | Kubernetes Service type | `ClusterIP` | -| `persistence.enabled` | Use a PVC to persist data | `true` | -| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | -| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | -| `persistence.size` | Size of data volume | `8Gi` | - -The above parameters map to the env variables defined in [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb). For more information please refer to the [bitnami/mongodb](http://github.com/bitnami/bitnami-docker-mongodb) image documentation. - -Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, - -```bash -$ helm install --name my-release \ - --set mongodbRootPassword=secretpassword,mongodbUsername=my-user,mongodbPassword=my-password,mongodbDatabase=my-database \ - stable/mongodb -``` - -The above command sets the MongoDB `root` account password to `secretpassword`. Additionally it creates a standard database user named `my-user`, with the password `my-password`, who has access to a database named `my-database`. - -Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, - -```bash -$ helm install --name my-release -f values.yaml stable/mongodb -``` - -> **Tip**: You can use the default [values.yaml](values.yaml) - -## Persistence - -The [Bitnami MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) image stores the MongoDB data and configurations at the `/bitnami/mongodb` path of the container. - -The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) volume at this location. The volume is created using dynamic volume provisioning. diff --git a/demochatChart/charts/mongodb/templates/NOTES.txt b/demochatChart/charts/mongodb/templates/NOTES.txt deleted file mode 100644 index 24c5d200b..000000000 --- a/demochatChart/charts/mongodb/templates/NOTES.txt +++ /dev/null @@ -1,7 +0,0 @@ -MongoDB can be accessed via port 27017 on the following DNS name from within your cluster: -{{ template "mongodb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local - -To connect to your database run the following command: - - kubectl run {{ template "mongodb.fullname" . }}-client --rm --tty -i --image bitnami/mongodb --command -- mongo --host {{ template "mongodb.fullname" . }} {{- if .Values.mongodbRootPassword }} -p {{ .Values.mongodbRootPassword }}{{- end -}} - diff --git a/demochatChart/charts/mongodb/templates/_helpers.tpl b/demochatChart/charts/mongodb/templates/_helpers.tpl deleted file mode 100644 index ad4a3f5ef..000000000 --- a/demochatChart/charts/mongodb/templates/_helpers.tpl +++ /dev/null @@ -1,16 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "mongodb.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "mongodb.fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/demochatChart/charts/mongodb/templates/deployment.yaml b/demochatChart/charts/mongodb/templates/deployment.yaml deleted file mode 100644 index 55901ecd7..000000000 --- a/demochatChart/charts/mongodb/templates/deployment.yaml +++ /dev/null @@ -1,66 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "mongodb.fullname" . }} - labels: - app: {{ template "mongodb.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - template: - metadata: - labels: - app: {{ template "mongodb.fullname" . }} - spec: - containers: - - name: {{ template "mongodb.fullname" . }} - image: "{{ .Values.image }}" - imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }} - env: - - name: MONGODB_ROOT_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "mongodb.fullname" . }} - key: mongodb-root-password - - name: MONGODB_USERNAME - value: {{ default "" .Values.mongodbUsername | quote }} - - name: MONGODB_PASSWORD - valueFrom: - secretKeyRef: - name: {{ template "mongodb.fullname" . }} - key: mongodb-password - - name: MONGODB_DATABASE - value: {{ default "" .Values.mongodbDatabase | quote }} - ports: - - name: mongodb - containerPort: 27017 - livenessProbe: - exec: - command: - - mongo - - --eval - - "db.adminCommand('ping')" - initialDelaySeconds: 30 - timeoutSeconds: 5 - readinessProbe: - exec: - command: - - mongo - - --eval - - "db.adminCommand('ping')" - initialDelaySeconds: 5 - timeoutSeconds: 1 - volumeMounts: - - name: data - mountPath: /bitnami/mongodb - resources: -{{ toYaml .Values.resources | indent 10 }} - volumes: - - name: data - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: {{ template "mongodb.fullname" . }} - {{- else }} - emptyDir: {} - {{- end -}} diff --git a/demochatChart/charts/mongodb/templates/pvc.yaml b/demochatChart/charts/mongodb/templates/pvc.yaml deleted file mode 100644 index f53516f90..000000000 --- a/demochatChart/charts/mongodb/templates/pvc.yaml +++ /dev/null @@ -1,19 +0,0 @@ -{{- if .Values.persistence.enabled }} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: {{ template "mongodb.fullname" . }} -spec: - accessModes: - - {{ .Values.persistence.accessMode | quote }} - resources: - requests: - storage: {{ .Values.persistence.size | quote }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} -{{- end }} diff --git a/demochatChart/charts/mongodb/templates/secrets.yaml b/demochatChart/charts/mongodb/templates/secrets.yaml deleted file mode 100644 index d95e7a451..000000000 --- a/demochatChart/charts/mongodb/templates/secrets.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "mongodb.fullname" . }} - labels: - app: {{ template "mongodb.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -type: Opaque -data: - mongodb-root-password: {{ default "" .Values.mongodbRootPassword | b64enc | quote }} - mongodb-password: {{ default "" .Values.mongodbPassword | b64enc | quote }} diff --git a/demochatChart/charts/mongodb/templates/svc.yaml b/demochatChart/charts/mongodb/templates/svc.yaml deleted file mode 100644 index 6c58b54c5..000000000 --- a/demochatChart/charts/mongodb/templates/svc.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "mongodb.fullname" . }} - labels: - app: {{ template "mongodb.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" -spec: - type: {{ .Values.serviceType }} - ports: - - name: mongodb - port: 27017 - targetPort: mongodb - selector: - app: {{ template "mongodb.fullname" . }} diff --git a/demochatChart/charts/mongodb/values.yaml b/demochatChart/charts/mongodb/values.yaml deleted file mode 100644 index e0acd16c7..000000000 --- a/demochatChart/charts/mongodb/values.yaml +++ /dev/null @@ -1,49 +0,0 @@ -## Bitnami MongoDB image version -## ref: https://hub.docker.com/r/bitnami/mongodb/tags/ -## -image: bitnami/mongodb:3.4.10-r0 - -## Specify a imagePullPolicy -## 'Always' if imageTag is 'latest', else set to 'IfNotPresent' -## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images -## -# imagePullPolicy: - -## MongoDB admin password -## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run -## -# mongodbRootPassword: - -## MongoDB custom user and database -## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#creating-a-user-and-database-on-first-run -## -# mongodbUsername: -# mongodbPassword: -# mongodbDatabase: - -## Kubernetes service type -serviceType: ClusterIP - -## Enable persistence using Persistent Volume Claims -## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ -## -persistence: - enabled: false - ## mongodb data Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) - ## - # storageClass: "-" - accessMode: ReadWriteOnce - size: 8Gi - -## Configure resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: - requests: - memory: 256Mi - cpu: 100m diff --git a/demochatChart/requirements.yaml b/demochatChart/requirements.yaml deleted file mode 100644 index 32855b0cd..000000000 --- a/demochatChart/requirements.yaml +++ /dev/null @@ -1,4 +0,0 @@ -dependencies: - - name: mongodb - version: 0.4.18 - repository: mongodb diff --git a/demochatChart/templates/_helpers.tpl b/demochatChart/templates/_helpers.tpl deleted file mode 100644 index 2aea674f2..000000000 --- a/demochatChart/templates/_helpers.tpl +++ /dev/null @@ -1,21 +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 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{/* KUBECON_DEMOCHAT_SERVICE_HOST */}} -{{- define "demochat" -}} -{{- $service :=default .Release.Name -}} -{{- printf "%s_DEMOCHAT_SERVICE_HOST" .Release.Namespace| upper -}} -{{- end -}} -{{- define "fullname" -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} diff --git a/demochatChart/templates/configMap.yaml b/demochatChart/templates/configMap.yaml deleted file mode 100644 index b1ee53f35..000000000 --- a/demochatChart/templates/configMap.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{.Release.Name }}-config - namespace: default -data: - sha: "{{ .Values.commit.sha }}" - branch: "{{ .Values.commit.branch }}" - repo: "{{ .Values.commit.repo }}" diff --git a/demochatChart/templates/deployment.yaml b/demochatChart/templates/deployment.yaml deleted file mode 100644 index 92c4326fe..000000000 --- a/demochatChart/templates/deployment.yaml +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: extensions/v1beta1 -kind: Deployment -metadata: - name: {{ template "fullname" . }} - labels: - app: {{ template "name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} - commit: {{ .Values.commit.sha }} -spec: - replicas: {{ .Values.replicaCount }} - template: - metadata: - labels: - app: {{ template "name" . }} - release: {{ .Release.Name }} - appversion: "{{.Values.appversion}}" - spec: - containers: - - image: {{.Values.image.repository}}:{{.Values.image.tag}} - name: app - imagePullPolicy: Always - env: - - name : MONGO_HELM - value: {{.Release.Name }}-mongodb - ports: - - containerPort: {{ .Values.service.internalPort }} - resources: {} - strategy: - type: Recreate - diff --git a/demochatChart/templates/secrets.yaml b/demochatChart/templates/secrets.yaml deleted file mode 100644 index e69de29bb..000000000 diff --git a/demochatChart/templates/service.yaml b/demochatChart/templates/service.yaml deleted file mode 100644 index 1ce3ab949..000000000 --- a/demochatChart/templates/service.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-{{ .Values.service.name}} - labels: - app: {{ template "name" . }} - #chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - #release: {{ .Release.Name }} - #heritage: {{ .Release.Service }} - #sha: {{ .Values.commit.sha }} - #branch: "{{ .Values.commit.branch }}" - #repo: "{{ .Values.commit.repo }}" -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.externalPort }} - targetPort: {{ .Values.service.internalPort }} - protocol: TCP - name: {{ .Values.service.name }} - selector: - app: {{ template "name" . }} - release: {{ .Release.Name }} diff --git a/demochatChart/values.yaml b/demochatChart/values.yaml deleted file mode 100644 index 6f6023d63..000000000 --- a/demochatChart/values.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# Default values for demoservice1. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. -replicaCount: 1 -chartVersion: "0.0.2" -appversion: 10 -build : "1" -image: - repository: containers101/demochat - tag: master - pullPolicy: Always -service: - name: demochat - type: LoadBalancer - externalPort: 80 - internalPort: 5000 -commit: - sha: "i1234" - branch: "master" - repo : "verchol/demochat"