charts: add mongodb chart

This commit is contained in:
Sameer Naik
2016-03-23 21:08:46 +05:30
parent 632ee855d8
commit 146cf14239
5 changed files with 125 additions and 0 deletions

10
mongodb/Chart.yaml Normal file
View File

@@ -0,0 +1,10 @@
name: mongodb
home: https://mongodb.org
source:
- https://github.com/bitnami/bitnami-docker-mongodb
version: 0.1.0
description: Chart for MongoDB
maintainers:
- Bitnami <containers@bitnami.com>
details: |-
MongoDB 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.

37
mongodb/README.md Normal file
View File

@@ -0,0 +1,37 @@
# MongoDB
> MongoDB 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.
Based on the [Bitnami MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) image for docker, this Chart bootstraps a [MongoDB](https://mongodb.com/) deployment on a [Kubernetes](http://kubernetes.io) cluster using [Helm](https://helm.sh).
## Persistence
For persistence of the MongoDB data, mount a [storage volume](http://kubernetes.io/docs/user-guide/volumes/) at the `/bitnami/mongodb/data` path of the MongoDB pod.
By default the MongoDB Chart mounts an [emptyDir](http://kubernetes.io/docs/user-guide/volumes/#emptydir) volume.
## Configuration
To edit the default MongoDB configuration, run
```bash
$ helm edit mongodb
```
Configurable parameters can be specified in `tpl/values.toml`. If not specified default values as defined by the [Bitnami MongoDB](https://github.com/bitnami/bitnami-docker-mongodb) image are used.
> Tip: If you have issues running the above command, add `se autochdir` to your `~/.vimrc` profile or simply edit `~/.helm/workspace/charts/mongodb/tpl/values.toml` in your favourite editor.
Finally, generate the chart to apply your changes to the configuration.
```bash
$ helm generate mongodb
```
## Cleanup
To delete the MongoDB deployment completely:
```bash
$ helm uninstall -n default mongodb
```

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: mongodb
labels:
provider: mongodb
heritage: bitnami
spec:
ports:
- name: mongodb
port: 27017
targetPort: mongodb
selector:
provider: mongodb

View File

@@ -0,0 +1,61 @@
#helm:generate helm tpl -d tpl/values.toml -o manifests/mongodb-rc.yaml $HELM_GENERATE_FILE
apiVersion: v1
kind: ReplicationController
metadata:
name: mongodb
labels:
provider: mongodb
heritage: bitnami
spec:
replicas: 1
selector:
provider: mongodb
version: 3.0.7-1-r02
template:
metadata:
labels:
provider: mongodb
version: 3.0.7-1-r02
heritage: bitnami
spec:
containers:
- name: mongodb
image: bitnami/mongodb:3.0.7-1-r02
env:
- name: MONGODB_USER
value: "{{.mongodbUser}}"
- name: MONGODB_PASSWORD
value: "{{.mongodbPassword}}"
- name: MONGODB_DATABASE
value: "{{.mongodbDatabase}}"
ports:
- name: mongodb
containerPort: 27017
livenessProbe:
exec:
command:
- mongo
- ping
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- mongo
- ping
initialDelaySeconds: 5
timeoutSeconds: 1
volumeMounts:
- name: data
mountPath: /bitnami/mongodb/data
- name: conf
mountPath: /bitnami/mongodb/conf
- name: logs
mountPath: /bitnami/mongodb/logs
volumes:
- name: data
emptyDir: {}
- name: conf
emptyDir: {}
- name: logs
emptyDir: {}

3
mongodb/tpl/values.toml Normal file
View File

@@ -0,0 +1,3 @@
mongodbUser = ""
mongodbPassword = ""
mongodbDatabase = ""