5.9.0-0.1.0 • Published 5 years ago

@helm-charts/bitnami-mongodb v5.9.0-0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

@helm-charts/bitnami-mongodb

NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications.

FieldValue
Repository Namebitnami
Chart Namemongodb
Chart Version5.9.0
NPM Package Version0.1.0
## Global Docker image parameters
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
##
# global:
#   imageRegistry: myRegistryName
#   imagePullSecrets:
#     - myRegistryKeySecretName

image:
  ## Bitnami MongoDB registry
  ##
  registry: docker.io
  ## Bitnami MongoDB image name
  ##
  repository: bitnami/mongodb
  ## Bitnami MongoDB image tag
  ## ref: https://hub.docker.com/r/bitnami/mongodb/tags/
  ##
  tag: 4.0.6

  ## Specify a imagePullPolicy
  ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
  ##
  pullPolicy: Always
  ## Optionally specify an array of imagePullSecrets.
  ## Secrets must be manually created in the namespace.
  ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
  ##
  # pullSecrets:
  #   - myRegistryKeySecretName

  ## Set to true if you would like to see extra information on logs
  ## It turns NAMI debugging in minideb
  ## ref:  https://github.com/bitnami/minideb-extras/#turn-on-nami-debugging
  debug: false

## Enable authentication
## ref: https://docs.mongodb.com/manual/tutorial/enable-authentication/
#
usePassword: true
# existingSecret: name-of-existing-secret

## 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: username
# mongodbPassword: password
# mongodbDatabase: database

## Whether enable/disable IPv6 on MongoDB
## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#enabling/disabling-ipv6
##
mongodbEnableIPv6: true

## Whether enable/disable DirectoryPerDB on MongoDB
## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#enabling/disabling-directoryperdb
##
mongodbDirectoryPerDB: false

## MongoDB System Log configuration
## ref: https://github.com/bitnami/bitnami-docker-mongodb#configuring-system-log-verbosity-level
##
mongodbSystemLogVerbosity: 0
mongodbDisableSystemLog: false

## MongoDB additional command line flags
##
## Can be used to specify command line flags, for example:
##
## mongodbExtraFlags:
##  - "--wiredTigerCacheSizeGB=2"
mongodbExtraFlags: []

## Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
##
securityContext:
  enabled: true
  fsGroup: 1001
  runAsUser: 1001

## Kubernetes Cluster Domain
clusterDomain: cluster.local

## Kubernetes service type
service:
  annotations: {}
  type: ClusterIP
  # clusterIP: None
  port: 27017

  ## Specify the nodePort value for the LoadBalancer and NodePort service types.
  ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
  ##
  # nodePort:
  ## Specify the loadBalancerIP value for LoadBalancer service types.
  ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
  ##
  # loadBalancerIP:

## Setting up replication
## ref: https://github.com/bitnami/bitnami-docker-mongodb#setting-up-a-replication
#
replicaSet:
  ## Whether to create a MongoDB replica set for high availability or not
  enabled: false
  useHostnames: true

  ## Name of the replica set
  ##
  name: rs0

  ## Key used for replica set authentication
  ##
  # key: key

  ## Number of replicas per each node type
  ##
  replicas:
    secondary: 1
    arbiter: 1
  ## Pod Disruption Budget
  ## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
  pdb:
    minAvailable:
      primary: 1
      secondary: 1
      arbiter: 1

# Annotations to be added to MongoDB pods
podAnnotations: {}

# Additional pod labels to apply
podLabels: {}

## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
resources: {}
# limits:
#   cpu: 500m
#   memory: 512Mi
# requests:
#   cpu: 100m
#   memory: 256Mi

## Pod priority
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
# priorityClassName: ""

## Node selector
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector
nodeSelector: {}

## Affinity
## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
affinity: {}

## Tolerations
## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
  enabled: true
  ## A manually managed Persistent Volume and Claim
  ## Requires persistence.enabled: true
  ## If defined, PVC must be created manually before volume will be bound
  # existingClaim:

  ## mongodb data Persistent Volume Storage Class
  ## If defined, storageClassName: <storageClass>
  ## 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: "-"
  accessModes:
    - ReadWriteOnce
  size: 8Gi
  annotations: {}

## Configure the options for init containers to be run before the main app containers
## are started. All init containers are run sequentially and must exit without errors
## for the next one to be started.
## ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
# extraInitContainers: |
#   - name: do-something
#     image: busybox
#     command: ['do', 'something']

## Configure extra options for liveness and readiness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
livenessProbe:
  enabled: true
  initialDelaySeconds: 30
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 6
  successThreshold: 1
readinessProbe:
  enabled: true
  initialDelaySeconds: 5
  periodSeconds: 10
  timeoutSeconds: 5
  failureThreshold: 6
  successThreshold: 1

# Entries for the MongoDB config file
configmap:
#  # Where and how to store data.
#  storage:
#    dbPath: /opt/bitnami/mongodb/data/db
#    journal:
#      enabled: true
#    #engine:
#    #wiredTiger:
#  # where to write logging data.
#  systemLog:
#    destination: file
#    logAppend: true
#    path: /opt/bitnami/mongodb/logs/mongodb.log
#  # network interfaces
#  net:
#    port: 27017
#    bindIp: 0.0.0.0
#    unixDomainSocket:
#      enabled: true
#      pathPrefix: /opt/bitnami/mongodb/tmp
#  # replica set options
#  #replication:
#  #  replSetName: replicaset
#  # process management options
#  processManagement:
#     fork: false
#     pidFilePath: /opt/bitnami/mongodb/tmp/mongodb.pid
#  # set parameter options
#  setParameter:
#     enableLocalhostAuthBypass: true
#  # security options
#  security:
#    authorization: enabled
#    #keyFile: /opt/bitnami/mongodb/conf/keyfile

## Prometheus Exporter / Metrics
##
metrics:
  enabled: false

  image:
    registry: docker.io
    repository: forekshub/percona-mongodb-exporter
    tag: latest
    pullPolicy: IfNotPresent
    ## Optionally specify an array of imagePullSecrets.
    ## Secrets must be manually created in the namespace.
    ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
    ##
    # pullSecrets:
    #   - myRegistryKeySecretName

  ## String with extra arguments to the metrics exporter
  ## ref: https://github.com/dcu/mongodb_exporter/blob/master/mongodb_exporter.go
  extraArgs: ''

  ## Metrics exporter resource requests and limits
  ## ref: http://kubernetes.io/docs/user-guide/compute-resources/
  ##
  # resources: {}

  ## Metrics exporter liveness and readiness probes
  ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
  livenessProbe:
    enabled: false
    initialDelaySeconds: 15
    periodSeconds: 5
    timeoutSeconds: 5
  readinessProbe:
    enabled: false
    initialDelaySeconds: 5
    periodSeconds: 5
    timeoutSeconds: 1

  ## Metrics exporter pod Annotation
  podAnnotations:
    prometheus.io/scrape: 'true'
    prometheus.io/port: '9216'

  ## Prometheus Service Monitor
  ## ref: https://github.com/coreos/prometheus-operator
  ##      https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md
  serviceMonitor:
    ## If the operator is installed in your cluster, set to true to create a Service Monitor Entry
    enabled: false
    ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Service Monitors to work with
    ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
    additionalLabels: {}

    ## Specify Metric Relabellings to add to the scrape endpoint
    ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
    # relabellings:

    alerting:
      ## Define individual alerting rules as required
      ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#rulegroup
      ##      https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
      rules: {}

      ## Used to pass Labels that are used by the Prometheus installed in your cluster to select Prometheus Rules to work with
      ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#prometheusspec
      additionalLabels: {}

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.

TL;DR;

$ helm install stable/mongodb

Introduction

This chart bootstraps a MongoDB deployment on a Kubernetes cluster using the Helm package manager.

Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters. This chart has been tested to work with NGINX Ingress, cert-manager, fluentd and Prometheus on top of the BKPR.

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:

$ helm install --name my-release stable/mongodb

The command deploys MongoDB on the Kubernetes cluster in the default configuration. The 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:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the MongoDB chart and their default values.

ParameterDescriptionDefault
global.imageRegistryGlobal Docker image registrynil
global.imagePullSecretsGlobal Docker registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.registryMongoDB image registrydocker.io
image.repositoryMongoDB Image namebitnami/mongodb
image.tagMongoDB Image tag{VERSION}
image.pullPolicyImage pull policyAlways
image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
image.debugSpecify if debug logs should be enabledfalse
usePasswordEnable password authenticationtrue
existingSecretExisting secret with MongoDB credentialsnil
mongodbRootPasswordMongoDB admin passwordrandom alphanumeric string (10)
mongodbUsernameMongoDB custom usernil
mongodbPasswordMongoDB custom user passwordrandom alphanumeric string (10)
mongodbDatabaseDatabase to createnil
mongodbEnableIPv6Switch to enable/disable IPv6 on MongoDBtrue
mongodbDirectoryPerDBSwitch to enable/disable DirectoryPerDB on MongoDBfalse
mongodbSystemLogVerbosityMongoDB systen log verbosity level0
mongodbDisableSystemLogWhether to disable MongoDB system log or notfalse
mongodbExtraFlagsMongoDB additional command line flags[]
service.annotationsKubernetes service annotations{}
service.typeKubernetes Service typeClusterIP
service.clusterIPStatic clusterIP or None for headless servicesnil
service.nodePortPort to bind to for NodePort service typenil
service.loadBalancerIPStatic IP Address to use for LoadBalancer service typenil
portMongoDB service port27017
replicaSet.enabledSwitch to enable/disable replica set configurationfalse
replicaSet.nameName of the replica setrs0
replicaSet.useHostnamesEnable DNS hostnames in the replica set configtrue
replicaSet.keyKey used for authentication in the replica setnil
replicaSet.replicas.secondaryNumber of secondary nodes in the replica set1
replicaSet.replicas.arbiterNumber of arbiter nodes in the replica set1
replicaSet.pdb.minAvailable.primaryPDB for the MongoDB Primary nodes1
replicaSet.pdb.minAvailable.secondaryPDB for the MongoDB Secondary nodes1
replicaSet.pdb.minAvailable.arbiterPDB for the MongoDB Arbiter nodes1
podAnnotationsAnnotations to be added to pods{}
podLabelsAdditional labels for the pod(s).{}
resourcesPod resources{}
priorityClassNamePod priority class name
nodeSelectorNode labels for pod assignment{}
affinityAffinity for pod assignment{}
tolerationsToleration labels for pod assignment{}
securityContext.enabledEnable security contexttrue
securityContext.fsGroupGroup ID for the container1001
securityContext.runAsUserUser ID for the container1001
persistence.enabledUse a PVC to persist datatrue
persistence.storageClassStorage class of backing PVCnil (uses alpha storage class annotation)
persistence.accessModeUse volume as ReadOnly or ReadWriteReadWriteOnce
persistence.sizeSize of data volume8Gi
persistence.annotationsPersistent Volume annotations{}
persistence.existingClaimName of an existing PVC to use (avoids creating one if this is given)nil
extraInitContainersAdditional init containers as a string to be passed to the tpl function{}
livenessProbe.enabledEnable/disable the Liveness probetrue
livenessProbe.initialDelaySecondsDelay before liveness probe is initiated30
livenessProbe.periodSecondsHow often to perform the probe10
livenessProbe.timeoutSecondsWhen the probe times out5
livenessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
livenessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6
readinessProbe.enabledEnable/disable the Readiness probetrue
readinessProbe.initialDelaySecondsDelay before readiness probe is initiated5
readinessProbe.periodSecondsHow often to perform the probe10
readinessProbe.timeoutSecondsWhen the probe times out5
readinessProbe.failureThresholdMinimum consecutive failures for the probe to be considered failed after having succeeded.6
readinessProbe.successThresholdMinimum consecutive successes for the probe to be considered successful after having failed.1
configmapMongoDB configuration file to be usednil
metrics.enabledStart a side-car prometheus exporterfalse
metrics.image.registryMongoDB exporter image registrydocker.io
metrics.image.repositoryMongoDB exporter image nameforekshub/percona-mongodb-exporter
metrics.image.tagMongoDB exporter image taglatest
metrics.image.pullPolicyImage pull policyIfNotPresent
metrics.image.pullSecretsSpecify docker-registry secret names as an array[] (does not add image pull secrets to deployed pods)
metrics.podAnnotationsAdditional annotations for Metrics exporter pod{}
metrics.extraArgsString with extra arguments for the MongoDB Exporter
metrics.resourcesExporter resource requests/limitMemory: 256Mi, CPU: 100m
metrics.serviceMonitor.enabledCreate ServiceMonitor Resource for scraping metrics using PrometheusOperatorfalse
metrics.serviceMonitor.additionalLabelsUsed to pass Labels that are required by the Installed Prometheus Operator{}
metrics.serviceMonitor.relabellingsSpecify Metric Relabellings to add to the scrape endpointnil
metrics.serviceMonitor.alerting.rulesDefine individual alerting rules as required{}
metrics.serviceMonitor.alerting.additionalLabelsUsed to pass Labels that are required by the Installed Prometheus Operator{}
metrics.livenessProbe.enabledEnable/disable the Liveness Check of Prometheus metrics exporterfalse
metrics.livenessProbe.initialDelaySecondsInitial Delay for Liveness Check of Prometheus metrics exporter15
metrics.livenessProbe.periodSecondsHow often to perform Liveness Check of Prometheus metrics exporter10
metrics.livenessProbe.timeoutSecondsTimeout for Liveness Check of Prometheus metrics exporter5
metrics.readinessProbe.enabledEnable/disable the Readiness Check of Prometheus metrics exporterfalse
metrics.readinessProbe.initialDelaySecondsInitial Delay for Readiness Check of Prometheus metrics exporter5
metrics.readinessProbe.periodSecondsHow often to perform Readiness Check of Prometheus metrics exporter10
metrics.readinessProbe.timeoutSecondsTimeout for Readiness Check of Prometheus metrics exporter1

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ 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,

$ helm install --name my-release -f values.yaml stable/mongodb

Tip: You can use the default values.yaml

Replication

You can start the MongoDB chart in replica set mode with the following command:

$ helm install --name my-release stable/mongodb --set replicaSet.enabled=true

Production settings and horizontal scaling

The values-production.yaml file consists a configuration to deploy a scalable and high-available MongoDB deployment for production environments. We recommend that you base your production configuration on this template and adjust the parameters appropriately.

$ curl -O https://raw.githubusercontent.com/kubernetes/charts/master/stable/mongodb/values-production.yaml
$ helm install --name my-release -f ./values-production.yaml stable/mongodb

To horizontally scale this chart, run the following command to scale the number of secondary nodes in your MongoDB replica set.

$ kubectl scale statefulset my-release-mongodb-secondary --replicas=3

Some characteristics of this chart are:

  • Each of the participants in the replication has a fixed stateful set so you always know where to find the primary, secondary or arbiter nodes.
  • The number of secondary and arbiter nodes can be scaled out independently.
  • Easy to move an application from using a standalone MongoDB server to use a replica set.

Initialize a fresh instance

The Bitnami MongoDB image allows you to use your custom scripts to initialize a fresh instance. In order to execute the scripts, they must be located inside the chart folder files/docker-entrypoint-initdb.d so they can be consumed as a ConfigMap.

The allowed extensions are .sh, and .js.

Persistence

The Bitnami MongoDB image stores the MongoDB data and configurations at the /bitnami/mongodb path of the container.

The chart mounts a Persistent Volume at this location. The volume is created using dynamic volume provisioning.

Upgrading

To 5.0.0

When enabling replicaset configuration, backwards compatibility is not guaranteed unless you modify the labels used on the chart's statefulsets. Use the workaround below to upgrade from versions previous to 5.0.0. The following example assumes that the release name is my-release:

$ kubectl delete statefulset my-release-mongodb-arbiter my-release-mongodb-primary my-release-mongodb-secondary --cascade=false
5.9.0-0.1.0

5 years ago

5.8.0-0.1.0

5 years ago

5.7.0-0.1.0

5 years ago

5.6.2-0.1.0

5 years ago

5.6.1-0.1.0

5 years ago

5.6.0-0.1.0

5 years ago

5.5.0-0.1.0

5 years ago

5.4.0-0.1.0

5 years ago

5.3.2-0.1.0

5 years ago

5.3.1-0.1.0

5 years ago

5.3.0-0.1.0

5 years ago

5.2.0-0.1.0

5 years ago

5.16.2-0.1.0

5 years ago

5.16.1-0.1.0

5 years ago

5.16.0-0.1.0

5 years ago

5.15.0-0.1.0

5 years ago

5.14.2-0.1.0

5 years ago

5.14.1-0.1.0

5 years ago

5.14.0-0.1.0

5 years ago

5.13.2-0.1.0

5 years ago

5.13.1-0.1.0

5 years ago

5.13.0-0.1.0

5 years ago

5.12.0-0.1.0

5 years ago

5.11.0-0.1.0

5 years ago

5.10.0-0.1.0

5 years ago

5.1.4-0.1.0

5 years ago

5.1.2-0.1.0

5 years ago

5.1.1-0.1.0

5 years ago

5.1.0-0.1.0

5 years ago

5.0.2-0.1.0

5 years ago

5.0.1-0.1.0

5 years ago

5.0.0-0.1.0

5 years ago

4.9.1-0.1.0

5 years ago

4.9.0-0.1.0

5 years ago

4.8.4-0.1.0

5 years ago

4.8.3-0.1.0

5 years ago

4.8.2-0.1.0

5 years ago

4.8.1-0.1.0

5 years ago

4.8.0-0.1.0

5 years ago

4.7.0-0.1.0

5 years ago

4.6.2-0.1.0

5 years ago

4.6.1-0.1.0

5 years ago

4.6.0-0.1.0

5 years ago

4.5.0-0.1.0

5 years ago

4.4.0-0.1.0

5 years ago

4.3.9-0.1.0

5 years ago

4.3.8-0.1.0

5 years ago

4.3.7-0.1.0

5 years ago

4.3.6-0.1.0

5 years ago

4.3.5-0.1.0

5 years ago

4.3.4-0.1.0

5 years ago

4.3.3-0.1.0

5 years ago

4.3.2-0.1.0

5 years ago

4.3.10-0.1.0

5 years ago

4.3.1-0.1.0

5 years ago

4.3.0-0.1.0

5 years ago

4.2.3-0.1.0

5 years ago

4.2.2-0.1.0

5 years ago

4.2.1-0.1.0

5 years ago

4.2.0-0.1.0

5 years ago

4.10.1-0.1.0

5 years ago

4.10.0-0.1.0

5 years ago

4.1.2-0.1.0

5 years ago

4.1.1-0.1.0

5 years ago

4.0.6-0.1.0

5 years ago

4.0.4-0.1.0

5 years ago

4.0.1-0.1.0

5 years ago

4.0.0-0.1.0

5 years ago

3.0.4-0.1.0

5 years ago

3.0.3-0.1.0

5 years ago

3.0.2-0.1.0

5 years ago

3.0.1-0.1.0

5 years ago

2.0.9-0.1.0

5 years ago

2.0.8-0.1.0

5 years ago

2.0.7-0.1.0

5 years ago

2.0.6-0.1.0

5 years ago

2.0.5-0.1.0

5 years ago

2.0.4-0.1.0

5 years ago

2.0.3-0.1.0

5 years ago

2.0.2-0.1.0

5 years ago

0.4.26-0.1.0

5 years ago