Skip to content
This repository was archived by the owner on Apr 28, 2021. It is now read-only.

Commit 8ba7b5a

Browse files
Merge pull request #2 from amir-codefresh/master
restructuring charts folder for helm command
2 parents 1c9aab6 + 03ce603 commit 8ba7b5a

20 files changed

+482
-0
lines changed

deploy/demochat/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

deploy/demochat/Chart.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
description: demochat
3+
name: demochat
4+
version: 0.0.2

deploy/demochat/app.rc.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: extensions/v1beta1
2+
kind: deployment
3+
metadata:
4+
name: mattermost-app
5+
spec:
6+
replicas: 1
7+
selector:
8+
app: mattermost-app
9+
template:
10+
metadata:
11+
labels:
12+
app: mattermost-app
13+
spec:
14+
containers:
15+
- name: app
16+
image: redspreadapps/mattermost-app:1
17+
imagePullPolicy: Always
18+
volumeMounts:
19+
- name: localtime
20+
mountPath: /etc/localtime
21+
- name: pgauth
22+
mountPath: /etc/pgsecrets
23+
# Uncomment this for production use
24+
#
25+
# - name: assets
26+
# mountPath: /mattermost/data
27+
ports:
28+
- containerPort: 80
29+
protocol: TCP
30+
- name: postgres
31+
image: redspreadapps/mattermost-db:1
32+
imagePullPolicy: Always
33+
volumeMounts:
34+
- name: localtime
35+
mountPath: /etc/localtime
36+
- name: pgauth
37+
mountPath: /etc/secrets
38+
# Uncomment this for production use
39+
# - name: postgres
40+
# mountPath: /var/lib/postgresql/data
41+
env:
42+
- name: PGDATA
43+
value: /var/lib/postgresql/data/pgdata
44+
volumes:
45+
- name: localtime
46+
hostPath:
47+
path: /etc/localtime
48+
- name: pgauth
49+
secret:
50+
secretName: postgres-creds
51+
# Google Cloud Platform Persistent Volume Disk
52+
# - name: assets
53+
# gcePersistentDisk:
54+
# pdName: mattermost-assets
55+
# fsType: "ext4"
56+
#
57+
# - name: postgres
58+
# gcePersistentDisk:
59+
# pdName: mattermost-postgres
60+
# fsType: "ext4"
61+
restartPolicy: Always
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: mongodb
2+
version: 0.4.18
3+
appVersion: 3.4.10
4+
description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications.
5+
keywords:
6+
- mongodb
7+
- database
8+
- nosql
9+
home: https://mongodb.org
10+
icon: https://bitnami.com/assets/stacks/mongodb/img/mongodb-stack-220x234.png
11+
sources:
12+
- https://github.com/bitnami/bitnami-docker-mongodb
13+
maintainers:
14+
- name: Bitnami
15+
16+
engine: gotpl
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# MongoDB
2+
3+
[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.
4+
5+
## TL;DR;
6+
7+
```bash
8+
$ helm install stable/mongodb
9+
```
10+
11+
## Introduction
12+
13+
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.
14+
15+
## Prerequisites
16+
17+
- Kubernetes 1.4+ with Beta APIs enabled
18+
- PV provisioner support in the underlying infrastructure
19+
20+
## Installing the Chart
21+
22+
To install the chart with the release name `my-release`:
23+
24+
```bash
25+
$ helm install --name my-release stable/mongodb
26+
```
27+
28+
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.
29+
30+
> **Tip**: List all releases using `helm list`
31+
32+
## Uninstalling the Chart
33+
34+
To uninstall/delete the `my-release` deployment:
35+
36+
```bash
37+
$ helm delete my-release
38+
```
39+
40+
The command removes all the Kubernetes components associated with the chart and deletes the release.
41+
42+
## Configuration
43+
44+
The following tables lists the configurable parameters of the MongoDB chart and their default values.
45+
46+
| Parameter | Description | Default |
47+
|----------------------------|-------------------------------------|----------------------------------------------------------|
48+
| `image` | MongoDB image | `bitnami/mongodb:{VERSION}` |
49+
| `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent`. |
50+
| `mongodbRootPassword` | MongoDB admin password | `nil` |
51+
| `mongodbUsername` | MongoDB custom user | `nil` |
52+
| `mongodbPassword` | MongoDB custom user password | `nil` |
53+
| `mongodbDatabase` | Database to create | `nil` |
54+
| `serviceType` | Kubernetes Service type | `ClusterIP` |
55+
| `persistence.enabled` | Use a PVC to persist data | `true` |
56+
| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) |
57+
| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` |
58+
| `persistence.size` | Size of data volume | `8Gi` |
59+
60+
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.
61+
62+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
63+
64+
```bash
65+
$ helm install --name my-release \
66+
--set mongodbRootPassword=secretpassword,mongodbUsername=my-user,mongodbPassword=my-password,mongodbDatabase=my-database \
67+
stable/mongodb
68+
```
69+
70+
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`.
71+
72+
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
73+
74+
```bash
75+
$ helm install --name my-release -f values.yaml stable/mongodb
76+
```
77+
78+
> **Tip**: You can use the default [values.yaml](values.yaml)
79+
80+
## Persistence
81+
82+
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.
83+
84+
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.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
MongoDB can be accessed via port 27017 on the following DNS name from within your cluster:
2+
{{ template "mongodb.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
3+
4+
To connect to your database run the following command:
5+
6+
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 -}}
7+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "mongodb.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
*/}}
13+
{{- define "mongodb.fullname" -}}
14+
{{- $name := default .Chart.Name .Values.nameOverride -}}
15+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
16+
{{- end -}}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
apiVersion: extensions/v1beta1
2+
kind: Deployment
3+
metadata:
4+
name: {{ template "mongodb.fullname" . }}
5+
labels:
6+
app: {{ template "mongodb.fullname" . }}
7+
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
8+
release: "{{ .Release.Name }}"
9+
heritage: "{{ .Release.Service }}"
10+
spec:
11+
template:
12+
metadata:
13+
labels:
14+
app: {{ template "mongodb.fullname" . }}
15+
spec:
16+
containers:
17+
- name: {{ template "mongodb.fullname" . }}
18+
image: "{{ .Values.image }}"
19+
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
20+
env:
21+
- name: MONGODB_ROOT_PASSWORD
22+
valueFrom:
23+
secretKeyRef:
24+
name: {{ template "mongodb.fullname" . }}
25+
key: mongodb-root-password
26+
- name: MONGODB_USERNAME
27+
value: {{ default "" .Values.mongodbUsername | quote }}
28+
- name: MONGODB_PASSWORD
29+
valueFrom:
30+
secretKeyRef:
31+
name: {{ template "mongodb.fullname" . }}
32+
key: mongodb-password
33+
- name: MONGODB_DATABASE
34+
value: {{ default "" .Values.mongodbDatabase | quote }}
35+
ports:
36+
- name: mongodb
37+
containerPort: 27017
38+
livenessProbe:
39+
exec:
40+
command:
41+
- mongo
42+
- --eval
43+
- "db.adminCommand('ping')"
44+
initialDelaySeconds: 30
45+
timeoutSeconds: 5
46+
readinessProbe:
47+
exec:
48+
command:
49+
- mongo
50+
- --eval
51+
- "db.adminCommand('ping')"
52+
initialDelaySeconds: 5
53+
timeoutSeconds: 1
54+
volumeMounts:
55+
- name: data
56+
mountPath: /bitnami/mongodb
57+
resources:
58+
{{ toYaml .Values.resources | indent 10 }}
59+
volumes:
60+
- name: data
61+
{{- if .Values.persistence.enabled }}
62+
persistentVolumeClaim:
63+
claimName: {{ template "mongodb.fullname" . }}
64+
{{- else }}
65+
emptyDir: {}
66+
{{- end -}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if .Values.persistence.enabled }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: {{ template "mongodb.fullname" . }}
6+
spec:
7+
accessModes:
8+
- {{ .Values.persistence.accessMode | quote }}
9+
resources:
10+
requests:
11+
storage: {{ .Values.persistence.size | quote }}
12+
{{- if .Values.persistence.storageClass }}
13+
{{- if (eq "-" .Values.persistence.storageClass) }}
14+
storageClassName: ""
15+
{{- else }}
16+
storageClassName: "{{ .Values.persistence.storageClass }}"
17+
{{- end }}
18+
{{- end }}
19+
{{- end }}

0 commit comments

Comments
 (0)