|
| 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. |
0 commit comments