[bitnami/mongodb-sharded] MongoDB sharded standarization (#9829)

* MongoDB sharded standarization

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Amend root user configuration and remove 'enabled' field from metrics probes

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Add major changes in README file

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Update VIB values

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Apply suggestions

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Amend vib config

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Disable persistence in vib deploy

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Little fixes

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Disable startup probe by default

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Fix issues detected and review mongos-service-per-replica.yaml template

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Update README.md with readme-generator-for-helm

Signed-off-by: Bitnami Containers <containers@bitnami.com>

* Bump image version

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Review tiemouts after mongosh inclusion

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* Review tiemouts after mongosh inclusion

Signed-off-by: Fran Mulero <fmulero@vmware.com>

* [bitnami/mongodb-sharded] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Bitnami Containers <containers@bitnami.com>
This commit is contained in:
Fran Mulero
2022-04-29 21:10:45 +02:00
committed by GitHub
parent c9896c9942
commit 88c4054537
27 changed files with 1658 additions and 750 deletions

View File

@@ -22,7 +22,7 @@
"url": "{SHA_ARCHIVE}", "url": "{SHA_ARCHIVE}",
"path": "/bitnami/mongodb-sharded" "path": "/bitnami/mongodb-sharded"
}, },
"runtime_parameters": "Im1vbmdvZGJSb290UGFzc3dvcmQiOiAiQzY1ZDRRcnQiCiJyZXBsaWNhU2V0S2V5IjogIjl3NnFUeGtWIgoic2VydmljZSI6CiAgInBvcnQiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciI=", "runtime_parameters": "ImF1dGgiOgogICJyb290UGFzc3dvcmQiOiAiQzY1ZDRRcnQiCiAgInJlcGxpY2FTZXRLZXkiOiAiOXc2cVR4a1YiCiJzZXJ2aWNlIjoKICAicG9ydHMiOgogICAgIm1vbmdvZGIiOiA4MAogICJ0eXBlIjogIkxvYWRCYWxhbmNlciIKInBlcnNpc3RlbmNlIjoKICAiZW5hYmxlZCI6IGZhbHNlCg==",
"target_platform": { "target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}", "target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": { "size": {

View File

@@ -1,6 +1,6 @@
dependencies: dependencies:
- name: common - name: common
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
version: 1.13.0 version: 1.13.1
digest: sha256:e83af41b39942278f8389623671732e624f28c6f1ad6ac2d937e210c5f354a18 digest: sha256:1056dac8da880ed967a191e8d9eaf04766f77bda66a5715456d5dd4494a4a942
generated: "2022-03-27T01:41:37.541647744Z" generated: "2022-04-29T18:09:25.381615057Z"

View File

@@ -1,7 +1,7 @@
annotations: annotations:
category: Database category: Database
apiVersion: v2 apiVersion: v2
appVersion: 4.4.13 appVersion: 5.0.8
dependencies: dependencies:
- name: common - name: common
repository: https://charts.bitnami.com/bitnami repository: https://charts.bitnami.com/bitnami
@@ -26,4 +26,4 @@ name: mongodb-sharded
sources: sources:
- https://github.com/bitnami/bitnami-docker-mongodb-sharded - https://github.com/bitnami/bitnami-docker-mongodb-sharded
- https://mongodb.org - https://mongodb.org
version: 4.1.1 version: 5.0.0

View File

@@ -69,9 +69,13 @@ The command removes all the Kubernetes components associated with the chart and
| Name | Description | Value | | Name | Description | Value |
| ------------------------ | --------------------------------------------------------------------------------------- | --------------- | | ------------------------ | --------------------------------------------------------------------------------------- | --------------- |
| `nameOverride` | String to partially override mongodb.fullname template (will maintain the release name) | `""` | | `kubeVersion` | Override Kubernetes version | `""` |
| `fullnameOverride` | String to fully override mongodb.fullname template | `""` | | `nameOverride` | String to partially override common.names.name | `""` |
| `clusterDomain` | Kubernetes Cluster Domain | `cluster.local` | | `fullnameOverride` | String to fully override common.names.fullname | `""` |
| `namespaceOverride` | String to fully override common.names.namespace | `""` |
| `commonLabels` | Labels to add to all deployed objects | `{}` |
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
| `clusterDomain` | Kubernetes cluster domain name | `cluster.local` |
| `extraDeploy` | Array of extra objects to deploy with the release | `[]` | | `extraDeploy` | Array of extra objects to deploy with the release | `[]` |
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` | | `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` | | `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
@@ -80,302 +84,446 @@ The command removes all the Kubernetes components associated with the chart and
### MongoDB(&reg;) Sharded parameters ### MongoDB(&reg;) Sharded parameters
| Name | Description | Value | | Name | Description | Value |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | | ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `image.registry` | MongoDB(&reg;) Sharded image registry | `docker.io` | | `image.registry` | MongoDB(&reg;) Sharded image registry | `docker.io` |
| `image.repository` | MongoDB(&reg;) Sharded Image name | `bitnami/mongodb-sharded` | | `image.repository` | MongoDB(&reg;) Sharded Image name | `bitnami/mongodb-sharded` |
| `image.tag` | MongoDB(&reg;) Sharded image tag (immutable tags are recommended) | `4.4.11-debian-10-r6` | | `image.tag` | MongoDB(&reg;) Sharded image tag (immutable tags are recommended) | `5.0.8-debian-10-r3` |
| `image.pullPolicy` | MongoDB(&reg;) Sharded image pull policy | `IfNotPresent` | | `image.pullPolicy` | MongoDB(&reg;) Sharded image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` |
| `image.debug` | Specify if debug logs should be enabled | `false` | | `image.debug` | Specify if debug logs should be enabled | `false` |
| `mongodbRootPassword` | MongoDB&reg; root password | `""` | | `auth.enabled` | Enable authentication | `true` |
| `replicaSetKey` | Replica Set key (shared for shards and config servers) | `""` | | `auth.rootUser` | MongoDB(&reg;) root user | `root` |
| `existingSecret` | Existing secret with MongoDB&reg; credentials | `""` | | `auth.rootPassword` | MongoDB(&reg;) root password | `""` |
| `usePasswordFile` | Mount credentials as files instead of using environment variables | `false` | | `auth.username` | Custom user to be created during the initialization | `""` |
| `shards` | Number of shards to be created | `2` | | `auth.password` | Password for the custom user set at `auth.username` | `""` |
| `common.mongodbEnableNumactl` | Enable launch MongoDB instance prefixed with "numactl --interleave=all" | `false` | | `auth.database` | Database to be created during the initialization | `""` |
| `common.useHostnames` | Enable DNS hostnames in the replica set config | `true` | | `auth.replicaSetKey` | Key used for authentication in the replicaset (only when `architecture=replicaset`) | `""` |
| `common.mongodbEnableIPv6` | Switch to enable/disable IPv6 on MongoDB&reg; | `false` | | `auth.existingSecret` | Existing secret with MongoDB(&reg;) credentials (keys: `mongodb-password`, `mongodb-root-password`, ` mongodb-replica-set-key`) | `""` |
| `common.mongodbDirectoryPerDB` | Switch to enable/disable DirectoryPerDB on MongoDB&reg; | `false` | | `auth.usePasswordFile` | Mount credentials as files instead of using environment variables | `false` |
| `common.mongodbSystemLogVerbosity` | MongoDB&reg; system log verbosity level | `0` | | `shards` | Number of shards to be created | `2` |
| `common.mongodbDisableSystemLog` | Whether to disable MongoDB&reg; system log or not | `false` | | `common.mongodbEnableNumactl` | Enable launch MongoDB instance prefixed with "numactl --interleave=all" | `false` |
| `common.mongodbMaxWaitTimeout` | Maximum time (in seconds) for MongoDB&reg; nodes to wait for another MongoDB&reg; node to be ready | `120` | | `common.useHostnames` | Enable DNS hostnames in the replica set config | `true` |
| `common.initScriptsCM` | Configmap with init scripts to execute | `""` | | `common.mongodbEnableIPv6` | Switch to enable/disable IPv6 on MongoDB&reg; | `false` |
| `common.initScriptsSecret` | Secret with init scripts to execute (for sensitive data) | `""` | | `common.mongodbDirectoryPerDB` | Switch to enable/disable DirectoryPerDB on MongoDB&reg; | `false` |
| `common.extraEnvVars` | An array to add extra env vars | `[]` | | `common.mongodbSystemLogVerbosity` | MongoDB&reg; system log verbosity level | `0` |
| `common.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` | | `common.mongodbDisableSystemLog` | Whether to disable MongoDB&reg; system log or not | `false` |
| `common.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` | | `common.mongodbMaxWaitTimeout` | Maximum time (in seconds) for MongoDB&reg; nodes to wait for another MongoDB&reg; node to be ready | `120` |
| `common.sidecars` | Add sidecars to the pod | `[]` | | `common.initScriptsCM` | Configmap with init scripts to execute | `""` |
| `common.initContainers` | Add init containers to the pod | `[]` | | `common.initScriptsSecret` | Secret with init scripts to execute (for sensitive data) | `""` |
| `common.podAnnotations` | Additional pod annotations | `{}` | | `common.extraEnvVars` | An array to add extra env vars | `[]` |
| `common.podLabels` | Additional pod labels | `{}` | | `common.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` |
| `common.extraVolumes` | Array to add extra volumes | `[]` | | `common.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` |
| `common.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes) | `[]` | | `common.sidecars` | Add sidecars to the pod | `[]` |
| `common.containerPorts.mongo` | MongoDB container port | `27017` | | `common.initContainers` | Add init containers to the pod | `[]` |
| `common.serviceAccount.create` | Whether to create a Service Account for all pods automatically | `false` | | `common.podAnnotations` | Additional pod annotations | `{}` |
| `common.serviceAccount.name` | Name of a Service Account to be used by all Pods | `""` | | `common.podLabels` | Additional pod labels | `{}` |
| `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` | | `common.extraVolumes` | Array to add extra volumes | `[]` |
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | | `common.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes) | `[]` |
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/bitnami-shell` | | `common.containerPorts.mongodb` | MongoDB container port | `27017` |
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `10-debian-10-r308` | | `common.serviceAccount.create` | Whether to create a Service Account for all pods automatically | `false` |
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` | | `common.serviceAccount.name` | Name of a Service Account to be used by all Pods | `""` |
| `volumePermissions.image.pullSecrets` | Init container volume-permissions image pull secrets | `[]` | | `common.serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` |
| `volumePermissions.resources` | Init container resource requests/limit | `{}` | | `common.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `securityContext.enabled` | Enable security context | `true` | | `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` |
| `securityContext.fsGroup` | Group ID for the container | `1001` | | `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
| `securityContext.runAsUser` | User ID for the container | `1001` | | `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/bitnami-shell` |
| `securityContext.runAsNonRoot` | Run containers as non-root users | `true` | | `volumePermissions.image.tag` | Init container volume-permissions image tag | `10-debian-10-r404` |
| `service.name` | Specify an explicit service name | `""` | | `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` |
| `service.annotations` | Additional service annotations (evaluate as a template) | `{}` | | `volumePermissions.image.pullSecrets` | Init container volume-permissions image pull secrets | `[]` |
| `service.type` | Service type | `ClusterIP` | | `volumePermissions.resources` | Init container resource requests/limit | `{}` |
| `service.externalTrafficPolicy` | External traffic policy | `Cluster` | | `service.name` | Specify an explicit service name | `""` |
| `service.port` | MongoDB&reg; service port | `27017` | | `service.annotations` | Additional service annotations (evaluate as a template) | `{}` |
| `service.clusterIP` | Static clusterIP or None for headless services | `""` | | `service.type` | Service type | `ClusterIP` |
| `service.nodePort` | Specify the nodePort value for the LoadBalancer and NodePort service types. | `""` | | `service.externalTrafficPolicy` | External traffic policy | `Cluster` |
| `service.externalIPs` | External IP list to use with ClusterIP service type | `[]` | | `service.ports.mongodb` | MongoDB&reg; service port | `27017` |
| `service.loadBalancerIP` | Static IP Address to use for LoadBalancer service type | `""` | | `service.clusterIP` | Static clusterIP or None for headless services | `""` |
| `service.loadBalancerSourceRanges` | List of IP ranges allowed access to load balancer (if supported) | `[]` | | `service.nodePorts.mongodb` | Specify the nodePort value for the LoadBalancer and NodePort service types. | `""` |
| `service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` | | `service.externalIPs` | External IP list to use with ClusterIP service type | `[]` |
| `service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` | | `service.loadBalancerIP` | Static IP Address to use for LoadBalancer service type | `""` |
| `livenessProbe.enabled` | Enable livenessProbe | `true` | | `service.loadBalancerSourceRanges` | List of IP ranges allowed access to load balancer (if supported) | `[]` |
| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` | | `service.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` | | `service.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | | `service.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `6` |
| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `readinessProbe.enabled` | Enable readinessProbe | `true` |
| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `60` |
| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` |
| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` |
| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` |
| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
### Config Server parameters ### Config Server parameters
| Name | Description | Value | | Name | Description | Value |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------- | | ----------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| `configsvr.replicas` | Number of nodes in the replica set (the first node will be primary) | `1` | | `configsvr.replicaCount` | Number of nodes in the replica set (the first node will be primary) | `1` |
| `configsvr.resources` | Configure pod resources | `{}` | | `configsvr.resources` | Configure pod resources | `{}` |
| `configsvr.hostAliases` | Deployment pod host aliases | `[]` | | `configsvr.hostAliases` | Deployment pod host aliases | `[]` |
| `configsvr.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` | | `configsvr.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` |
| `configsvr.priorityClassName` | Pod priority class name | `""` | | `configsvr.topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `{}` |
| `configsvr.podAffinityPreset` | Config Server Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `configsvr.priorityClassName` | Pod priority class name | `""` |
| `configsvr.podAntiAffinityPreset` | Config Server Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | | `configsvr.podAffinityPreset` | Config Server Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `configsvr.nodeAffinityPreset.type` | Config Server Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `configsvr.podAntiAffinityPreset` | Config Server Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `configsvr.nodeAffinityPreset.key` | Config Server Node label key to match Ignored if `affinity` is set. | `""` | | `configsvr.nodeAffinityPreset.type` | Config Server Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `configsvr.nodeAffinityPreset.values` | Config Server Node label values to match. Ignored if `affinity` is set. | `[]` | | `configsvr.nodeAffinityPreset.key` | Config Server Node label key to match Ignored if `affinity` is set. | `""` |
| `configsvr.affinity` | Config Server Affinity for pod assignment | `{}` | | `configsvr.nodeAffinityPreset.values` | Config Server Node label values to match. Ignored if `affinity` is set. | `[]` |
| `configsvr.nodeSelector` | Config Server Node labels for pod assignment | `{}` | | `configsvr.affinity` | Config Server Affinity for pod assignment | `{}` |
| `configsvr.tolerations` | Config Server Tolerations for pod assignment | `[]` | | `configsvr.nodeSelector` | Config Server Node labels for pod assignment | `{}` |
| `configsvr.podManagementPolicy` | Statefulset's pod management policy, allows parallel startup of pods | `OrderedReady` | | `configsvr.tolerations` | Config Server Tolerations for pod assignment | `[]` |
| `configsvr.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` | | `configsvr.podManagementPolicy` | Statefulset's pod management policy, allows parallel startup of pods | `OrderedReady` |
| `configsvr.config` | MongoDB&reg; configuration file | `""` | | `configsvr.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` |
| `configsvr.configCM` | ConfigMap name with Config Server configuration file (cannot be used with configsvr.config) | `""` | | `configsvr.config` | MongoDB&reg; configuration file | `""` |
| `configsvr.extraEnvVars` | An array to add extra env vars | `[]` | | `configsvr.configCM` | ConfigMap name with Config Server configuration file (cannot be used with configsvr.config) | `""` |
| `configsvr.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` | | `configsvr.extraEnvVars` | An array to add extra env vars | `[]` |
| `configsvr.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` | | `configsvr.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` |
| `configsvr.sidecars` | Add sidecars to the pod | `[]` | | `configsvr.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` |
| `configsvr.initContainers` | Add init containers to the pod | `[]` | | `configsvr.sidecars` | Add sidecars to the pod | `[]` |
| `configsvr.podAnnotations` | Additional pod annotations | `{}` | | `configsvr.initContainers` | Add init containers to the pod | `[]` |
| `configsvr.podLabels` | Additional pod labels | `{}` | | `configsvr.podAnnotations` | Additional pod annotations | `{}` |
| `configsvr.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` | | `configsvr.podLabels` | Additional pod labels | `{}` |
| `configsvr.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes). Normally used with `extraVolumes` | `[]` | | `configsvr.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` |
| `configsvr.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | | `configsvr.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes). Normally used with `extraVolumes` | `[]` |
| `configsvr.pdb.enabled` | Enable pod disruption budget | `false` | | `configsvr.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
| `configsvr.pdb.minAvailable` | Minimum number of available config pods allowed (`0` to disable) | `0` | | `configsvr.pdb.create` | Enable pod disruption budget | `false` |
| `configsvr.pdb.maxUnavailable` | Maximum number of unavailable config pods allowed (`0` to disable) | `1` | | `configsvr.pdb.minAvailable` | Minimum number of available config pods allowed (`0` to disable) | `0` |
| `configsvr.persistence.enabled` | Use a PVC to persist data | `true` | | `configsvr.pdb.maxUnavailable` | Maximum number of unavailable config pods allowed (`0` to disable) | `1` |
| `configsvr.persistence.mountPath` | Path to mount the volume at | `/bitnami/mongodb` | | `configsvr.persistence.enabled` | Use a PVC to persist data | `true` |
| `configsvr.persistence.subPath` | Subdirectory of the volume to mount at | `""` | | `configsvr.persistence.mountPath` | Path to mount the volume at | `/bitnami/mongodb` |
| `configsvr.persistence.storageClass` | Storage class of backing PVC | `""` | | `configsvr.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
| `configsvr.persistence.accessModes` | Use volume as ReadOnly or ReadWrite | `["ReadWriteOnce"]` | | `configsvr.persistence.storageClass` | Storage class of backing PVC | `""` |
| `configsvr.persistence.size` | PersistentVolumeClaim size | `8Gi` | | `configsvr.persistence.accessModes` | Use volume as ReadOnly or ReadWrite | `["ReadWriteOnce"]` |
| `configsvr.persistence.annotations` | Persistent Volume annotations | `{}` | | `configsvr.persistence.size` | PersistentVolumeClaim size | `8Gi` |
| `configsvr.serviceAccount.create` | Specifies whether a ServiceAccount should be created for Config Server | `false` | | `configsvr.persistence.annotations` | Persistent Volume annotations | `{}` |
| `configsvr.serviceAccount.name` | Name of a Service Account to be used by Config Server | `""` | | `configsvr.persistence.resourcePolicy` | Setting it to "keep" to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted | `""` |
| `configsvr.external.host` | Primary node of an external Config Server replicaset | `""` | | `configsvr.serviceAccount.create` | Specifies whether a ServiceAccount should be created for Config Server | `false` |
| `configsvr.external.rootPassword` | Root password of the external Config Server replicaset | `""` | | `configsvr.serviceAccount.name` | Name of a Service Account to be used by Config Server | `""` |
| `configsvr.external.replicasetName` | Replicaset name of an external Config Server | `""` | | `configsvr.serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` |
| `configsvr.external.replicasetKey` | Replicaset key of an external Config Server | `""` | | `configsvr.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `configsvr.external.host` | Primary node of an external Config Server replicaset | `""` |
| `configsvr.external.rootPassword` | Root password of the external Config Server replicaset | `""` |
| `configsvr.external.replicasetName` | Replicaset name of an external Config Server | `""` |
| `configsvr.external.replicasetKey` | Replicaset key of an external Config Server | `""` |
| `configsvr.podSecurityContext.enabled` | Enable security context | `true` |
| `configsvr.podSecurityContext.fsGroup` | Group ID for the container | `1001` |
| `configsvr.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
| `configsvr.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
| `configsvr.containerSecurityContext.runAsNonRoot` | Set containers' Security Context runAsNonRoot | `true` |
| `configsvr.containerSecurityContext.readOnlyRootFilesystem` | Set containers' Security Context runAsNonRoot | `false` |
| `configsvr.command` | Override default container command (useful when using custom images) | `["/bin/bash","/entrypoint/replicaset-entrypoint.sh"]` |
| `configsvr.args` | Override default container args (useful when using custom images) | `[]` |
| `configsvr.terminationGracePeriodSeconds` | Seconds Redmine pod needs to terminate gracefully | `""` |
| `configsvr.lifecycleHooks` | for the Config Server container(s) to automate configuration before or after startup | `{}` |
| `configsvr.livenessProbe.enabled` | Enable livenessProbe | `true` |
| `configsvr.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` |
| `configsvr.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `30` |
| `configsvr.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `20` |
| `configsvr.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `2` |
| `configsvr.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `configsvr.readinessProbe.enabled` | Enable readinessProbe | `true` |
| `configsvr.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `10` |
| `configsvr.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `30` |
| `configsvr.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `20` |
| `configsvr.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` |
| `configsvr.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
| `configsvr.startupProbe.enabled` | Enable startupProbe | `true` |
| `configsvr.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `0` |
| `configsvr.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
| `configsvr.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
| `configsvr.startupProbe.failureThreshold` | Failure threshold for startupProbe | `30` |
| `configsvr.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `configsvr.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
| `configsvr.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
| `configsvr.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
### Mongos parameters ### Mongos parameters
| Name | Description | Value | | Name | Description | Value |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------ | --------------- | | -------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | --------------- |
| `mongos.replicas` | Number of replicas | `1` | | `mongos.replicaCount` | Number of replicas | `1` |
| `mongos.resources` | Configure pod resources | `{}` | | `mongos.resources` | Configure pod resources | `{}` |
| `mongos.hostAliases` | Deployment pod host aliases | `[]` | | `mongos.hostAliases` | Deployment pod host aliases | `[]` |
| `mongos.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` | | `mongos.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` |
| `mongos.priorityClassName` | Pod priority class name | `""` | | `mongos.topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `{}` |
| `mongos.podAffinityPreset` | Mongos Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `mongos.priorityClassName` | Pod priority class name | `""` |
| `mongos.podAntiAffinityPreset` | Mongos Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | | `mongos.podAffinityPreset` | Mongos Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `mongos.nodeAffinityPreset.type` | Mongos Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `mongos.podAntiAffinityPreset` | Mongos Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `mongos.nodeAffinityPreset.key` | Mongos Node label key to match Ignored if `affinity` is set. | `""` | | `mongos.nodeAffinityPreset.type` | Mongos Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `mongos.nodeAffinityPreset.values` | Mongos Node label values to match. Ignored if `affinity` is set. | `[]` | | `mongos.nodeAffinityPreset.key` | Mongos Node label key to match Ignored if `affinity` is set. | `""` |
| `mongos.affinity` | Mongos Affinity for pod assignment | `{}` | | `mongos.nodeAffinityPreset.values` | Mongos Node label values to match. Ignored if `affinity` is set. | `[]` |
| `mongos.nodeSelector` | Mongos Node labels for pod assignment | `{}` | | `mongos.affinity` | Mongos Affinity for pod assignment | `{}` |
| `mongos.tolerations` | Mongos Tolerations for pod assignment | `[]` | | `mongos.nodeSelector` | Mongos Node labels for pod assignment | `{}` |
| `mongos.podManagementPolicy` | Statefulsets pod management policy, allows parallel startup of pods | `OrderedReady` | | `mongos.tolerations` | Mongos Tolerations for pod assignment | `[]` |
| `mongos.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` | | `mongos.podManagementPolicy` | Statefulsets pod management policy, allows parallel startup of pods | `OrderedReady` |
| `mongos.config` | MongoDB&reg; configuration file | `""` | | `mongos.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` |
| `mongos.configCM` | ConfigMap name with MongoDB&reg; configuration file (cannot be used with mongos.config) | `""` | | `mongos.config` | MongoDB&reg; configuration file | `""` |
| `mongos.extraEnvVars` | An array to add extra env vars | `[]` | | `mongos.configCM` | ConfigMap name with MongoDB&reg; configuration file (cannot be used with mongos.config) | `""` |
| `mongos.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` | | `mongos.extraEnvVars` | An array to add extra env vars | `[]` |
| `mongos.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` | | `mongos.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` |
| `mongos.sidecars` | Add sidecars to the pod | `[]` | | `mongos.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` |
| `mongos.initContainers` | Add init containers to the pod | `[]` | | `mongos.sidecars` | Add sidecars to the pod | `[]` |
| `mongos.podAnnotations` | Additional pod annotations | `{}` | | `mongos.initContainers` | Add init containers to the pod | `[]` |
| `mongos.podLabels` | Additional pod labels | `{}` | | `mongos.podAnnotations` | Additional pod annotations | `{}` |
| `mongos.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` | | `mongos.podLabels` | Additional pod labels | `{}` |
| `mongos.extraVolumeMounts` | Array to add extra volume mounts. Normally used with `extraVolumes`. | `[]` | | `mongos.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` |
| `mongos.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | | `mongos.extraVolumeMounts` | Array to add extra volume mounts. Normally used with `extraVolumes`. | `[]` |
| `mongos.useStatefulSet` | Use StatefulSet instead of Deployment | `false` | | `mongos.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
| `mongos.servicePerReplica.enabled` | Create one service per mongos replica (must be used with statefulset) | `false` | | `mongos.useStatefulSet` | Use StatefulSet instead of Deployment | `false` |
| `mongos.servicePerReplica.annotations` | Additional service annotations (evaluate as a template) | `{}` | | `mongos.servicePerReplica.enabled` | Create one service per mongos replica (must be used with statefulset) | `false` |
| `mongos.servicePerReplica.type` | Service type | `ClusterIP` | | `mongos.servicePerReplica.annotations` | Additional service annotations (evaluate as a template) | `{}` |
| `mongos.servicePerReplica.externalTrafficPolicy` | External traffic policy | `Cluster` | | `mongos.servicePerReplica.type` | Service type | `ClusterIP` |
| `mongos.servicePerReplica.port` | MongoDB&reg; service port | `27017` | | `mongos.servicePerReplica.externalTrafficPolicy` | External traffic policy | `Cluster` |
| `mongos.servicePerReplica.clusterIP` | Static clusterIP or None for headless services | `""` | | `mongos.servicePerReplica.port` | MongoDB&reg; service port | `27017` |
| `mongos.servicePerReplica.nodePort` | Specify the nodePort value for the LoadBalancer and NodePort service types | `""` | | `mongos.servicePerReplica.clusterIPs` | Array of static clusterIPs for each MongoDB@reg; replica. Length must be the same as mongos.replicaCount | `[]` |
| `mongos.servicePerReplica.externalIPs` | External IP list to use with ClusterIP service type | `[]` | | `mongos.servicePerReplica.nodePorts` | Array of node ports used for each MongoDB@reg; replica. Length must be the same as mongos.replicaCount | `[]` |
| `mongos.servicePerReplica.loadBalancerIP` | Static IP Address to use for LoadBalancer service type | `""` | | `mongos.servicePerReplica.externalIPs` | External IP list to use with ClusterIP service type | `[]` |
| `mongos.servicePerReplica.loadBalancerSourceRanges` | List of IP ranges allowed access to load balancer (if supported) | `[]` | | `mongos.servicePerReplica.loadBalancerIPs` | Array of static IP Address to use for each replica LoadBalancer service type. Length must be the same as mongos.replicaCount | `[]` |
| `mongos.servicePerReplica.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` | | `mongos.servicePerReplica.loadBalancerSourceRanges` | List of IP ranges allowed access to load balancer (if supported) | `[]` |
| `mongos.servicePerReplica.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` | | `mongos.servicePerReplica.extraPorts` | Extra ports to expose (normally used with the `sidecar` value) | `[]` |
| `mongos.pdb.enabled` | Enable pod disruption budget | `false` | | `mongos.servicePerReplica.sessionAffinity` | Session Affinity for Kubernetes service, can be "None" or "ClientIP" | `None` |
| `mongos.pdb.minAvailable` | Minimum number of available mongo pods allowed (`0` to disable) | `0` | | `mongos.servicePerReplica.sessionAffinityConfig` | Additional settings for the sessionAffinity | `{}` |
| `mongos.pdb.maxUnavailable` | Maximum number of unavailable mongo pods allowed (`0` to disable) | `1` | | `mongos.pdb.create` | Enable pod disruption budget | `false` |
| `mongos.serviceAccount.create` | Whether to create a Service Account for mongos automatically | `false` | | `mongos.pdb.minAvailable` | Minimum number of available mongo pods allowed (`0` to disable) | `0` |
| `mongos.serviceAccount.name` | Name of a Service Account to be used by mongos | `""` | | `mongos.pdb.maxUnavailable` | Maximum number of unavailable mongo pods allowed (`0` to disable) | `1` |
| `mongos.serviceAccount.create` | Whether to create a Service Account for mongos automatically | `false` |
| `mongos.serviceAccount.name` | Name of a Service Account to be used by mongos | `""` |
| `mongos.serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` |
| `mongos.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `mongos.podSecurityContext.enabled` | Enable security context | `true` |
| `mongos.podSecurityContext.fsGroup` | Group ID for the container | `1001` |
| `mongos.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
| `mongos.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
| `mongos.containerSecurityContext.runAsNonRoot` | Set containers' Security Context runAsNonRoot | `true` |
| `mongos.containerSecurityContext.readOnlyRootFilesystem` | Set containers' Security Context runAsNonRoot | `false` |
| `mongos.command` | Override default container command (useful when using custom images) | `[]` |
| `mongos.args` | Override default container args (useful when using custom images) | `[]` |
| `mongos.terminationGracePeriodSeconds` | Seconds Redmine pod needs to terminate gracefully | `""` |
| `mongos.lifecycleHooks` | for the Mongo container(s) to automate configuration before or after startup | `{}` |
| `mongos.livenessProbe.enabled` | Enable livenessProbe | `true` |
| `mongos.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` |
| `mongos.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `30` |
| `mongos.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `20` |
| `mongos.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `2` |
| `mongos.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `mongos.readinessProbe.enabled` | Enable readinessProbe | `true` |
| `mongos.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `10` |
| `mongos.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `30` |
| `mongos.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `20` |
| `mongos.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` |
| `mongos.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
| `mongos.startupProbe.enabled` | Enable startupProbe | `false` |
| `mongos.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `0` |
| `mongos.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
| `mongos.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
| `mongos.startupProbe.failureThreshold` | Failure threshold for startupProbe | `30` |
| `mongos.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `mongos.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
| `mongos.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
| `mongos.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
### Shard configuration: Data node parameters ### Shard configuration: Data node parameters
| Name | Description | Value | | Name | Description | Value |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------- | --------------- | | ------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ |
| `shardsvr.dataNode.replicas` | Number of nodes in each shard replica set (the first node will be primary) | `1` | | `shardsvr.dataNode.replicaCount` | Number of nodes in each shard replica set (the first node will be primary) | `1` |
| `shardsvr.dataNode.resources` | Configure pod resources | `{}` | | `shardsvr.dataNode.resources` | Configure pod resources | `{}` |
| `shardsvr.dataNode.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` | | `shardsvr.dataNode.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` |
| `shardsvr.dataNode.priorityClassName` | Pod priority class name | `""` | | `shardsvr.dataNode.topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `{}` |
| `shardsvr.dataNode.podAffinityPreset` | Data nodes Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `shardsvr.dataNode.priorityClassName` | Pod priority class name | `""` |
| `shardsvr.dataNode.podAntiAffinityPreset` | Data nodes Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | | `shardsvr.dataNode.podAffinityPreset` | Data nodes Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `shardsvr.dataNode.nodeAffinityPreset.type` | Data nodes Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `shardsvr.dataNode.podAntiAffinityPreset` | Data nodes Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `shardsvr.dataNode.nodeAffinityPreset.key` | Data nodes Node label key to match Ignored if `affinity` is set. | `""` | | `shardsvr.dataNode.nodeAffinityPreset.type` | Data nodes Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `shardsvr.dataNode.nodeAffinityPreset.values` | Data nodes Node label values to match. Ignored if `affinity` is set. | `[]` | | `shardsvr.dataNode.nodeAffinityPreset.key` | Data nodes Node label key to match Ignored if `affinity` is set. | `""` |
| `shardsvr.dataNode.affinity` | Data nodes Affinity for pod assignment | `{}` | | `shardsvr.dataNode.nodeAffinityPreset.values` | Data nodes Node label values to match. Ignored if `affinity` is set. | `[]` |
| `shardsvr.dataNode.nodeSelector` | Data nodes Node labels for pod assignment | `{}` | | `shardsvr.dataNode.affinity` | Data nodes Affinity for pod assignment | `{}` |
| `shardsvr.dataNode.tolerations` | Data nodes Tolerations for pod assignment | `[]` | | `shardsvr.dataNode.nodeSelector` | Data nodes Node labels for pod assignment | `{}` |
| `shardsvr.dataNode.podManagementPolicy` | podManagementPolicy for the statefulset, allows parallel startup of pods | `OrderedReady` | | `shardsvr.dataNode.tolerations` | Data nodes Tolerations for pod assignment | `[]` |
| `shardsvr.dataNode.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` | | `shardsvr.dataNode.podManagementPolicy` | podManagementPolicy for the statefulset, allows parallel startup of pods | `OrderedReady` |
| `shardsvr.dataNode.hostAliases` | Deployment pod host aliases | `[]` | | `shardsvr.dataNode.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` |
| `shardsvr.dataNode.config` | Entries for the MongoDB&reg; config file | `""` | | `shardsvr.dataNode.hostAliases` | Deployment pod host aliases | `[]` |
| `shardsvr.dataNode.configCM` | ConfigMap name with MongoDB&reg; configuration (cannot be used with shardsvr.dataNode.config) | `""` | | `shardsvr.dataNode.config` | Entries for the MongoDB&reg; config file | `""` |
| `shardsvr.dataNode.extraEnvVars` | An array to add extra env vars | `[]` | | `shardsvr.dataNode.configCM` | ConfigMap name with MongoDB&reg; configuration (cannot be used with shardsvr.dataNode.config) | `""` |
| `shardsvr.dataNode.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` | | `shardsvr.dataNode.extraEnvVars` | An array to add extra env vars | `[]` |
| `shardsvr.dataNode.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` | | `shardsvr.dataNode.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` |
| `shardsvr.dataNode.sidecars` | Attach additional containers (evaluated as a template) | `[]` | | `shardsvr.dataNode.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` |
| `shardsvr.dataNode.initContainers` | Add init containers to the pod | `[]` | | `shardsvr.dataNode.sidecars` | Attach additional containers (evaluated as a template) | `[]` |
| `shardsvr.dataNode.podAnnotations` | Additional pod annotations | `{}` | | `shardsvr.dataNode.initContainers` | Add init containers to the pod | `[]` |
| `shardsvr.dataNode.podLabels` | Additional pod labels | `{}` | | `shardsvr.dataNode.podAnnotations` | Additional pod annotations | `{}` |
| `shardsvr.dataNode.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` | | `shardsvr.dataNode.podLabels` | Additional pod labels | `{}` |
| `shardsvr.dataNode.extraVolumeMounts` | Array to add extra mounts. Normally used with `extraVolumes` | `[]` | | `shardsvr.dataNode.extraVolumes` | Array to add extra volumes. Requires setting `extraVolumeMounts` | `[]` |
| `shardsvr.dataNode.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | | `shardsvr.dataNode.extraVolumeMounts` | Array to add extra mounts. Normally used with `extraVolumes` | `[]` |
| `shardsvr.dataNode.pdb.enabled` | Enable pod disruption budget | `false` | | `shardsvr.dataNode.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
| `shardsvr.dataNode.pdb.minAvailable` | Minimum number of available data pods allowed (`0` to disable) | `0` | | `shardsvr.dataNode.pdb.create` | Enable pod disruption budget | `false` |
| `shardsvr.dataNode.pdb.maxUnavailable` | Maximum number of unavailable data pods allowed (`0` to disable) | `1` | | `shardsvr.dataNode.pdb.minAvailable` | Minimum number of available data pods allowed (`0` to disable) | `0` |
| `shardsvr.dataNode.serviceAccount.create` | Specifies whether a ServiceAccount should be created for shardsvr | `false` | | `shardsvr.dataNode.pdb.maxUnavailable` | Maximum number of unavailable data pods allowed (`0` to disable) | `1` |
| `shardsvr.dataNode.serviceAccount.name` | Name of a Service Account to be used by shardsvr data pods | `""` | | `shardsvr.dataNode.serviceAccount.create` | Specifies whether a ServiceAccount should be created for shardsvr | `false` |
| `shardsvr.dataNode.serviceAccount.name` | Name of a Service Account to be used by shardsvr data pods | `""` |
| `shardsvr.dataNode.serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` |
| `shardsvr.dataNode.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `shardsvr.dataNode.podSecurityContext.enabled` | Enable security context | `true` |
| `shardsvr.dataNode.podSecurityContext.fsGroup` | Group ID for the container | `1001` |
| `shardsvr.dataNode.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
| `shardsvr.dataNode.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
| `shardsvr.dataNode.containerSecurityContext.runAsNonRoot` | Set containers' Security Context runAsNonRoot | `true` |
| `shardsvr.dataNode.containerSecurityContext.readOnlyRootFilesystem` | Set containers' Security Context runAsNonRoot | `false` |
| `shardsvr.dataNode.command` | Override default container command (useful when using custom images) | `["/bin/bash","/entrypoint/replicaset-entrypoint.sh"]` |
| `shardsvr.dataNode.args` | Override default container args (useful when using custom images) | `[]` |
| `shardsvr.dataNode.terminationGracePeriodSeconds` | Seconds Redmine pod needs to terminate gracefully | `""` |
| `shardsvr.dataNode.lifecycleHooks` | for the Data container(s) to automate configuration before or after startup | `{}` |
| `shardsvr.dataNode.livenessProbe.enabled` | Enable livenessProbe | `true` |
| `shardsvr.dataNode.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` |
| `shardsvr.dataNode.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `30` |
| `shardsvr.dataNode.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `20` |
| `shardsvr.dataNode.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `2` |
| `shardsvr.dataNode.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `shardsvr.dataNode.readinessProbe.enabled` | Enable readinessProbe | `true` |
| `shardsvr.dataNode.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `10` |
| `shardsvr.dataNode.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `30` |
| `shardsvr.dataNode.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `20` |
| `shardsvr.dataNode.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` |
| `shardsvr.dataNode.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
| `shardsvr.dataNode.startupProbe.enabled` | Enable startupProbe | `false` |
| `shardsvr.dataNode.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `0` |
| `shardsvr.dataNode.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
| `shardsvr.dataNode.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
| `shardsvr.dataNode.startupProbe.failureThreshold` | Failure threshold for startupProbe | `30` |
| `shardsvr.dataNode.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `shardsvr.dataNode.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
| `shardsvr.dataNode.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
| `shardsvr.dataNode.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
### Shard configuration: Persistence parameters ### Shard configuration: Persistence parameters
| Name | Description | Value | | Name | Description | Value |
| ----------------------------------- | ---------------------------------------------------------------------------------------- | ------------------- | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `shardsvr.persistence.enabled` | Use a PVC to persist data | `true` | | `shardsvr.persistence.enabled` | Use a PVC to persist data | `true` |
| `shardsvr.persistence.mountPath` | The path the volume will be mounted at, useful when using different MongoDB&reg; images. | `/bitnami/mongodb` | | `shardsvr.persistence.mountPath` | The path the volume will be mounted at, useful when using different MongoDB&reg; images. | `/bitnami/mongodb` |
| `shardsvr.persistence.subPath` | Subdirectory of the volume to mount at | `""` | | `shardsvr.persistence.subPath` | Subdirectory of the volume to mount at | `""` |
| `shardsvr.persistence.storageClass` | Storage class of backing PVC | `""` | | `shardsvr.persistence.storageClass` | Storage class of backing PVC | `""` |
| `shardsvr.persistence.accessModes` | Use volume as ReadOnly or ReadWrite | `["ReadWriteOnce"]` | | `shardsvr.persistence.accessModes` | Use volume as ReadOnly or ReadWrite | `["ReadWriteOnce"]` |
| `shardsvr.persistence.size` | PersistentVolumeClaim size | `8Gi` | | `shardsvr.persistence.size` | PersistentVolumeClaim size | `8Gi` |
| `shardsvr.persistence.annotations` | Additional volume annotations | `{}` | | `shardsvr.persistence.annotations` | Additional volume annotations | `{}` |
| `shardsvr.persistence.resourcePolicy` | Setting it to "keep" to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted | `""` |
### Shard configuration: Arbiter parameters ### Shard configuration: Arbiter parameters
| Name | Description | Value | | Name | Description | Value |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------- | | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | --------------- |
| `shardsvr.arbiter.replicas` | Number of arbiters in each shard replica set (the first node will be primary) | `0` | | `shardsvr.arbiter.replicaCount` | Number of arbiters in each shard replica set (the first node will be primary) | `0` |
| `shardsvr.arbiter.hostAliases` | Deployment pod host aliases | `[]` | | `shardsvr.arbiter.hostAliases` | Deployment pod host aliases | `[]` |
| `shardsvr.arbiter.resources` | Configure pod resources | `{}` | | `shardsvr.arbiter.resources` | Configure pod resources | `{}` |
| `shardsvr.arbiter.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` | | `shardsvr.arbiter.mongodbExtraFlags` | MongoDB&reg; additional command line flags | `[]` |
| `shardsvr.arbiter.priorityClassName` | Pod priority class name | `""` | | `shardsvr.arbiter.topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `{}` |
| `shardsvr.arbiter.podAffinityPreset` | Arbiter's Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `shardsvr.arbiter.priorityClassName` | Pod priority class name | `""` |
| `shardsvr.arbiter.podAntiAffinityPreset` | Arbiter's Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | | `shardsvr.arbiter.podAffinityPreset` | Arbiter's Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `shardsvr.arbiter.nodeAffinityPreset.type` | Arbiter's Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | | `shardsvr.arbiter.podAntiAffinityPreset` | Arbiter's Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` |
| `shardsvr.arbiter.nodeAffinityPreset.key` | Arbiter's Node label key to match Ignored if `affinity` is set. | `""` | | `shardsvr.arbiter.nodeAffinityPreset.type` | Arbiter's Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` |
| `shardsvr.arbiter.nodeAffinityPreset.values` | Arbiter's Node label values to match. Ignored if `affinity` is set. | `[]` | | `shardsvr.arbiter.nodeAffinityPreset.key` | Arbiter's Node label key to match Ignored if `affinity` is set. | `""` |
| `shardsvr.arbiter.affinity` | Arbiter's Affinity for pod assignment | `{}` | | `shardsvr.arbiter.nodeAffinityPreset.values` | Arbiter's Node label values to match. Ignored if `affinity` is set. | `[]` |
| `shardsvr.arbiter.nodeSelector` | Arbiter's Node labels for pod assignment | `{}` | | `shardsvr.arbiter.affinity` | Arbiter's Affinity for pod assignment | `{}` |
| `shardsvr.arbiter.tolerations` | Arbiter's Tolerations for pod assignment | `[]` | | `shardsvr.arbiter.nodeSelector` | Arbiter's Node labels for pod assignment | `{}` |
| `shardsvr.arbiter.podManagementPolicy` | Statefulset's pod management policy, allows parallel startup of pods | `OrderedReady` | | `shardsvr.arbiter.tolerations` | Arbiter's Tolerations for pod assignment | `[]` |
| `shardsvr.arbiter.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` | | `shardsvr.arbiter.podManagementPolicy` | Statefulset's pod management policy, allows parallel startup of pods | `OrderedReady` |
| `shardsvr.arbiter.config` | MongoDB&reg; configuration file | `""` | | `shardsvr.arbiter.updateStrategy.type` | updateStrategy for MongoDB&reg; Primary, Secondary and Arbiter statefulsets | `RollingUpdate` |
| `shardsvr.arbiter.configCM` | ConfigMap name with MongoDB&reg; configuration file (cannot be used with shardsvr.arbiter.config) | `""` | | `shardsvr.arbiter.config` | MongoDB&reg; configuration file | `""` |
| `shardsvr.arbiter.extraEnvVars` | An array to add extra env vars | `[]` | | `shardsvr.arbiter.configCM` | ConfigMap name with MongoDB&reg; configuration file (cannot be used with shardsvr.arbiter.config) | `""` |
| `shardsvr.arbiter.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` | | `shardsvr.arbiter.extraEnvVars` | An array to add extra env vars | `[]` |
| `shardsvr.arbiter.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` | | `shardsvr.arbiter.extraEnvVarsCM` | Name of a ConfigMap containing extra env vars | `""` |
| `shardsvr.arbiter.sidecars` | Add sidecars to the pod | `[]` | | `shardsvr.arbiter.extraEnvVarsSecret` | Name of a Secret containing extra env vars | `""` |
| `shardsvr.arbiter.initContainers` | Add init containers to the pod | `[]` | | `shardsvr.arbiter.sidecars` | Add sidecars to the pod | `[]` |
| `shardsvr.arbiter.podAnnotations` | Additional pod annotations | `{}` | | `shardsvr.arbiter.initContainers` | Add init containers to the pod | `[]` |
| `shardsvr.arbiter.podLabels` | Additional pod labels | `{}` | | `shardsvr.arbiter.podAnnotations` | Additional pod annotations | `{}` |
| `shardsvr.arbiter.extraVolumes` | Array to add extra volumes | `[]` | | `shardsvr.arbiter.podLabels` | Additional pod labels | `{}` |
| `shardsvr.arbiter.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes) | `[]` | | `shardsvr.arbiter.extraVolumes` | Array to add extra volumes | `[]` |
| `shardsvr.arbiter.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` | | `shardsvr.arbiter.extraVolumeMounts` | Array to add extra mounts (normally used with extraVolumes) | `[]` |
| `shardsvr.arbiter.serviceAccount.create` | Specifies whether a ServiceAccount should be created for shardsvr arbiter nodes | `false` | | `shardsvr.arbiter.schedulerName` | Use an alternate scheduler, e.g. "stork". | `""` |
| `shardsvr.arbiter.serviceAccount.name` | Name of a Service Account to be used by shardsvr arbiter pods | `""` | | `shardsvr.arbiter.serviceAccount.create` | Specifies whether a ServiceAccount should be created for shardsvr arbiter nodes | `false` |
| `shardsvr.arbiter.serviceAccount.name` | Name of a Service Account to be used by shardsvr arbiter pods | `""` |
| `shardsvr.arbiter.serviceAccount.annotations` | Additional Service Account annotations (evaluated as a template) | `{}` |
| `shardsvr.arbiter.serviceAccount.automountServiceAccountToken` | Automount service account token for the server service account | `true` |
| `shardsvr.arbiter.podSecurityContext.enabled` | Enable security context | `true` |
| `shardsvr.arbiter.podSecurityContext.fsGroup` | Group ID for the container | `1001` |
| `shardsvr.arbiter.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
| `shardsvr.arbiter.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
| `shardsvr.arbiter.containerSecurityContext.runAsNonRoot` | Set containers' Security Context runAsNonRoot | `true` |
| `shardsvr.arbiter.containerSecurityContext.readOnlyRootFilesystem` | Set containers' Security Context runAsNonRoot | `false` |
| `shardsvr.arbiter.command` | Override default container command (useful when using custom images) | `[]` |
| `shardsvr.arbiter.args` | Override default container args (useful when using custom images) | `[]` |
| `shardsvr.arbiter.terminationGracePeriodSeconds` | Seconds Redmine pod needs to terminate gracefully | `""` |
| `shardsvr.arbiter.lifecycleHooks` | for the arbiter container(s) to automate configuration before or after startup | `{}` |
| `shardsvr.arbiter.livenessProbe.enabled` | Enable livenessProbe | `true` |
| `shardsvr.arbiter.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `60` |
| `shardsvr.arbiter.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `30` |
| `shardsvr.arbiter.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `20` |
| `shardsvr.arbiter.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `2` |
| `shardsvr.arbiter.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `shardsvr.arbiter.readinessProbe.enabled` | Enable readinessProbe | `true` |
| `shardsvr.arbiter.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `10` |
| `shardsvr.arbiter.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `30` |
| `shardsvr.arbiter.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `20` |
| `shardsvr.arbiter.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` |
| `shardsvr.arbiter.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
| `shardsvr.arbiter.startupProbe.enabled` | Enable startupProbe | `false` |
| `shardsvr.arbiter.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `0` |
| `shardsvr.arbiter.startupProbe.periodSeconds` | Period seconds for startupProbe | `10` |
| `shardsvr.arbiter.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `5` |
| `shardsvr.arbiter.startupProbe.failureThreshold` | Failure threshold for startupProbe | `30` |
| `shardsvr.arbiter.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `shardsvr.arbiter.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
| `shardsvr.arbiter.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
| `shardsvr.arbiter.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
### Metrics parameters ### Metrics parameters
| Name | Description | Value | | Name | Description | Value |
| -------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------- | | --------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------- |
| `metrics.enabled` | Start a side-car prometheus exporter | `false` | | `metrics.enabled` | Start a side-car prometheus exporter | `false` |
| `metrics.image.registry` | MongoDB&reg; exporter image registry | `docker.io` | | `metrics.image.registry` | MongoDB&reg; exporter image registry | `docker.io` |
| `metrics.image.repository` | MongoDB&reg; exporter image name | `bitnami/mongodb-exporter` | | `metrics.image.repository` | MongoDB&reg; exporter image name | `bitnami/mongodb-exporter` |
| `metrics.image.tag` | MongoDB&reg; exporter image tag | `0.30.0-debian-10-r53` | | `metrics.image.tag` | MongoDB&reg; exporter image tag | `0.31.2-debian-10-r14` |
| `metrics.image.pullPolicy` | MongoDB&reg; exporter image pull policy | `Always` | | `metrics.image.pullPolicy` | MongoDB&reg; exporter image pull policy | `Always` |
| `metrics.image.pullSecrets` | MongoDB&reg; exporter image pull secrets | `[]` | | `metrics.image.pullSecrets` | MongoDB&reg; exporter image pull secrets | `[]` |
| `metrics.useTLS` | Whether to connect to MongoDB&reg; with TLS | `false` | | `metrics.useTLS` | Whether to connect to MongoDB&reg; with TLS | `false` |
| `metrics.extraArgs` | String with extra arguments to the metrics exporter | `""` | | `metrics.extraArgs` | String with extra arguments to the metrics exporter | `""` |
| `metrics.resources` | Metrics exporter resource requests and limits | `{}` | | `metrics.resources` | Metrics exporter resource requests and limits | `{}` |
| `metrics.livenessProbe.enabled` | Enable livenessProbe | `false` | | `metrics.containerSecurityContext.enabled` | Enabled containers' Security Context | `true` |
| `metrics.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `15` | | `metrics.containerSecurityContext.runAsUser` | Set containers' Security Context runAsUser | `1001` |
| `metrics.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `5` | | `metrics.containerSecurityContext.runAsNonRoot` | Set containers' Security Context runAsNonRoot | `true` |
| `metrics.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | | `metrics.containerSecurityContext.readOnlyRootFilesystem` | Set containers' Security Context runAsNonRoot | `false` |
| `metrics.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` | | `metrics.livenessProbe.enabled` | Enable livenessProbe | `false` |
| `metrics.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | | `metrics.livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `15` |
| `metrics.readinessProbe.enabled` | Enable readinessProbe | `false` | | `metrics.livenessProbe.periodSeconds` | Period seconds for livenessProbe | `5` |
| `metrics.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` | | `metrics.livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` |
| `metrics.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `5` | | `metrics.livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` |
| `metrics.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` | | `metrics.livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` |
| `metrics.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` | | `metrics.readinessProbe.enabled` | Enable readinessProbe | `false` |
| `metrics.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | | `metrics.readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` |
| `metrics.containerPort` | Port of the Prometheus metrics container | `9216` | | `metrics.readinessProbe.periodSeconds` | Period seconds for readinessProbe | `5` |
| `metrics.podAnnotations` | Metrics exporter pod Annotation | `{}` | | `metrics.readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `1` |
| `metrics.podMonitor.enabled` | Create PodMonitor Resource for scraping metrics using PrometheusOperator | `false` | | `metrics.readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `3` |
| `metrics.podMonitor.namespace` | Namespace where podmonitor resource should be created | `monitoring` | | `metrics.readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` |
| `metrics.podMonitor.interval` | Specify the interval at which metrics should be scraped | `30s` | | `metrics.startupProbe.enabled` | Enable startupProbe | `false` |
| `metrics.podMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `""` | | `metrics.startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `0` |
| `metrics.podMonitor.additionalLabels` | Additional labels that can be used so PodMonitors will be discovered by Prometheus | `{}` | | `metrics.startupProbe.periodSeconds` | Period seconds for startupProbe | `5` |
| `metrics.startupProbe.timeoutSeconds` | Timeout seconds for startupProbe | `2` |
| `metrics.startupProbe.failureThreshold` | Failure threshold for startupProbe | `15` |
| `metrics.startupProbe.successThreshold` | Success threshold for startupProbe | `1` |
| `metrics.customLivenessProbe` | Custom livenessProbe that overrides the default one | `{}` |
| `metrics.customReadinessProbe` | Custom readinessProbe that overrides the default one | `{}` |
| `metrics.customStartupProbe` | Custom startupProbe that overrides the default one | `{}` |
| `metrics.containerPorts.metrics` | Port of the Prometheus metrics container | `9216` |
| `metrics.podAnnotations` | Metrics exporter pod Annotation | `{}` |
| `metrics.podMonitor.enabled` | Create PodMonitor Resource for scraping metrics using PrometheusOperator | `false` |
| `metrics.podMonitor.namespace` | Namespace where podmonitor resource should be created | `monitoring` |
| `metrics.podMonitor.interval` | Specify the interval at which metrics should be scraped | `30s` |
| `metrics.podMonitor.scrapeTimeout` | Specify the timeout after which the scrape is ended | `""` |
| `metrics.podMonitor.additionalLabels` | Additional labels that can be used so PodMonitors will be discovered by Prometheus | `{}` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
```bash ```bash
$ helm install my-release \ $ helm install my-release \
--set shards=4,configsvr.replicas=3,shardsvr.dataNode.replicas=2 \ --set shards=4,configsvr.replicaCount=3,shardsvr.dataNode.replicaCount=2 \
bitnami/mongodb-sharded bitnami/mongodb-sharded
``` ```
@@ -425,7 +573,7 @@ sidecars:
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- name: portname - name: portname
containerPort: 1234 containerPort: 1234
``` ```
Similarly, you can add extra init containers using the `initContainers` parameter. Similarly, you can add extra init containers using the `initContainers` parameter.
@@ -437,7 +585,7 @@ initContainers:
imagePullPolicy: Always imagePullPolicy: Always
ports: ports:
- name: portname - name: portname
containerPort: 1234 containerPort: 1234
``` ```
### Adding extra environment variables ### Adding extra environment variables
@@ -487,13 +635,34 @@ Find more information about how to deal with common errors related to Bitnami's
## Upgrading ## Upgrading
If authentication is enabled, it's necessary to set the `mongodbRootPassword` and `replicaSetKey` when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use. Please note down the password, and run the command below to upgrade your chart: If authentication is enabled, it's necessary to set the `auth.rootPassword` and `auth.replicaSetKey` when upgrading for readiness/liveness probes to work properly. When you install this chart for the first time, some notes will be displayed providing the credentials you must use. Please note down the password, and run the command below to upgrade your chart:
```bash ```bash
$ helm upgrade my-release bitnami/mongodb-sharded --set mongodbRootPassword=[PASSWORD] (--set replicaSetKey=[REPLICASETKEY]) $ helm upgrade my-release bitnami/mongodb-sharded --set auth.rootPassword=[PASSWORD] (--set auth.replicaSetKey=[auth.replicaSetKey])
``` ```
> Note: you need to substitute the placeholders [PASSWORD] and [REPLICASETKEY] with the values obtained in the installation notes. > Note: you need to substitute the placeholders [PASSWORD] and [auth.replicaSetKey] with the values obtained in the installation notes.
### To 5.0.0
This major release renames several values in this chart and adds missing features, in order to be inline with the rest of assets in the Bitnami charts repository.
Affected values:
- Authentication parameters are reorganized under the `auth.*` parameter:
- `usePassword` is renamed to `auth.enabled`.
- `mongodbRootPassword`, `mongodbUsername`, `mongodbPassword`, `mongodbDatabase`, `replicaSetKey`, `existingSecret` and `usePasswordFile` are now `auth.rootPassword`, `auth.username`, `auth.password`, `auth.database`, `auth.replicaSetKey`, `auth.existingSecret` and `auth.usePasswordFile` respectively.
- `common.containerPorts.mongo` is renamed to `common.containerPorts.mongodb`
- `pdb.enabled` is renamed to `pdb.create`
- `XXX.replicas` is renamed to `XXX.replicaCount`
- `service.port` is renamed to `service.ports.mongodb`
- `metrics.containerPort` is renamed to `metrics.containerPorts.metrics`
- `service.nodePort` is renamed to `service.nodePorts.mongodb`
- `securityContext` is splitted into `podSecurityContext` and `containerSecurityContext` and moved into the different sections (`mongos`, `shardsvr.dataNode`, `shardsvr.arbiter`and `configsvr`):
- `securityContext.fsGroup` is renamed to `XXX.podSecurityContext.fsGroup`
- `securityContext.runAsUser` is renamed to `XXX.containerSecurityContext.runAsUser`
- `securityContext.runAsNonRoot` is renamed to `XXX.containerSecurityContext.runAsNonRoot`
- `redinessProbe`, `livenessProbe` and `startupProbe` are moved to the different sections (`mongos`, `shardsvr.dataNode`, `shardsvr.arbiter`and `configsvr`)
### To 4.0.0 ### To 4.0.0

View File

@@ -24,18 +24,18 @@ In order to replicate the container startup scripts execute this command:
{{- else }} {{- else }}
The MongoDB&reg; Sharded cluster can be accessed via the Mongos instances in port {{ .Values.service.port }} on the following DNS name from within your cluster: The MongoDB&reg; Sharded cluster can be accessed via the Mongos instances in port {{ .Values.service.ports.mongodb }} on the following DNS name from within your cluster:
{{ include "mongodb-sharded.serviceName" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ include "mongodb-sharded.serviceName" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
To get the root password run: To get the {{ .Values.auth.rootUser }} password run:
export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-root-password}" | base64 --decode) export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-root-password}" | base64 --decode)
{{- if and .Values.mongodbUsername .Values.mongodbDatabase }} {{- if and .Values.auth.username .Values.auth.database }}
{{- if .Values.mongodbPassword }} {{- if .Values.auth.password }}
To get the password for "{{ .Values.mongodbUsername }}" run: To get the password for "{{ .Values.auth.username }}" run:
export MONGODB_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-password}" | base64 --decode) export MONGODB_PASSWORD=$(kubectl get secret --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }} -o jsonpath="{.data.mongodb-password}" | base64 --decode)
@@ -44,7 +44,7 @@ To get the password for "{{ .Values.mongodbUsername }}" run:
To connect to your database run the following command: To connect to your database run the following command:
kubectl run --namespace {{ .Release.Namespace }} {{ include "common.names.fullname" . }}-client --rm --tty -i --restart='Never' --image {{ template "mongodb-sharded.image" . }} --command -- mongosh admin --host {{ include "mongodb-sharded.serviceName" . }} {{- if .Values.usePassword }} --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD{{- end }} kubectl run --namespace {{ .Release.Namespace }} {{ printf "%s-client" (include "common.names.fullname" .) }} --rm --tty -i --restart='Never' --image {{ template "mongodb-sharded.image" . }} --command -- mongosh admin --host {{ include "mongodb-sharded.serviceName" . }} {{- if .Values.auth.enabled }} --authenticationDatabase admin -u {{ .Values.auth.rootUser }} -p $MONGODB_ROOT_PASSWORD{{- end }}
To connect to your database from outside the cluster execute the following commands: To connect to your database from outside the cluster execute the following commands:
@@ -60,11 +60,11 @@ To connect to your database from outside the cluster execute the following comma
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "mongodb-sharded.serviceName" . }}' Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ include "mongodb-sharded.serviceName" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mongodb-sharded.serviceName" . }} --include "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}") export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "mongodb-sharded.serviceName" . }} --include "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
mongosh --host $SERVICE_IP --port {{ .Values.service.port }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD mongosh --host $SERVICE_IP --port {{ .Values.service.ports.mongodb }} --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD
{{- else if contains "ClusterIP" .Values.service.type }} {{- else if contains "ClusterIP" .Values.service.type }}
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "mongodb-sharded.serviceName" . }} {{ .Values.service.port }}:{{ .Values.service.port }} & kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "mongodb-sharded.serviceName" . }} {{ .Values.service.ports.mongodb }}:{{ .Values.service.ports.mongodb }} &
mongosh --host 127.0.0.1 --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD mongosh --host 127.0.0.1 --authenticationDatabase admin -p $MONGODB_ROOT_PASSWORD
{{- end }} {{- end }}

View File

@@ -4,38 +4,21 @@
Returns a ServiceAccount name for specified path or falls back to `common.serviceAccount.name` Returns a ServiceAccount name for specified path or falls back to `common.serviceAccount.name`
if `common.serviceAccount.create` is set to true. Falls back to Chart's fullname otherwise. if `common.serviceAccount.create` is set to true. Falls back to Chart's fullname otherwise.
Usage: Usage:
{{ include "mongodb-sharded.serviceAccountName" (dict "value" .Values.path.to.serviceAccount "context" $) }} {{ include "mongodb-sharded.serviceAccountName" (dict "component" "mongos" "value" .Values.path.to.serviceAccount "context" $) }}
*/}} */}}
{{- define "mongodb-sharded.serviceAccountName" -}} {{- define "mongodb-sharded.serviceAccountName" -}}
{{- if .value.create }} {{- if .value.create }}
{{- default (include "common.names.fullname" .context) .value.name | quote }} {{- default (printf "%s-%s" (include "common.names.fullname" .context) .component) .value.name | quote }}
{{- else if .context.Values.common.serviceAccount.create }} {{- else if .context.Values.common.serviceAccount.create }}
{{- default (include "common.names.fullname" .context) .context.Values.common.serviceAccount.name | quote }} {{- default (printf "%s-%s" (include "common.names.fullname" .context) .component).context.Values.common.serviceAccount.name | quote }}
{{- else -}} {{- else -}}
{{- default "default" .value.name | quote }} {{- default "default" .value.name | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Renders a ServiceAccount for specified name.
Usage:
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.path.to.serviceAccount "context" $) }}
*/}}
{{- define "mongodb-sharded.serviceaccount" -}}
{{- if .value.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "mongodb-sharded.serviceAccountName" (dict "value" .value "context" .context) }}
labels:
{{- include "common.labels.standard" .context | nindent 4 }}
---
{{ end -}}
{{- end -}}
{{- define "mongodb-sharded.secret" -}} {{- define "mongodb-sharded.secret" -}}
{{- if .Values.existingSecret -}} {{- if .Values.auth.existingSecret -}}
{{- .Values.existingSecret -}} {{- .Values.auth.existingSecret -}}
{{- else }} {{- else }}
{{- include "common.names.fullname" . -}} {{- include "common.names.fullname" . -}}
{{- end }} {{- end }}
@@ -103,28 +86,6 @@ Get the initialization scripts configmap name.
{{- printf "%s" (include "common.tplvalues.render" (dict "value" .Values.common.initScriptsCM "context" $)) -}} {{- printf "%s" (include "common.tplvalues.render" (dict "value" .Values.common.initScriptsCM "context" $)) -}}
{{- end -}} {{- end -}}
{{/*
Create the name for the admin secret.
*/}}
{{- define "mongodb-sharded.adminSecret" -}}
{{- if .Values.auth.existingAdminSecret -}}
{{- .Values.auth.existingAdminSecret -}}
{{- else -}}
{{- include "common.names.fullname" . -}}-admin
{{- end -}}
{{- end -}}
{{/*
Create the name for the key secret.
*/}}
{{- define "mongodb-sharded.keySecret" -}}
{{- if .Values.auth.existingKeySecret -}}
{{- .Values.auth.existingKeySecret -}}
{{- else -}}
{{- include "common.names.fullname" . -}}-keyfile
{{- end -}}
{{- end -}}
{{/* {{/*
Returns the proper Service name depending if an explicit service name is set Returns the proper Service name depending if an explicit service name is set
in the values file. If the name is not explicitly set it will take the "common.names.fullname" in the values file. If the name is not explicitly set it will take the "common.names.fullname"
@@ -172,7 +133,10 @@ Compile all warnings into a single message, and call fail.
{{- $messages := list -}} {{- $messages := list -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.mongodbCustomDatabase" .) -}} {{- $messages := append $messages (include "mongodb-sharded.validateValues.mongodbCustomDatabase" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.externalCfgServer" .) -}} {{- $messages := append $messages (include "mongodb-sharded.validateValues.externalCfgServer" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.replicas" .) -}} {{- $messages := append $messages (include "mongodb-sharded.validateValues.replicaCount" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.clusterIPListLength" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.nodePortListLength" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.loadBalancerIPListLength" .) -}}
{{- $messages := append $messages (include "mongodb-sharded.validateValues.config" .) -}} {{- $messages := append $messages (include "mongodb-sharded.validateValues.config" .) -}}
{{- $messages := without $messages "" -}} {{- $messages := without $messages "" -}}
{{- $message := join "\n" $messages -}} {{- $message := join "\n" $messages -}}
@@ -183,15 +147,15 @@ Compile all warnings into a single message, and call fail.
{{- end -}} {{- end -}}
{{/* {{/*
Validate values of MongoDB&reg; - both mongodbUsername and mongodbDatabase are necessary Validate values of MongoDB&reg; - both auth.username and auth.database are necessary
to create a custom user and database during 1st initialization to create a custom user and database during 1st initialization
*/}} */}}
{{- define "mongodb-sharded.validateValues.mongodbCustomDatabase" -}} {{- define "mongodb-sharded.validateValues.mongodbCustomDatabase" -}}
{{- if or (and .Values.mongodbUsername (not .Values.mongodbDatabase)) (and (not .Values.mongodbUsername) .Values.mongodbDatabase) }} {{- if or (and .Values.auth.username (not .Values.auth.database)) (and (not .Values.auth.username) .Values.auth.database) }}
mongodb: mongodbUsername, mongodbDatabase mongodb: auth.username, auth.database
Both mongodbUsername and mongodbDatabase must be provided to create Both auth.username and auth.database must be provided to create
a custom user and database during 1st initialization. a custom user and database during 1st initialization.
Please set both of them (--set mongodbUsername="xxxx",mongodbDatabase="yyyy") Please set both of them (--set auth.username="xxxx",auth.database="yyyy")
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -218,20 +182,20 @@ mongodb: invalidExternalConfigServer
{{- end -}} {{- end -}}
{{/* {{/*
Validate values of MongoDB&reg; - The number of shards must be positive, as well as the data node replicas Validate values of MongoDB&reg; - The number of shards must be positive, as well as the data node replicaCount
*/}} */}}
{{- define "mongodb-sharded.validateValues.replicas" -}} {{- define "mongodb-sharded.validateValues.replicaCount" -}}
{{- if and (le (int .Values.shardsvr.dataNode.replicas) 0) (ge (int .Values.shards) 1) }} {{- if and (le (int .Values.shardsvr.dataNode.replicaCount) 0) (ge (int .Values.shards) 1) }}
mongodb: invalidShardSvrReplicas mongodb: invalidShardSvrReplicas
You specified an invalid number of replicas per shard. Please set shardsvr.dataNode.replicas with a positive number or set the number of shards to 0. You specified an invalid number of replicas per shard. Please set shardsvr.dataNode.replicaCount with a positive number or set the number of shards to 0.
{{- end -}} {{- end -}}
{{- if lt (int .Values.shardsvr.arbiter.replicas) 0 }} {{- if lt (int .Values.shardsvr.arbiter.replicaCount) 0 }}
mongodb: invalidShardSvrArbiters mongodb: invalidShardSvrArbiters
You specified an invalid number of arbiters per shard. Please set shardsvr.arbiter.replicas with a number greater or equal than 0 You specified an invalid number of arbiters per shard. Please set shardsvr.arbiter.replicaCount with a number greater or equal than 0
{{- end -}} {{- end -}}
{{- if and (le (int .Values.configsvr.replicas) 0) (not .Values.configsvr.external.host) }} {{- if and (le (int .Values.configsvr.replicaCount) 0) (not .Values.configsvr.external.host) }}
mongodb: invalidConfigSvrReplicas mongodb: invalidConfigSvrReplicas
You specified an invalid number of replicas per shard. Please set configsvr.replicas with a positive number or set the configsvr.external.host value to use You specified an invalid number of replicas per shard. Please set configsvr.replicaCount with a positive number or set the configsvr.external.host value to use
an external config server replicaset an external config server replicaset
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
@@ -258,6 +222,36 @@ mongodb: configSvrNodeConflictingConfig
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{/* Validate values of MongoDB&reg; - number of replicas must be the same as NodePort list */}}
{{- define "mongodb-sharded.validateValues.nodePortListLength" -}}
{{- $replicaCount := int .Values.mongos.replicaCount }}
{{- $nodePortListLength := len .Values.mongos.servicePerReplica.nodePorts }}
{{- if and .Values.mongos.useStatefulSet .Values.mongos.servicePerReplica.enabled (not (eq $replicaCount $nodePortListLength )) (eq .Values.mongos.servicePerReplica.type "NodePort") -}}
mongodb: .Values.mongos.servicePerReplica.nodePorts
Number of mongos.replicaCount and mongos.servicePerReplica.nodePorts array length must be the same. Currently: replicaCount = {{ $replicaCount }} and nodePorts = {{ $nodePortListLength }}
{{- end -}}
{{- end -}}
{{/* Validate values of MongoDB&reg; - number of replicas must be the same as clusterIP list */}}
{{- define "mongodb-sharded.validateValues.clusterIPListLength" -}}
{{- $replicaCount := int .Values.mongos.replicaCount }}
{{- $clusterIPListLength := len .Values.mongos.servicePerReplica.clusterIPs }}
{{- if and (gt $clusterIPListLength 0) .Values.mongos.useStatefulSet .Values.mongos.servicePerReplica.enabled (not (eq $replicaCount $clusterIPListLength )) (eq .Values.mongos.servicePerReplica.type "ClusterIP") -}}
mongodb: .Values.mongos.servicePerReplica.clusterIPs
Number of mongos.replicaCount and mongos.servicePerReplica.clusterIPs array length must be the same. Currently: replicaCount = {{ $replicaCount }} and clusterIPs = {{ $clusterIPListLength }}
{{- end -}}
{{- end -}}
{{/* Validate values of MongoDB&reg; - number of replicas must be the same as loadBalancerIP list */}}
{{- define "mongodb-sharded.validateValues.loadBalancerIPListLength" -}}
{{- $replicaCount := int .Values.mongos.replicaCount }}
{{- $loadBalancerIPListLength := len .Values.mongos.servicePerReplica.loadBalancerIPs }}
{{- if and (gt $loadBalancerIPListLength 0) .Values.mongos.useStatefulSet .Values.mongos.servicePerReplica.enabled (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.mongos.servicePerReplica.type "LoadBalancer") -}}
mongodb: .Values.mongos.servicePerReplica.loadBalancerIPs
Number of mongos.replicaCount and mongos.servicePerReplica.loadBalancerIPs array length must be the same. Currently: replicaCount = {{ $replicaCount }} and loadBalancerIPs = {{ $loadBalancerIPListLength }}
{{- end -}}
{{- end -}}
{{/* Check if there are rolling tags in the images */}} {{/* Check if there are rolling tags in the images */}}
{{- define "mongodb-sharded.checkRollingTags" -}} {{- define "mongodb-sharded.checkRollingTags" -}}
{{- include "common.warnings.rollingTag" .Values.image }} {{- include "common.warnings.rollingTag" .Values.image }}

View File

@@ -2,9 +2,16 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "common.names.fullname" . }}-configsvr name: {{ printf "%s-configsvr" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: configsvr app.kubernetes.io/component: configsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: data:
mongodb.conf: |- mongodb.conf: |-
{{- include "common.tplvalues.render" (dict "value" .Values.configsvr.config "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.config "context" $) | nindent 4 }}

View File

@@ -1,10 +1,17 @@
{{- if and (not .Values.configsvr.external.host) .Values.configsvr.pdb.enabled -}} {{- if and (not .Values.configsvr.external.host) .Values.configsvr.pdb.create -}}
kind: PodDisruptionBudget kind: PodDisruptionBudget
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
metadata: metadata:
name: {{ include "common.names.fullname" . }}-configsvr name: {{ printf "%s-configsvr" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: configsvr app.kubernetes.io/component: configsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}

View File

@@ -2,17 +2,23 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: PodMonitor kind: PodMonitor
metadata: metadata:
name: {{ include "common.names.fullname" . }}-configsvr name: {{ printf "%s-configsvr" (include "common.names.fullname" .) }}
{{- if .Values.metrics.podMonitor.namespace }} {{- if .Values.metrics.podMonitor.namespace }}
namespace: {{ .Values.metrics.podMonitor.namespace }} namespace: {{ .Values.metrics.podMonitor.namespace | quote }}
{{- else }} {{- else }}
namespace: {{ .Release.Namespace }} namespace: {{ include "common.names.namespace" . | quote }}
{{- end }} {{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: configsvr app.kubernetes.io/component: configsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.metrics.podMonitor.additionalLabels }} {{- if .Values.metrics.podMonitor.additionalLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }} {{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
podMetricsEndpoints: podMetricsEndpoints:
- port: metrics - port: metrics

View File

@@ -2,15 +2,22 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ include "common.names.fullname" . }}-configsvr name: {{ printf "%s-configsvr" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: configsvr app.kubernetes.io/component: configsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: configsvr app.kubernetes.io/component: configsvr
serviceName: {{ include "common.names.fullname" . }}-headless serviceName: {{ printf "%s-headless" (include "common.names.fullname" .) }}
replicas: {{ .Values.configsvr.replicas }} replicas: {{ .Values.configsvr.replicaCount }}
podManagementPolicy: {{ .Values.configsvr.podManagementPolicy }} podManagementPolicy: {{ .Values.configsvr.podManagementPolicy }}
updateStrategy: {{- toYaml .Values.configsvr.updateStrategy | nindent 4 }} updateStrategy: {{- toYaml .Values.configsvr.updateStrategy | nindent 4 }}
template: template:
@@ -20,6 +27,9 @@ spec:
{{- if .Values.configsvr.podLabels }} {{- if .Values.configsvr.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.podLabels "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.podLabels "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.common.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if or .Values.common.podAnnotations .Values.configsvr.podAnnotations .Values.metrics.enabled }} {{- if or .Values.common.podAnnotations .Values.configsvr.podAnnotations .Values.metrics.enabled }}
annotations: annotations:
{{- if .Values.common.podAnnotations }} {{- if .Values.common.podAnnotations }}
@@ -33,10 +43,10 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.common.schedulerName }} {{- if .Values.configsvr.schedulerName }}
schedulerName: {{ .Values.common.schedulerName | quote }} schedulerName: {{ .Values.configsvr.schedulerName | quote }}
{{- end }} {{- end }}
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" .Values.configsvr.serviceAccount "context" $) }} serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "component" "configsvr" "value" .Values.configsvr.serviceAccount "context" $) }}
{{- if .Values.configsvr.hostAliases }} {{- if .Values.configsvr.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.hostAliases "context" $) | nindent 8 }} hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.hostAliases "context" $) | nindent 8 }}
{{- end }} {{- end }}
@@ -57,9 +67,14 @@ spec:
{{- if .Values.configsvr.priorityClassName }} {{- if .Values.configsvr.priorityClassName }}
priorityClassName: {{ .Values.configsvr.priorityClassName | quote }} priorityClassName: {{ .Values.configsvr.priorityClassName | quote }}
{{- end }} {{- end }}
{{- if .Values.securityContext.enabled }} {{- if .Values.configsvr.topologySpreadConstraints }}
securityContext: topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.topologySpreadConstraints "context" .) | nindent 8 }}
fsGroup: {{ .Values.securityContext.fsGroup }} {{- end }}
{{- if .Values.configsvr.podSecurityContext.enabled }}
securityContext: {{- omit .Values.configsvr.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.configsvr.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.configsvr.terminationGracePeriodSeconds }}
{{- end }} {{- end }}
{{- include "mongodb-sharded.imagePullSecrets" . | nindent 6 }} {{- include "mongodb-sharded.imagePullSecrets" . | nindent 6 }}
initContainers: initContainers:
@@ -67,13 +82,23 @@ spec:
- name: volume-permissions - name: volume-permissions
image: {{ include "mongodb-sharded.volumePermissions.image" . }} image: {{ include "mongodb-sharded.volumePermissions.image" . }}
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }} imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}", "{{ .Values.configsvr.persistence.mountPath }}"] command:
- /bin/bash
args:
- -ec
- |
mkdir -p {{ .Values.configsvr.persistence.mountPath }}{{- if .Values.configsvr.persistence.subPath }}/{{ .Values.configsvr.persistence.subPath }}{{- end }}
chmod 700 {{ .Values.configsvr.persistence.mountPath }}
find {{ .Values.configsvr.persistence.mountPath }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" | xargs -r chown -R {{ .Values.configsvr.containerSecurityContext.runAsUser }}:{{ .Values.configsvr.podSecurityContext.fsGroup }}
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
resources: {{ toYaml .Values.volumePermissions.resources | nindent 12 }} resources: {{ toYaml .Values.volumePermissions.resources | nindent 12 }}
volumeMounts: volumeMounts:
- name: datadir - name: datadir
mountPath: {{ .Values.configsvr.persistence.mountPath }} mountPath: {{ .Values.configsvr.persistence.mountPath }}
{{- if .Values.configsvr.persistence.subPath }}
subPath: {{ .Values.configsvr.persistence.subPath }}
{{- end }}
{{- end }} {{- end }}
{{- with .Values.configsvr.initContainers }} {{- with .Values.configsvr.initContainers }}
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
@@ -85,13 +110,11 @@ spec:
- name: mongodb - name: mongodb
image: {{ include "mongodb-sharded.image" . }} image: {{ include "mongodb-sharded.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }} imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.securityContext.enabled }} {{- if .Values.configsvr.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit .Values.configsvr.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }} {{- end }}
ports: ports:
- containerPort: {{ .Values.common.containerPorts.mongo }} - containerPort: {{ .Values.common.containerPorts.mongodb }}
name: mongodb name: mongodb
env: env:
- name: MONGODB_ENABLE_NUMACTL - name: MONGODB_ENABLE_NUMACTL
@@ -101,7 +124,7 @@ spec:
- name: MONGODB_SYSTEM_LOG_VERBOSITY - name: MONGODB_SYSTEM_LOG_VERBOSITY
value: {{ .Values.common.mongodbSystemLogVerbosity | quote }} value: {{ .Values.common.mongodbSystemLogVerbosity | quote }}
- name: MONGODB_DISABLE_SYSTEM_LOG - name: MONGODB_DISABLE_SYSTEM_LOG
{{- if .Values.mongodbDisableSystemLog }} {{- if .Values.common.mongodbDisableSystemLog }}
value: "yes" value: "yes"
{{- else }} {{- else }}
value: "no" value: "no"
@@ -115,16 +138,19 @@ spec:
fieldRef: fieldRef:
fieldPath: metadata.name fieldPath: metadata.name
- name: MONGODB_PORT_NUMBER - name: MONGODB_PORT_NUMBER
value: {{ .Values.common.containerPorts.mongo | quote }} value: {{ .Values.common.containerPorts.mongodb | quote }}
- name: MONGODB_INITIAL_PRIMARY_HOST - name: MONGODB_INITIAL_PRIMARY_HOST
value: {{ include "mongodb-sharded.configServer.primaryHost" . }} value: {{ include "mongodb-sharded.configServer.primaryHost" . }}
- name: MONGODB_REPLICA_SET_NAME - name: MONGODB_REPLICA_SET_NAME
value: {{ printf "%s-configsvr" ( include "common.names.fullname" . ) }} value: {{ printf "%s-configsvr" ( include "common.names.fullname" . ) }}
{{- if .Values.common.useHostnames }} {{- if .Values.common.useHostnames }}
- name: MONGODB_ADVERTISED_HOSTNAME - name: MONGODB_ADVERTISED_HOSTNAME
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}" value: {{ printf "$(MONGODB_POD_NAME).%s-headless.%s.svc.%s" (include "common.names.fullname" .) (include "common.names.namespace" .) .Values.clusterDomain }}
{{- end }} {{- end }}
{{- if .Values.usePasswordFile }} {{- if .Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if .Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
- name: MONGODB_REPLICA_SET_KEY_FILE - name: MONGODB_REPLICA_SET_KEY_FILE
@@ -141,6 +167,7 @@ spec:
name: {{ include "mongodb-sharded.secret" . }} name: {{ include "mongodb-sharded.secret" . }}
key: mongodb-replica-set-key key: mongodb-replica-set-key
{{- end }} {{- end }}
{{- end }}
- name: MONGODB_ENABLE_IPV6 - name: MONGODB_ENABLE_IPV6
{{- if .Values.common.mongodbEnableIPv6 }} {{- if .Values.common.mongodbEnableIPv6 }}
value: "yes" value: "yes"
@@ -186,47 +213,55 @@ spec:
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else }} {{- else }}
command: {{- if .Values.configsvr.command }}
- /bin/bash command: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.command "context" $) | nindent 12 }}
- /entrypoint/replicaset-entrypoint.sh
{{- end }} {{- end }}
{{- if not .Values.diagnosticMode.enabled }} {{- if .Values.configsvr.args }}
{{- if .Values.livenessProbe.enabled }} args: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.args "context" $) | nindent 12 }}
livenessProbe: {{- end }}
{{- if .Values.configsvr.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.configsvr.livenessProbe "enabled") "context" $) | nindent 12 }}
exec: exec:
command: command:
- pgrep - pgrep
- mongod - mongod
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} {{- else if .Values.configsvr.customLivenessProbe }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if .Values.readinessProbe.enabled }} {{- if .Values.configsvr.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.configsvr.readinessProbe "enabled") "context" $) | nindent 12 }}
exec: exec:
command: command:
- mongosh - /bin/sh
- --eval - -c
- "db.adminCommand('ping')" - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')"
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} {{- else if .Values.configsvr.customReadinessProbe }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if .Values.configsvr.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.configsvr.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: mongodb
{{- else if .Values.configsvr.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.configsvr.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if $.Values.configsvr.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" $.Values.configsvr.lifecycleHooks "context" $) | nindent 12 }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: replicaset-entrypoint-configmap - name: replicaset-entrypoint-configmap
mountPath: /entrypoint mountPath: /entrypoint
- name: datadir - name: datadir
mountPath: {{ .Values.configsvr.persistence.mountPath }} mountPath: {{ .Values.configsvr.persistence.mountPath }}
{{- if .Values.configsvr.persistence.subPath }}
subPath: {{ .Values.configsvr.persistence.subPath }}
{{- end }}
{{- if or .Values.configsvr.config .Values.configsvr.configCM }} {{- if or .Values.configsvr.config .Values.configsvr.configCM }}
- name: config - name: config
mountPath: /bitnami/mongodb/conf/ mountPath: /bitnami/mongodb/conf/
{{- end }} {{- end }}
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
@@ -249,13 +284,14 @@ spec:
- name: metrics - name: metrics
image: {{ include "mongodb-sharded.metrics.image" . }} image: {{ include "mongodb-sharded.metrics.image" . }}
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
{{- if .Values.securityContext.enabled }} {{- if .Values.metrics.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }} {{- end }}
env: env:
{{- if .Values.usePasswordFile }} {{- if .Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if .Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
{{- else }} {{- else }}
@@ -265,6 +301,7 @@ spec:
name: {{ include "mongodb-sharded.secret" . }} name: {{ include "mongodb-sharded.secret" . }}
key: mongodb-root-password key: mongodb-root-password
{{- end }} {{- end }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }} {{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
@@ -274,41 +311,42 @@ spec:
- -ec - -ec
- |- - |-
#!/bin/sh #!/bin/sh
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
{{- end }} {{- end }}
/bin/mongodb_exporter --web.listen-address ":{{ .Values.metrics.containerPort }}" --mongodb.uri mongodb://root:`echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g"`@localhost:{{ .Values.service.port }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }} /bin/mongodb_exporter --web.listen-address ":{{ .Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ .Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }}
{{- end }} {{- end }}
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
volumeMounts: volumeMounts:
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
ports: ports:
- name: metrics - name: metrics
containerPort: {{ .Values.metrics.containerPort }} containerPort: {{ .Values.metrics.containerPorts.metrics }}
{{- if not .Values.diagnosticMode.enabled }} {{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.metrics.livenessProbe.enabled }} {{- if .Values.metrics.livenessProbe.enabled }}
livenessProbe: livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ .Values.metrics.livenessProbe.initialDelaySeconds }} {{- else if .Values.metrics.customLivenessProbe }}
periodSeconds: {{ .Values.metrics.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.metrics.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.metrics.livenessProbe.failureThreshold }}
successThreshold: {{ .Values.metrics.livenessProbe.successThreshold }}
{{- end }} {{- end }}
{{- if .Values.metrics.readinessProbe.enabled }} {{- if .Values.metrics.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ .Values.metrics.readinessProbe.initialDelaySeconds }} {{- else if .Values.metrics.customReadinessProbe }}
periodSeconds: {{ .Values.metrics.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.metrics.readinessProbe.timeoutSeconds }} {{- end }}
failureThreshold: {{ .Values.metrics.readinessProbe.failureThreshold }} {{- if .Values.metrics.startupProbe.enabled }}
successThreshold: {{ .Values.metrics.readinessProbe.successThreshold }} startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: metrics
{{- else if .Values.metrics.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
resources: {{ toYaml .Values.metrics.resources | nindent 12 }} resources: {{ toYaml .Values.metrics.resources | nindent 12 }}
@@ -322,8 +360,8 @@ spec:
volumes: volumes:
- name: replicaset-entrypoint-configmap - name: replicaset-entrypoint-configmap
configMap: configMap:
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint name: {{ printf "%s-replicaset-entrypoint" (include "common.names.fullname" .) }}
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
- name: secrets - name: secrets
secret: secret:
secretName: {{ include "mongodb-sharded.secret" . }} secretName: {{ include "mongodb-sharded.secret" . }}
@@ -351,13 +389,23 @@ spec:
{{- if .Values.configsvr.extraVolumes }} {{- if .Values.configsvr.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.extraVolumes "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.extraVolumes "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
{{- if .Values.configsvr.persistence.enabled }} {{- if and .Values.configsvr.persistence.enabled }}
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - metadata:
name: datadir name: datadir
{{- if or .Values.configsvr.persistence.annotations .Values.commonAnnotations .Values.configsvr.persistence.resourcePolicy }}
{{- if or .Values.commonAnnotations .Values.configsvr.persistence.annotations .Values.configsvr.persistence.resourcePolicy }}
annotations: annotations:
{{- range $key, $value := .Values.configsvr.persistence.annotations }} {{- if .Values.commonAnnotations }}
{{ $key }}: "{{ $value }}" {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 10 }}
{{- end }}
{{- if .Values.configsvr.persistence.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.configsvr.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.configsvr.persistence.resourcePolicy }}
helm.sh/resource-policy: {{ .Values.configsvr.persistence.resourcePolicy | quote }}
{{- end }}
{{- end }}
{{- end }} {{- end }}
spec: spec:
accessModes: accessModes:

View File

@@ -1,15 +1,22 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "common.names.fullname" . }}-headless name: {{ printf "%s-headless" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }} annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
type: ClusterIP type: ClusterIP
clusterIP: None clusterIP: None
ports: ports:
- name: mongodb - name: mongodb
port: {{ .Values.service.port }} port: {{ .Values.service.ports.mongodb }}
{{- if .Values.service.extraPorts }} {{- if .Values.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
{{- end }} {{- end }}

View File

@@ -2,9 +2,16 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "common.names.fullname" . }}-mongos name: {{ printf "%s-mongos" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: data:
mongodb.conf: |- mongodb.conf: |-
{{- include "common.tplvalues.render" (dict "value" .Values.mongos.config "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.mongos.config "context" $) | nindent 4 }}

View File

@@ -1,9 +1,16 @@
apiVersion: {{ if .Values.mongos.useStatefulSet }}{{ include "common.capabilities.statefulset.apiVersion" . }}{{- else }}{{ include "common.capabilities.deployment.apiVersion" . }}{{- end }} apiVersion: {{ if .Values.mongos.useStatefulSet }}{{ include "common.capabilities.statefulset.apiVersion" . }}{{- else }}{{ include "common.capabilities.deployment.apiVersion" . }}{{- end }}
kind: {{ if .Values.mongos.useStatefulSet }}StatefulSet{{- else }}Deployment{{- end }} kind: {{ if .Values.mongos.useStatefulSet }}StatefulSet{{- else }}Deployment{{- end }}
metadata: metadata:
name: {{ include "common.names.fullname" . }}-mongos name: {{ printf "%s-mongos" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
{{- if .Values.mongos.useStatefulSet }} {{- if .Values.mongos.useStatefulSet }}
serviceName: {{ include "mongodb-sharded.serviceName" . }} serviceName: {{ include "mongodb-sharded.serviceName" . }}
@@ -13,7 +20,7 @@ spec:
strategy: strategy:
{{- end }} {{- end }}
{{- toYaml .Values.mongos.updateStrategy | nindent 4 }} {{- toYaml .Values.mongos.updateStrategy | nindent 4 }}
replicas: {{ .Values.mongos.replicas }} replicas: {{ .Values.mongos.replicaCount }}
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
@@ -21,6 +28,9 @@ spec:
metadata: metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }} labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if .Values.common.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if .Values.mongos.podLabels }} {{- if .Values.mongos.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.mongos.podLabels "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" .Values.mongos.podLabels "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
@@ -37,10 +47,10 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
spec: spec:
{{- if .Values.common.schedulerName }} {{- if .Values.mongos.schedulerName }}
schedulerName: {{ .Values.common.schedulerName | quote }} schedulerName: {{ .Values.mongos.schedulerName | quote }}
{{- end }} {{- end }}
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.mongos.serviceAccount "context" $) }} serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "component" "mongos" "value" $.Values.mongos.serviceAccount "context" $) }}
{{- if .Values.mongos.hostAliases }} {{- if .Values.mongos.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.hostAliases "context" $) | nindent 8 }} hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.hostAliases "context" $) | nindent 8 }}
{{- end }} {{- end }}
@@ -61,9 +71,14 @@ spec:
{{- if .Values.mongos.priorityClassName }} {{- if .Values.mongos.priorityClassName }}
priorityClassName: {{ .Values.mongos.priorityClassName | quote }} priorityClassName: {{ .Values.mongos.priorityClassName | quote }}
{{- end }} {{- end }}
{{- if .Values.securityContext.enabled }} {{- if .Values.mongos.topologySpreadConstraints }}
securityContext: topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.topologySpreadConstraints "context" .) | nindent 8 }}
fsGroup: {{ .Values.securityContext.fsGroup }} {{- end }}
{{- if .Values.mongos.podSecurityContext.enabled }}
securityContext: {{- omit .Values.mongos.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.mongos.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.mongos.terminationGracePeriodSeconds }}
{{- end }} {{- end }}
{{- include "mongodb-sharded.imagePullSecrets" . | nindent 6 }} {{- include "mongodb-sharded.imagePullSecrets" . | nindent 6 }}
{{- if or $.Values.mongos.initContainers $.Values.common.initContainers }} {{- if or $.Values.mongos.initContainers $.Values.common.initContainers }}
@@ -79,10 +94,8 @@ spec:
- name: mongos - name: mongos
image: {{ include "mongodb-sharded.image" . }} image: {{ include "mongodb-sharded.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy | quote }} imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
{{- if .Values.securityContext.enabled }} {{- if .Values.mongos.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit .Values.mongos.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }} {{- end }}
env: env:
- name: MONGODB_ENABLE_NUMACTL - name: MONGODB_ENABLE_NUMACTL
@@ -93,7 +106,10 @@ spec:
value: "mongos" value: "mongos"
- name: MONGODB_MAX_TIMEOUT - name: MONGODB_MAX_TIMEOUT
value: {{ .Values.common.mongodbMaxWaitTimeout | quote }} value: {{ .Values.common.mongodbMaxWaitTimeout | quote }}
{{- if .Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if .Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
- name: MONGODB_REPLICA_SET_KEY_FILE - name: MONGODB_REPLICA_SET_KEY_FILE
@@ -110,6 +126,7 @@ spec:
name: {{ include "mongodb-sharded.secret" . }} name: {{ include "mongodb-sharded.secret" . }}
key: mongodb-replica-set-key key: mongodb-replica-set-key
{{- end }} {{- end }}
{{- end }}
- name: MONGODB_POD_NAME - name: MONGODB_POD_NAME
valueFrom: valueFrom:
fieldRef: fieldRef:
@@ -119,7 +136,7 @@ spec:
value: "$(MONGODB_POD_NAME)" value: "$(MONGODB_POD_NAME)"
{{- end }} {{- end }}
- name: MONGODB_PORT_NUMBER - name: MONGODB_PORT_NUMBER
value: {{ $.Values.common.containerPorts.mongo | quote }} value: {{ $.Values.common.containerPorts.mongodb | quote }}
- name: MONGODB_CFG_PRIMARY_HOST - name: MONGODB_CFG_PRIMARY_HOST
value: {{ include "mongodb-sharded.configServer.primaryHost" . }} value: {{ include "mongodb-sharded.configServer.primaryHost" . }}
- name: MONGODB_CFG_REPLICA_SET_NAME - name: MONGODB_CFG_REPLICA_SET_NAME
@@ -127,7 +144,7 @@ spec:
- name: MONGODB_SYSTEM_LOG_VERBOSITY - name: MONGODB_SYSTEM_LOG_VERBOSITY
value: {{ .Values.common.mongodbSystemLogVerbosity | quote }} value: {{ .Values.common.mongodbSystemLogVerbosity | quote }}
- name: MONGODB_DISABLE_SYSTEM_LOG - name: MONGODB_DISABLE_SYSTEM_LOG
{{- if .Values.mongodbDisableSystemLog }} {{- if .Values.common.mongodbDisableSystemLog }}
value: "yes" value: "yes"
{{- else }} {{- else }}
value: "no" value: "no"
@@ -173,43 +190,52 @@ spec:
name: {{ include "common.tplvalues.render" ( dict "value" .Values.mongos.extraEnvVarsSecret "context" $ ) }} name: {{ include "common.tplvalues.render" ( dict "value" .Values.mongos.extraEnvVarsSecret "context" $ ) }}
{{- end }} {{- end }}
{{- end }} {{- end }}
ports:
- name: mongodb
containerPort: {{ $.Values.common.containerPorts.mongodb }}
{{- if .Values.diagnosticMode.enabled }} {{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else }}
{{- if .Values.mongos.command }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.command "context" $) | nindent 12 }}
{{- end }} {{- end }}
ports: {{- if .Values.mongos.args }}
- name: mongodb args: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.args "context" $) | nindent 12 }}
containerPort: {{ $.Values.common.containerPorts.mongo }} {{- end }}
{{- if not .Values.diagnosticMode.enabled }} {{- if .Values.mongos.livenessProbe.enabled }}
{{- if .Values.livenessProbe.enabled }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.mongos.livenessProbe "enabled") "context" $) | nindent 12 }}
livenessProbe:
exec: exec:
command: command:
- mongosh - /bin/sh
- --eval - -c
- "db.adminCommand('ping')" - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')"
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} {{- else if .Value.mongos.customLivenessProbe }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if .Values.readinessProbe.enabled }} {{- if .Values.mongos.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.mongos.readinessProbe "enabled") "context" $) | nindent 12 }}
exec: exec:
command: command:
- mongosh - /bin/sh
- --eval - -c
- "db.adminCommand('ping')" - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')"
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} {{- else if .Value.mongos.customReadinessProbe }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if .Values.mongos.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.mongos.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: mongodb
{{- else if .Values.mongos.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if .Values.mongos.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.lifecycleHooks "context" $) | nindent 12 }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
@@ -228,13 +254,14 @@ spec:
- name: metrics - name: metrics
image: {{ include "mongodb-sharded.metrics.image" . }} image: {{ include "mongodb-sharded.metrics.image" . }}
imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }} imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
{{- if .Values.securityContext.enabled }} {{- if .Values.metrics.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit .Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }} {{- end }}
env: env:
{{- if .Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if .Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
{{- else }} {{- else }}
@@ -244,6 +271,7 @@ spec:
name: {{ include "mongodb-sharded.secret" . }} name: {{ include "mongodb-sharded.secret" . }}
key: mongodb-root-password key: mongodb-root-password
{{- end }} {{- end }}
{{- end }}
{{- if .Values.diagnosticMode.enabled }} {{- if .Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
@@ -253,41 +281,42 @@ spec:
- -ec - -ec
- |- - |-
#!/bin/sh #!/bin/sh
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
{{- end }} {{- end }}
/bin/mongodb_exporter --web.listen-address ":{{ .Values.metrics.containerPort }}" --mongodb.uri mongodb://root:`echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g"`@localhost:{{ .Values.service.port }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }} /bin/mongodb_exporter --web.listen-address ":{{ .Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ .Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ .Values.metrics.extraArgs }}
{{- end }} {{- end }}
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
volumeMounts: volumeMounts:
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
ports: ports:
- name: metrics - name: metrics
containerPort: {{ .Values.metrics.containerPort }} containerPort: {{ .Values.metrics.containerPorts.metrics }}
{{- if not .Values.diagnosticMode.enabled }} {{- if not .Values.diagnosticMode.enabled }}
{{- if .Values.metrics.livenessProbe.enabled }} {{- if .Values.metrics.livenessProbe.enabled }}
livenessProbe: livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ .Values.metrics.livenessProbe.initialDelaySeconds }} {{- else if .Values.metrics.customLivenessProbe }}
periodSeconds: {{ .Values.metrics.readinessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.metrics.livenessProbe.timeoutSeconds }}
failureThreshold: {{ .Values.metrics.livenessProbe.failureThreshold }}
successThreshold: {{ .Values.metrics.livenessProbe.successThreshold }}
{{- end }} {{- end }}
{{- if .Values.metrics.readinessProbe.enabled }} {{- if .Values.metrics.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ .Values.metrics.readinessProbe.initialDelaySeconds }} {{- else if .Values.metrics.customReadinessProbe }}
periodSeconds: {{ .Values.metrics.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ .Values.metrics.readinessProbe.timeoutSeconds }} {{- end }}
failureThreshold: {{ .Values.metrics.readinessProbe.failureThreshold }} {{- if .Values.metrics.startupProbe.enabled }}
successThreshold: {{ .Values.metrics.readinessProbe.successThreshold }} startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: metrics
{{- else if .Values.metrics.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.customStartupProbe "context" $) | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
resources: {{- toYaml .Values.metrics.resources | nindent 12 }} resources: {{- toYaml .Values.metrics.resources | nindent 12 }}
@@ -299,7 +328,7 @@ spec:
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
volumes: volumes:
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
- name: secrets - name: secrets
secret: secret:
secretName: {{ include "mongodb-sharded.secret" . }} secretName: {{ include "mongodb-sharded.secret" . }}

View File

@@ -1,10 +1,17 @@
{{- if .Values.mongos.pdb.enabled -}} {{- if .Values.mongos.pdb.create -}}
kind: PodDisruptionBudget kind: PodDisruptionBudget
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
metadata: metadata:
name: {{ include "common.names.fullname" . }}-mongos name: {{ printf "%s-mongos" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}

View File

@@ -2,17 +2,23 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: PodMonitor kind: PodMonitor
metadata: metadata:
name: {{ include "common.names.fullname" . }}-mongos name: {{ printf "%s-mongos" (include "common.names.fullname" .) }}
{{- if .Values.metrics.podMonitor.namespace }} {{- if .Values.metrics.podMonitor.namespace }}
namespace: {{ .Values.metrics.podMonitor.namespace }} namespace: {{ .Values.metrics.podMonitor.namespace | quote }}
{{- else }} {{- else }}
namespace: {{ .Release.Namespace }} namespace: {{ include "common.names.namespace" . | quote }}
{{- end }} {{- end }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.metrics.podMonitor.additionalLabels }} {{- if .Values.metrics.podMonitor.additionalLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }} {{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
podMetricsEndpoints: podMetricsEndpoints:
- port: metrics - port: metrics

View File

@@ -1,18 +1,35 @@
{{- if and .Values.mongos.useStatefulSet .Values.mongos.servicePerReplica.enabled }} {{- if and .Values.mongos.useStatefulSet .Values.mongos.servicePerReplica.enabled }}
{{- range $i := until (.Values.mongos.replicas | int) }} {{- range $i := until (.Values.mongos.replicaCount | int) }}
{{- $context := deepCopy $ | merge (dict "index" $i) }} {{- $context := deepCopy $ | merge (dict "index" $i) }}
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "mongodb-sharded.serviceName" $ }}-{{ $i }} name: {{ printf "%s-%d" (include "mongodb-sharded.serviceName" $) $i }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{ include "common.labels.standard" $ | nindent 4 }} labels: {{ include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $context ) | nindent 4 }}
{{- end }}
annotations: {{- include "common.tplvalues.render" (dict "value" $.Values.mongos.servicePerReplica.annotations "context" $context) | nindent 4 }} annotations: {{- include "common.tplvalues.render" (dict "value" $.Values.mongos.servicePerReplica.annotations "context" $context) | nindent 4 }}
{{- if $.Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $context ) | nindent 4 }}
{{- end }}
spec: spec:
type: {{ $.Values.mongos.servicePerReplica.type }} type: {{ $.Values.mongos.servicePerReplica.type }}
{{- if and $.Values.mongos.servicePerReplica.loadBalancerIP (eq $.Values.mongos.servicePerReplica.type "LoadBalancer") }} sessionAffinity: {{ default "None" $.Values.mongos.servicePerReplica.sessionAffinity }}
loadBalancerIP: {{ $.Values.mongos.servicePerReplica.loadBalancerIP }} {{- if $.Values.mongos.servicePerReplica.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.mongos.servicePerReplica.sessionAffinityConfig "context" $context) | nindent 4 }}
{{- end }}
{{- if or (eq $.Values.mongos.servicePerReplica.type "LoadBalancer") (eq $.Values.mongos.servicePerReplica.type "NodePort") }}
externalTrafficPolicy: {{ $.Values.mongos.servicePerReplica.externalTrafficPolicy | quote }}
{{- end }}
{{- if $.Values.mongos.servicePerReplica.externalIPs }}
externalIPs: {{- toYaml $.Values.mongos.servicePerReplica.externalIPs | nindent 4 }}
{{- end }}
{{- if and $.Values.mongos.servicePerReplica.loadBalancerIPs (eq $.Values.mongos.servicePerReplica.type "LoadBalancer") }}
loadBalancerIP: {{ index $.Values.mongos.servicePerReplica.loadBalancerIPs $i }}
{{- end }} {{- end }}
{{- if and (eq $.Values.mongos.servicePerReplica.type "LoadBalancer") $.Values.mongos.servicePerReplica.loadBalancerSourceRanges }} {{- if and (eq $.Values.mongos.servicePerReplica.type "LoadBalancer") $.Values.mongos.servicePerReplica.loadBalancerSourceRanges }}
loadBalancerSourceRanges: loadBalancerSourceRanges:
@@ -20,15 +37,15 @@ spec:
{{ include "common.tplvalues.render" . | nindent 4 }} {{ include "common.tplvalues.render" . | nindent 4 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if and (eq $.Values.mongos.servicePerReplica.type "ClusterIP") $.Values.mongos.servicePerReplica.clusterIP }} {{- if and (eq $.Values.mongos.servicePerReplica.type "ClusterIP") $.Values.mongos.servicePerReplica.clusterIPs }}
clusterIP: {{ $.Values.mongos.servicePerReplica.clusterIP }} clusterIP: {{ index $.Values.mongos.servicePerReplica.clusterIPs $i }}
{{- end }} {{- end }}
ports: ports:
- name: mongodb - name: mongodb
port: {{ $.Values.mongos.servicePerReplica.port }} port: {{ $.Values.mongos.servicePerReplica.port }}
targetPort: mongodb targetPort: mongodb
{{- if $.Values.mongos.servicePerReplica.nodePort }} {{- if $.Values.mongos.servicePerReplica.nodePorts }}
nodePort: {{ $.Values.mongos.servicePerReplica.nodePort }} nodePort: {{ index $.Values.mongos.servicePerReplica.nodePorts $i }}
{{- else if eq $.Values.mongos.servicePerReplica.type "ClusterIP" }} {{- else if eq $.Values.mongos.servicePerReplica.type "ClusterIP" }}
nodePort: null nodePort: null
{{- end }} {{- end }}
@@ -42,7 +59,6 @@ spec:
{{- end }} {{- end }}
selector: {{ include "common.labels.matchLabels" $ | nindent 4 }} selector: {{ include "common.labels.matchLabels" $ | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
statefulset.kubernetes.io/pod-name: {{ include "common.names.fullname" $ }}-mongos-{{ $i }} statefulset.kubernetes.io/pod-name: {{ printf "%s-mongos-%d" (include "common.names.fullname" $) $i }}
sessionAffinity: {{ default "None" $.Values.mongos.servicePerReplica.sessionAffinity }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -2,9 +2,16 @@ apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ include "mongodb-sharded.serviceName" . }} name: {{ include "mongodb-sharded.serviceName" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{ include "common.labels.standard" . | nindent 4 }} labels: {{ include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }} {{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
type: {{ .Values.service.type }} type: {{ .Values.service.type }}
{{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }} {{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
@@ -24,10 +31,10 @@ spec:
{{- end }} {{- end }}
ports: ports:
- name: mongodb - name: mongodb
port: {{ .Values.service.port }} port: {{ .Values.service.ports.mongodb }}
targetPort: mongodb targetPort: mongodb
{{- if .Values.service.nodePort }} {{- if .Values.service.nodePorts.mongodb }}
nodePort: {{ .Values.service.nodePort }} nodePort: {{ .Values.service.nodePorts.mongodb }}
{{- else if eq .Values.service.type "ClusterIP" }} {{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null nodePort: null
{{- end }} {{- end }}
@@ -42,3 +49,9 @@ spec:
selector: {{ include "common.labels.matchLabels" . | nindent 4 }} selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: mongos app.kubernetes.io/component: mongos
sessionAffinity: {{ default "None" .Values.service.sessionAffinity }} sessionAffinity: {{ default "None" .Values.service.sessionAffinity }}
{{- if .Values.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
{{- end }}

View File

@@ -1,8 +1,15 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "common.names.fullname" . }}-replicaset-entrypoint name: {{ printf "%s-replicaset-entrypoint" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: data:
replicaset-entrypoint.sh: |- replicaset-entrypoint.sh: |-
#!/bin/bash #!/bin/bash
@@ -18,7 +25,7 @@ data:
else else
info "Setting node as secondary" info "Setting node as secondary"
export MONGODB_REPLICA_SET_MODE=secondary export MONGODB_REPLICA_SET_MODE=secondary
{{- if .Values.usePasswordFile }} {{- if .Values.auth.usePasswordFile }}
export MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE="$MONGODB_ROOT_PASSWORD_FILE" export MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE="$MONGODB_ROOT_PASSWORD_FILE"
unset MONGODB_ROOT_PASSWORD_FILE unset MONGODB_ROOT_PASSWORD_FILE
{{- else }} {{- else }}

View File

@@ -1,29 +1,37 @@
{{- if not .Values.existingSecret }} {{- if not .Values.auth.existingSecret }}
apiVersion: v1 apiVersion: v1
kind: Secret kind: Secret
metadata: metadata:
name: {{ include "common.names.fullname" . }} name: {{ include "common.names.fullname" . }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }} labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: mongodb
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque type: Opaque
data: data:
{{- if .Values.configsvr.external.rootPassword }} {{- if .Values.configsvr.external.rootPassword }}
mongodb-root-password: {{ .Values.configsvr.external.rootPassword | b64enc | quote }} mongodb-root-password: {{ .Values.configsvr.external.rootPassword | b64enc | quote }}
{{- else if .Values.mongodbRootPassword }} {{- else if .Values.auth.rootPassword }}
mongodb-root-password: {{ .Values.mongodbRootPassword | b64enc | quote }} mongodb-root-password: {{ .Values.auth.rootPassword | b64enc | quote }}
{{- else }} {{- else }}
mongodb-root-password: {{ randAlphaNum 10 | b64enc | quote }} mongodb-root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }} {{- end }}
{{- if and .Values.mongodbUsername .Values.mongodbDatabase }} {{- if and .Values.auth.username .Values.auth.database }}
{{- if .Values.mongodbPassword }} {{- if .Values.auth.password }}
mongodb-password: {{ .Values.mongodbPassword | b64enc | quote }} mongodb-password: {{ .Values.auth.password | b64enc | quote }}
{{- else }} {{- else }}
mongodb-password: {{ randAlphaNum 10 | b64enc | quote }} mongodb-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if .Values.configsvr.external.replicasetKey }} {{- if .Values.configsvr.external.replicasetKey }}
mongodb-replica-set-key: {{ .Values.configsvr.external.replicasetKey | b64enc | quote }} mongodb-replica-set-key: {{ .Values.configsvr.external.replicasetKey | b64enc | quote }}
{{- else if .Values.replicaSetKey }} {{- else if .Values.auth.replicaSetKey }}
mongodb-replica-set-key: {{ .Values.replicaSetKey | b64enc | quote }} mongodb-replica-set-key: {{ .Values.auth.replicaSetKey | b64enc | quote }}
{{- else }} {{- else }}
mongodb-replica-set-key: {{ randAlphaNum 10 | b64enc | quote }} mongodb-replica-set-key: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }} {{- end }}

View File

@@ -1,5 +1,25 @@
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.common.serviceAccount "context" $) }} {{- range $component,$serviceAccount:=(dict "common" .Values.common.serviceAccount "mongos" .Values.mongos.serviceAccount "configsvr" .Values.configsvr.serviceAccount "shardsvr-arbiter" .Values.shardsvr.arbiter.serviceAccount "shardsvr" .Values.shardsvr.dataNode.serviceAccount) }}
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.mongos.serviceAccount "context" $) }} {{- if $serviceAccount.create }}
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.configsvr.serviceAccount "context" $) }} apiVersion: v1
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.shardsvr.arbiter.serviceAccount "context" $) }} kind: ServiceAccount
{{ include "mongodb-sharded.serviceaccount" (dict "value" .Values.shardsvr.dataNode.serviceAccount "context" $) }} metadata:
name: {{ include "mongodb-sharded.serviceAccountName" (dict "component" $component "value" $serviceAccount "context" $) }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: {{ $component }}
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if or $serviceAccount.annotations $.Values.commonAnnotations }}
annotations:
{{- if $.Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if $serviceAccount.annotations }}
{{- include "common.tplvalues.render" (dict "value" $serviceAccount.annotations "context" $) | nindent 4 }}
{{- end }}
{{- end }}
automountServiceAccountToken: {{ $serviceAccount.automountServiceAccountToken }}
---
{{- end }}
{{- end }}

View File

@@ -1,10 +1,17 @@
{{- if and .Values.shards .Values.shardsvr.arbiter.replicas .Values.shardsvr.arbiter.config }} {{- if and .Values.shards .Values.shardsvr.arbiter.replicaCount .Values.shardsvr.arbiter.config }}
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "common.names.fullname" . }}-shardsvr-arbiter name: {{ printf "%s-shardsvr-arbiter" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: shardsvr-arbiter app.kubernetes.io/component: shardsvr-arbiter
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: data:
mongodb.conf: |- mongodb.conf: |-
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.arbiter.config "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.arbiter.config "context" $) | nindent 4 }}

View File

@@ -1,24 +1,34 @@
{{- if and .Values.shards .Values.shardsvr.arbiter.replicas }} {{- if and .Values.shards .Values.shardsvr.arbiter.replicaCount }}
{{- $replicas := $.Values.shards | int }} {{- $replicas := $.Values.shards | int }}
{{- range $i, $e := until $replicas }} {{- range $i, $e := until $replicas }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ printf "%s-shard%d-arbiter" (include "common.names.fullname" $ ) $i }} name: {{ printf "%s-shard%d-arbiter" (include "common.names.fullname" $ ) $i }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }} labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: shardsvr-arbiter app.kubernetes.io/component: shardsvr-arbiter
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
app.kubernetes.io/component: shardsvr-arbiter app.kubernetes.io/component: shardsvr-arbiter
podManagementPolicy: {{ $.Values.shardsvr.arbiter.podManagementPolicy }} podManagementPolicy: {{ $.Values.shardsvr.arbiter.podManagementPolicy }}
updateStrategy: {{- toYaml $.Values.shardsvr.arbiter.updateStrategy | nindent 4 }} updateStrategy: {{- toYaml $.Values.shardsvr.arbiter.updateStrategy | nindent 4 }}
serviceName: {{ include "common.names.fullname" $ }}-headless serviceName: {{ printf "%s-headless" (include "common.names.fullname" $) }}
replicas: {{ $.Values.shardsvr.arbiter.replicas }} replicas: {{ $.Values.shardsvr.arbiter.replicaCount }}
template: template:
metadata: metadata:
labels: {{- include "common.labels.standard" $ | nindent 8 }} labels: {{- include "common.labels.standard" $ | nindent 8 }}
app.kubernetes.io/component: shardsvr-arbiter app.kubernetes.io/component: shardsvr-arbiter
{{- if $.Values.common.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if $.Values.shardsvr.arbiter.podLabels }} {{- if $.Values.shardsvr.arbiter.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podLabels "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podLabels "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
@@ -36,9 +46,9 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
spec: spec:
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.shardsvr.arbiter.serviceAccount "context" $) }} serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "component" "shardsvr-arbiter" "value" $.Values.shardsvr.arbiter.serviceAccount "context" $) }}
{{- if $.Values.common.schedulerName }} {{- if $.Values.shardsvr.arbiter.schedulerName }}
schedulerName: {{ $.Values.common.schedulerName | quote }} schedulerName: {{ $.Values.shardsvr.arbiter.schedulerName | quote }}
{{- end }} {{- end }}
{{- if $.Values.shardsvr.arbiter.hostAliases }} {{- if $.Values.shardsvr.arbiter.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.hostAliases "context" $) | nindent 8 }} hostAliases: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.hostAliases "context" $) | nindent 8 }}
@@ -60,9 +70,14 @@ spec:
{{- if $.Values.shardsvr.arbiter.priorityClassName }} {{- if $.Values.shardsvr.arbiter.priorityClassName }}
priorityClassName: {{ $.Values.shardsvr.arbiter.priorityClassName | quote }} priorityClassName: {{ $.Values.shardsvr.arbiter.priorityClassName | quote }}
{{- end }} {{- end }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.shardsvr.arbiter.topologySpreadConstraints }}
securityContext: topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.topologySpreadConstraints "context" .) | nindent 8 }}
fsGroup: {{ $.Values.securityContext.fsGroup }} {{- end }}
{{- if $.Values.shardsvr.arbiter.podSecurityContext.enabled }}
securityContext: {{- omit $.Values.shardsvr.arbiter.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if $.Values.shardsvr.arbiter.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ $.Values.shardsvr.arbiter.terminationGracePeriodSeconds }}
{{- end }} {{- end }}
{{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }} {{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }}
{{- if or $.Values.shardsvr.arbiter.initContainers $.Values.common.initContainers }} {{- if or $.Values.shardsvr.arbiter.initContainers $.Values.common.initContainers }}
@@ -75,16 +90,14 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
containers: containers:
- name: {{ include "common.names.fullname" $ }}-arbiter - name: {{ printf "%s-arbiter" (include "common.names.fullname" $) }}
image: {{ include "mongodb-sharded.image" $ }} image: {{ include "mongodb-sharded.image" $ }}
imagePullPolicy: {{ $.Values.image.pullPolicy }} imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.shardsvr.arbiter.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit $.Values.shardsvr.arbiter.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
runAsUser: {{ $.Values.securityContext.runAsUser }}
{{- end }} {{- end }}
ports: ports:
- containerPort: {{ $.Values.common.containerPorts.mongo }} - containerPort: {{ $.Values.common.containerPorts.mongodb }}
name: mongodb name: mongodb
env: env:
- name: MONGODB_ENABLE_NUMACTL - name: MONGODB_ENABLE_NUMACTL
@@ -110,14 +123,14 @@ spec:
- name: MONGODB_REPLICA_SET_MODE - name: MONGODB_REPLICA_SET_MODE
value: "arbiter" value: "arbiter"
- name: MONGODB_PORT_NUMBER - name: MONGODB_PORT_NUMBER
value: {{ $.Values.common.containerPorts.mongo | quote }} value: {{ $.Values.common.containerPorts.mongodb | quote }}
- name: MONGODB_INITIAL_PRIMARY_HOST - name: MONGODB_INITIAL_PRIMARY_HOST
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }} value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
- name: MONGODB_REPLICA_SET_NAME - name: MONGODB_REPLICA_SET_NAME
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }} value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
{{- if $.Values.common.useHostnames }} {{- if $.Values.common.useHostnames }}
- name: MONGODB_ADVERTISED_HOSTNAME - name: MONGODB_ADVERTISED_HOSTNAME
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}" value: {{ printf "$(MONGODB_POD_NAME).%s-headless.%s.svc.%s" (include "common.names.fullname" $) (include "common.names.namespace" $) .Values.clusterDomain }}
{{- end }} {{- end }}
- name: MONGODB_ENABLE_IPV6 - name: MONGODB_ENABLE_IPV6
{{- if $.Values.common.mongodbEnableIPv6 }} {{- if $.Values.common.mongodbEnableIPv6 }}
@@ -131,7 +144,10 @@ spec:
{{- else }} {{- else }}
value: "no" value: "no"
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_INITIAL_PRIMARY_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if $.Values.auth.usePasswordFile }}
- name: MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE - name: MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
- name: MONGODB_REPLICA_SET_KEY_FILE - name: MONGODB_REPLICA_SET_KEY_FILE
@@ -148,6 +164,7 @@ spec:
name: {{ include "mongodb-sharded.secret" $ }} name: {{ include "mongodb-sharded.secret" $ }}
key: mongodb-replica-set-key key: mongodb-replica-set-key
{{- end }} {{- end }}
{{- end }}
{{- if $.Values.shardsvr.arbiter.mongodbExtraFlags }} {{- if $.Values.shardsvr.arbiter.mongodbExtraFlags }}
- name: MONGODB_EXTRA_FLAGS - name: MONGODB_EXTRA_FLAGS
value: {{ $.Values.shardsvr.arbiter.mongodbExtraFlags | join " " | quote }} value: {{ $.Values.shardsvr.arbiter.mongodbExtraFlags | join " " | quote }}
@@ -178,37 +195,46 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if $.Values.diagnosticMode.enabled }} {{- if $.Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else }}
{{- if $.Values.shardsvr.arbiter.command }}
command: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.command "context" $) | nindent 12 }}
{{- end }} {{- end }}
{{- if not $.Values.diagnosticMode.enabled }} {{- if $.Values.shardsvr.arbiter.args }}
{{- if $.Values.livenessProbe.enabled }} args: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.args "context" $) | nindent 12 }}
livenessProbe: {{- end }}
{{- if $.Values.shardsvr.arbiter.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.arbiter.livenessProbe "enabled") "context" $) | nindent 12 }}
tcpSocket: tcpSocket:
port: mongodb port: mongodb
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }} {{- else if $.Value.shardsvr.arbiter.customLivenessProbe }}
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ $.Values.livenessProbe.successThreshold }}
failureThreshold: {{ $.Values.livenessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if $.Values.readinessProbe.enabled }} {{- if .Values.shardsvr.arbiter.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.arbiter.readinessProbe "enabled") "context" $) | nindent 12 }}
tcpSocket: tcpSocket:
port: mongodb port: mongodb
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }} {{- else if $.Value.shardsvr.arbiter.customReadinessProbe }}
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ $.Values.readinessProbe.successThreshold }}
failureThreshold: {{ $.Values.readinessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if $.Values.shardsvr.arbiter.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.arbiter.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: mongodb
{{- else if $.Values.shardsvr.arbiter.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if $.Values.shardsvr.arbiter.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.lifecycleHooks "context" $) | nindent 12 }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
{{- if or $.Values.shardsvr.arbiter.config $.Values.shardsvr.arbiter.configCM }} {{- if or $.Values.shardsvr.arbiter.config $.Values.shardsvr.arbiter.configCM }}
- name: config - name: config
mountPath: /bitnami/mongodb/conf/ mountPath: /bitnami/mongodb/conf/
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
@@ -231,13 +257,14 @@ spec:
- name: metrics - name: metrics
image: {{ include "mongodb-sharded.metrics.image" $ }} image: {{ include "mongodb-sharded.metrics.image" $ }}
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }} imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.metrics.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit $.Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
runAsUser: {{ $.Values.securityContext.runAsUser }}
{{- end }} {{- end }}
env: env:
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ .Values.auth.rootUser | quote }}
{{- if $.Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
{{- else }} {{- else }}
@@ -247,6 +274,7 @@ spec:
name: {{ include "mongodb-sharded.secret" $ }} name: {{ include "mongodb-sharded.secret" $ }}
key: mongodb-root-password key: mongodb-root-password
{{- end }} {{- end }}
{{- end }}
{{- if $.Values.diagnosticMode.enabled }} {{- if $.Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }}
@@ -256,41 +284,42 @@ spec:
- -ec - -ec
- |- - |-
#!/bin/sh #!/bin/sh
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
{{- end }} {{- end }}
/bin/mongodb_exporter --web.listen-address ":{{ $.Values.metrics.containerPort }}" --mongodb.uri mongodb://root:`echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g"`@localhost:{{ $.Values.service.port }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }} /bin/mongodb_exporter --web.listen-address ":{{ $.Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ $.Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }}
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
volumeMounts: volumeMounts:
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
ports: ports:
- name: metrics - name: metrics
containerPort: {{ $.Values.metrics.containerPort }} containerPort: {{ $.Values.metrics.containerPorts.metrics }}
{{- if not $.Values.diagnosticMode.enabled }} {{- if not $.Values.diagnosticMode.enabled }}
{{- if $.Values.metrics.livenessProbe.enabled }} {{- if $.Values.metrics.livenessProbe.enabled }}
livenessProbe: livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ $.Values.metrics.livenessProbe.initialDelaySeconds }} {{- else if $.Values.metrics.customLivenessProbe }}
periodSeconds: {{ $.Values.metrics.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.metrics.livenessProbe.timeoutSeconds }}
failureThreshold: {{ $.Values.metrics.livenessProbe.failureThreshold }}
successThreshold: {{ $.Values.metrics.livenessProbe.successThreshold }}
{{- end }} {{- end }}
{{- if $.Values.metrics.readinessProbe.enabled }} {{- if $.Values.metrics.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ $.Values.metrics.readinessProbe.initialDelaySeconds }} {{- else if $.Values.metrics.customReadinessProbe }}
periodSeconds: {{ $.Values.metrics.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.metrics.readinessProbe.timeoutSeconds }} {{- end }}
failureThreshold: {{ $.Values.metrics.readinessProbe.failureThreshold }} {{- if $.Values.metrics.startupProbe.enabled }}
successThreshold: {{ $.Values.metrics.readinessProbe.successThreshold }} startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: metrics
{{- else if $.Values.metrics.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customStartupProbe "context" $) | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }} resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
@@ -307,7 +336,7 @@ spec:
configMap: configMap:
name: {{ include "mongodb-sharded.shardsvr.arbiter.configCM" $ }} name: {{ include "mongodb-sharded.shardsvr.arbiter.configCM" $ }}
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
- name: secrets - name: secrets
secret: secret:
secretName: {{ include "mongodb-sharded.secret" $ }} secretName: {{ include "mongodb-sharded.secret" $ }}

View File

@@ -2,9 +2,16 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ include "common.names.fullname" . }}-shardsvr-data name: {{ printf "%s-shardsvr-data" (include "common.names.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }} labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data: data:
mongodb.conf: |- mongodb.conf: |-
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.dataNode.config "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.dataNode.config "context" $) | nindent 4 }}

View File

@@ -1,12 +1,19 @@
{{- if and .Values.shards .Values.shardsvr.dataNode.pdb.enabled -}} {{- if and .Values.shards .Values.shardsvr.dataNode.pdb.create -}}
{{- $replicas := .Values.shards | int -}} {{- $replicas := .Values.shards | int -}}
{{- range $i, $e := until $replicas -}} {{- range $i, $e := until $replicas -}}
kind: PodDisruptionBudget kind: PodDisruptionBudget
apiVersion: {{ include "common.capabilities.policy.apiVersion" $ }} apiVersion: {{ include "common.capabilities.policy.apiVersion" $ }}
metadata: metadata:
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }} name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }} labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}

View File

@@ -6,15 +6,21 @@ kind: PodMonitor
metadata: metadata:
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }} name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
{{- if $.Values.metrics.podMonitor.namespace }} {{- if $.Values.metrics.podMonitor.namespace }}
namespace: {{ $.Values.metrics.podMonitor.namespace }} namespace: {{ $.Values.metrics.podMonitor.namespace | quote }}
{{- else }} {{- else }}
namespace: {{ $.Release.Namespace }} namespace: {{ include "common.names.namespace" $ | quote }}
{{- end }} {{- end }}
labels: {{- include "common.labels.standard" $ | nindent 4 }} labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if $.Values.metrics.podMonitor.additionalLabels }} {{- if $.Values.metrics.podMonitor.additionalLabels }}
{{- include "common.tplvalues.render" (dict "value" $.Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }} {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }}
{{- end }} {{- end }}
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
podMetricsEndpoints: podMetricsEndpoints:
- port: metrics - port: metrics

View File

@@ -5,20 +5,30 @@ apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }} name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
namespace: {{ include "common.names.namespace" $ | quote }}
labels: {{- include "common.labels.standard" $ | nindent 4 }} labels: {{- include "common.labels.standard" $ | nindent 4 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
{{- if $.Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if $.Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec: spec:
selector: selector:
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
podManagementPolicy: {{ $.Values.shardsvr.dataNode.podManagementPolicy }} podManagementPolicy: {{ $.Values.shardsvr.dataNode.podManagementPolicy }}
updateStrategy: {{- toYaml $.Values.shardsvr.dataNode.updateStrategy | nindent 4 }} updateStrategy: {{- toYaml $.Values.shardsvr.dataNode.updateStrategy | nindent 4 }}
serviceName: {{ include "common.names.fullname" $ }}-headless serviceName: {{ printf "%s-headless" (include "common.names.fullname" $) }}
replicas: {{ $.Values.shardsvr.dataNode.replicas }} replicas: {{ $.Values.shardsvr.dataNode.replicaCount }}
template: template:
metadata: metadata:
labels: {{- include "common.labels.standard" $ | nindent 8 }} labels: {{- include "common.labels.standard" $ | nindent 8 }}
app.kubernetes.io/component: shardsvr app.kubernetes.io/component: shardsvr
{{- if $.Values.common.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.common.podLabels "context" $ ) | nindent 8 }}
{{- end }}
{{- if $.Values.shardsvr.dataNode.podLabels }} {{- if $.Values.shardsvr.dataNode.podLabels }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podLabels "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podLabels "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
@@ -36,8 +46,8 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
spec: spec:
{{- if $.Values.common.schedulerName }} {{- if $.Values.shardsvr.dataNode.schedulerName }}
schedulerName: {{ $.Values.common.schedulerName | quote }} schedulerName: {{ $.Values.shardsvr.dataNode.schedulerName | quote }}
{{- end }} {{- end }}
{{- if $.Values.shardsvr.dataNode.affinity }} {{- if $.Values.shardsvr.dataNode.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.affinity "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }} affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.affinity "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }}
@@ -56,13 +66,18 @@ spec:
{{- if $.Values.shardsvr.dataNode.tolerations }} {{- if $.Values.shardsvr.dataNode.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.tolerations "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }} tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.tolerations "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }}
{{- end }} {{- end }}
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.shardsvr.dataNode.serviceAccount "context" $) }} serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "component" "shardsvr" "value" $.Values.shardsvr.dataNode.serviceAccount "context" $) }}
{{- if $.Values.shardsvr.dataNode.priorityClassName }} {{- if $.Values.shardsvr.dataNode.priorityClassName }}
priorityClassName: {{ $.Values.shardsvr.dataNode.priorityClassName | quote }} priorityClassName: {{ $.Values.shardsvr.dataNode.priorityClassName | quote }}
{{- end }} {{- end }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.shardsvr.dataNode.topologySpreadConstraints }}
securityContext: topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.topologySpreadConstraints "context" .) | nindent 8 }}
fsGroup: {{ $.Values.securityContext.fsGroup }} {{- end }}
{{- if $.Values.shardsvr.dataNode.podSecurityContext.enabled }}
securityContext: {{- omit $.Values.shardsvr.dataNode.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
{{- if $.Values.shardsvr.dataNode.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ $.Values.shardsvr.dataNode.terminationGracePeriodSeconds }}
{{- end }} {{- end }}
{{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }} {{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }}
initContainers: initContainers:
@@ -70,13 +85,23 @@ spec:
- name: volume-permissions - name: volume-permissions
image: {{ include "mongodb-sharded.volumePermissions.image" $ }} image: {{ include "mongodb-sharded.volumePermissions.image" $ }}
imagePullPolicy: {{ $.Values.volumePermissions.image.pullPolicy | quote }} imagePullPolicy: {{ $.Values.volumePermissions.image.pullPolicy | quote }}
command: ["chown", "-R", "{{ $.Values.securityContext.runAsUser }}:{{ $.Values.securityContext.fsGroup }}", "{{ $.Values.shardsvr.persistence.mountPath }}"] command:
- /bin/bash
args:
- -ec
- |
mkdir -p {{ $.Values.shardsvr.persistence.mountPath }}{{- if $.Values.shardsvr.persistence.subPath }}/{{ $.Values.shardsvr.persistence.subPath }}{{- end }}
chmod 700 {{ $.Values.shardsvr.persistence.mountPath }}
find {{ $.Values.shardsvr.persistence.mountPath }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" | xargs -r chown -R {{ $.Values.shardsvr.dataNode.containerSecurityContext.runAsUser }}:{{ $.Values.shardsvr.dataNode.podSecurityContext.fsGroup }}
securityContext: securityContext:
runAsUser: 0 runAsUser: 0
resources: {{ toYaml $.Values.volumePermissions.resources | nindent 12 }} resources: {{ toYaml $.Values.volumePermissions.resources | nindent 12 }}
volumeMounts: volumeMounts:
- name: datadir - name: datadir
mountPath: {{ $.Values.shardsvr.persistence.mountPath }} mountPath: {{ $.Values.shardsvr.persistence.mountPath }}
{{- if $.Values.shardsvr.persistence.subPath }}
subPath: {{ $.Values.shardsvr.persistence.subPath }}
{{- end }}
{{- end }} {{- end }}
{{- with $.Values.shardsvr.dataNode.initContainers }} {{- with $.Values.shardsvr.dataNode.initContainers }}
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
@@ -88,13 +113,11 @@ spec:
- name: mongodb - name: mongodb
image: {{ include "mongodb-sharded.image" $ }} image: {{ include "mongodb-sharded.image" $ }}
imagePullPolicy: {{ $.Values.image.pullPolicy }} imagePullPolicy: {{ $.Values.image.pullPolicy }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.shardsvr.dataNode.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit $.Values.shardsvr.dataNode.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
runAsUser: {{ $.Values.securityContext.runAsUser }}
{{- end }} {{- end }}
ports: ports:
- containerPort: {{ $.Values.common.containerPorts.mongo }} - containerPort: {{ $.Values.common.containerPorts.mongodb }}
name: mongodb name: mongodb
env: env:
- name: MONGODB_ENABLE_NUMACTL - name: MONGODB_ENABLE_NUMACTL
@@ -106,13 +129,13 @@ spec:
- name: MONGODB_MAX_TIMEOUT - name: MONGODB_MAX_TIMEOUT
value: {{ $.Values.common.mongodbMaxWaitTimeout | quote }} value: {{ $.Values.common.mongodbMaxWaitTimeout | quote }}
- name: MONGODB_DISABLE_SYSTEM_LOG - name: MONGODB_DISABLE_SYSTEM_LOG
{{- if $.Values.mongodbDisableSystemLog }} {{- if $.Values.common.mongodbDisableSystemLog }}
value: "yes" value: "yes"
{{- else }} {{- else }}
value: "no" value: "no"
{{- end }} {{- end }}
- name: MONGODB_PORT_NUMBER - name: MONGODB_PORT_NUMBER
value: {{ $.Values.common.containerPorts.mongo | quote }} value: {{ $.Values.common.containerPorts.mongodb | quote }}
- name: MONGODB_SHARDING_MODE - name: MONGODB_SHARDING_MODE
value: "shardsvr" value: "shardsvr"
- name: MONGODB_POD_NAME - name: MONGODB_POD_NAME
@@ -122,16 +145,19 @@ spec:
- name: MONGODB_MONGOS_HOST - name: MONGODB_MONGOS_HOST
value: {{ include "mongodb-sharded.serviceName" $ }} value: {{ include "mongodb-sharded.serviceName" $ }}
- name: MONGODB_MONGOS_PORT_NUMBER - name: MONGODB_MONGOS_PORT_NUMBER
value: {{ $.Values.service.port | quote }} value: {{ $.Values.service.ports.mongodb | quote }}
- name: MONGODB_INITIAL_PRIMARY_HOST - name: MONGODB_INITIAL_PRIMARY_HOST
value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }} value: {{ printf "%s-shard%d-data-0.%s-headless.%s.svc.%s" (include "common.names.fullname" $ ) $i (include "common.names.fullname" $ ) $.Release.Namespace $.Values.clusterDomain }}
- name: MONGODB_REPLICA_SET_NAME - name: MONGODB_REPLICA_SET_NAME
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }} value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
{{- if $.Values.common.useHostnames }} {{- if $.Values.common.useHostnames }}
- name: MONGODB_ADVERTISED_HOSTNAME - name: MONGODB_ADVERTISED_HOSTNAME
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}" value: {{ printf "$(MONGODB_POD_NAME).%s-headless.%s.svc.%s" (include "common.names.fullname" $) (include "common.names.namespace" $) $.Values.clusterDomain }}
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ $.Values.auth.rootUser | quote }}
{{- if $.Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
- name: MONGODB_REPLICA_SET_KEY_FILE - name: MONGODB_REPLICA_SET_KEY_FILE
@@ -148,6 +174,7 @@ spec:
name: {{ include "mongodb-sharded.secret" $ }} name: {{ include "mongodb-sharded.secret" $ }}
key: mongodb-replica-set-key key: mongodb-replica-set-key
{{- end }} {{- end }}
{{- end }}
- name: MONGODB_ENABLE_IPV6 - name: MONGODB_ENABLE_IPV6
{{- if $.Values.common.mongodbEnableIPv6 }} {{- if $.Values.common.mongodbEnableIPv6 }}
value: "yes" value: "yes"
@@ -193,47 +220,55 @@ spec:
command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }}
{{- else }} {{- else }}
command: {{- if $.Values.shardsvr.dataNode.command }}
- /bin/bash command: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.command "context" $) | nindent 12 }}
- /entrypoint/replicaset-entrypoint.sh
{{- end }} {{- end }}
{{- if not $.Values.diagnosticMode.enabled }} {{- if $.Values.shardsvr.dataNode.args }}
{{- if $.Values.livenessProbe.enabled }} args: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.args "context" $) | nindent 12 }}
livenessProbe: {{- end }}
{{- if $.Values.shardsvr.dataNode.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.dataNode.livenessProbe "enabled") "context" $) | nindent 12 }}
exec: exec:
command: command:
- pgrep - pgrep
- mongod - mongod
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }} {{- else if $.Value.shardsvr.dataNode.customLivenessProbe }}
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ $.Values.livenessProbe.successThreshold }}
failureThreshold: {{ $.Values.livenessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if $.Values.readinessProbe.enabled }} {{- if $.Values.shardsvr.dataNode.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.dataNode.readinessProbe "enabled") "context" $) | nindent 12 }}
exec: exec:
command: command:
- mongosh - /bin/sh
- --eval - -c
- "db.adminCommand('ping')" - mongosh --port $MONGODB_PORT_NUMBER --eval "db.adminCommand('ping')"
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }} {{- else if $.Value.shardsvr.dataNode.customReadinessProbe }}
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ $.Values.readinessProbe.successThreshold }}
failureThreshold: {{ $.Values.readinessProbe.failureThreshold }}
{{- end }} {{- end }}
{{- if $.Values.shardsvr.dataNode.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.shardsvr.dataNode.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: mongodb
{{- else if $.Values.shardsvr.dataNode.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.customStartupProbe "context" $) | nindent 12 }}
{{- end }}
{{- end }}
{{- if $.Values.shardsvr.dataNode.lifecycleHooks }}
lifecycle: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.lifecycleHooks "context" $) | nindent 12 }}
{{- end }} {{- end }}
volumeMounts: volumeMounts:
- name: replicaset-entrypoint-configmap - name: replicaset-entrypoint-configmap
mountPath: /entrypoint mountPath: /entrypoint
- name: datadir - name: datadir
mountPath: {{ $.Values.shardsvr.persistence.mountPath }} mountPath: {{ $.Values.shardsvr.persistence.mountPath }}
{{- if $.Values.shardsvr.persistence.subPath }}
subPath: {{ $.Values.shardsvr.persistence.subPath }}
{{- end }}
{{- if or $.Values.shardsvr.dataNode.config $.Values.shardsvr.dataNode.configCM }} {{- if or $.Values.shardsvr.dataNode.config $.Values.shardsvr.dataNode.configCM }}
- name: config - name: config
mountPath: /bitnami/mongodb/conf/ mountPath: /bitnami/mongodb/conf/
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
@@ -256,13 +291,14 @@ spec:
- name: metrics - name: metrics
image: {{ include "mongodb-sharded.metrics.image" $ }} image: {{ include "mongodb-sharded.metrics.image" $ }}
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }} imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
{{- if $.Values.securityContext.enabled }} {{- if $.Values.metrics.containerSecurityContext.enabled }}
securityContext: securityContext: {{- omit $.Values.metrics.containerSecurityContext "enabled" | toYaml | nindent 12 }}
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
runAsUser: {{ $.Values.securityContext.runAsUser }}
{{- end }} {{- end }}
env: env:
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.enabled }}
- name: MONGODB_ROOT_USER
value: {{ $.Values.auth.rootUser | quote }}
{{- if $.Values.auth.usePasswordFile }}
- name: MONGODB_ROOT_PASSWORD_FILE - name: MONGODB_ROOT_PASSWORD_FILE
value: "/bitnami/mongodb/secrets/mongodb-root-password" value: "/bitnami/mongodb/secrets/mongodb-root-password"
{{- else }} {{- else }}
@@ -272,6 +308,7 @@ spec:
name: {{ include "mongodb-sharded.secret" $ }} name: {{ include "mongodb-sharded.secret" $ }}
key: mongodb-root-password key: mongodb-root-password
{{- end }} {{- end }}
{{- end }}
{{- if $.Values.diagnosticMode.enabled }} {{- if $.Values.diagnosticMode.enabled }}
command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }} command: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.command "context" $) | nindent 12 }}
args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }} args: {{- include "common.tplvalues.render" (dict "value" $.Values.diagnosticMode.args "context" $) | nindent 12 }}
@@ -281,41 +318,42 @@ spec:
- -ec - -ec
- |- - |-
#!/bin/sh #!/bin/sh
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")" export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
{{- end }} {{- end }}
/bin/mongodb_exporter --web.listen-address ":{{ $.Values.metrics.containerPort }}" --mongodb.uri mongodb://root:`echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g"`@localhost:{{ $.Values.service.port }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }} /bin/mongodb_exporter --web.listen-address ":{{ $.Values.metrics.containerPorts.metrics }}" --mongodb.uri mongodb://$(echo $MONGODB_ROOT_USER):$(echo $MONGODB_ROOT_PASSWORD | sed -r "s/@/%40/g;s/:/%3A/g")@localhost:{{ $.Values.common.containerPorts.mongodb }}/admin{{ ternary "?ssl=true" "" $.Values.metrics.useTLS }} {{ $.Values.metrics.extraArgs }}
{{- end }} {{- end }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
volumeMounts: volumeMounts:
- name: secrets - name: secrets
mountPath: /bitnami/mongodb/secrets/ mountPath: /bitnami/mongodb/secrets/
{{- end }} {{- end }}
ports: ports:
- name: metrics - name: metrics
containerPort: {{ $.Values.metrics.containerPort }} containerPort: {{ $.Values.metrics.containerPorts.metrics }}
{{- if not $.Values.diagnosticMode.enabled }} {{- if not $.Values.diagnosticMode.enabled }}
{{- if $.Values.metrics.livenessProbe.enabled }} {{- if $.Values.metrics.livenessProbe.enabled }}
livenessProbe: livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.livenessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ $.Values.metrics.livenessProbe.initialDelaySeconds }} {{- else if $.Values.metrics.customLivenessProbe }}
periodSeconds: {{ $.Values.metrics.livenessProbe.periodSeconds }} livenessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customLivenessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.metrics.livenessProbe.timeoutSeconds }}
failureThreshold: {{ $.Values.metrics.livenessProbe.failureThreshold }}
successThreshold: {{ $.Values.metrics.livenessProbe.successThreshold }}
{{- end }} {{- end }}
{{- if $.Values.metrics.readinessProbe.enabled }} {{- if $.Values.metrics.readinessProbe.enabled }}
readinessProbe: readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.readinessProbe "enabled") "context" $) | nindent 12 }}
httpGet: httpGet:
path: /metrics path: /metrics
port: metrics port: metrics
initialDelaySeconds: {{ $.Values.metrics.readinessProbe.initialDelaySeconds }} {{- else if $.Values.metrics.customReadinessProbe }}
periodSeconds: {{ $.Values.metrics.readinessProbe.periodSeconds }} readinessProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customReadinessProbe "context" $) | nindent 12 }}
timeoutSeconds: {{ $.Values.metrics.readinessProbe.timeoutSeconds }} {{- end }}
failureThreshold: {{ $.Values.metrics.readinessProbe.failureThreshold }} {{- if $.Values.metrics.startupProbe.enabled }}
successThreshold: {{ $.Values.metrics.readinessProbe.successThreshold }} startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit $.Values.metrics.startupProbe "enabled") "context" $) | nindent 12 }}
tcpSocket:
port: metrics
{{- else if $.Values.metrics.customStartupProbe }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" $.Values.metrics.customStartupProbe "context" $) | nindent 12 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }} resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
@@ -329,8 +367,8 @@ spec:
volumes: volumes:
- name: replicaset-entrypoint-configmap - name: replicaset-entrypoint-configmap
configMap: configMap:
name: {{ include "common.names.fullname" $ }}-replicaset-entrypoint name: {{ printf "%s-replicaset-entrypoint" (include "common.names.fullname" $) }}
{{- if $.Values.usePasswordFile }} {{- if $.Values.auth.usePasswordFile }}
- name: secrets - name: secrets
secret: secret:
secretName: {{ include "mongodb-sharded.secret" $ }} secretName: {{ include "mongodb-sharded.secret" $ }}
@@ -358,13 +396,23 @@ spec:
{{- if $.Values.shardsvr.dataNode.extraVolumes }} {{- if $.Values.shardsvr.dataNode.extraVolumes }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumes "context" $ ) | nindent 8 }} {{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumes "context" $ ) | nindent 8 }}
{{- end }} {{- end }}
{{- if $.Values.shardsvr.persistence.enabled }} {{- if and $.Values.shardsvr.persistence.enabled }}
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - metadata:
name: datadir name: datadir
{{- if or $.Values.shardsvr.persistence.annotations $.Values.commonAnnotations $.Values.shardsvr.persistence.resourcePolicy }}
{{- if or .Values.commonAnnotations .Values.configsvr.persistence.annotations .Values.configsvr.persistence.resourcePolicy }}
annotations: annotations:
{{- range $key, $value := $.Values.shardsvr.persistence.annotations }} {{- if $.Values.commonAnnotations }}
{{ $key }}: "{{ $value }}" {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 10 }}
{{- end }}
{{- if $.Values.shardsvr.persistence.annotations }}
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.persistence.annotations "context" $) | nindent 10 }}
{{- end }}
{{- if $.Values.shardsvr.persistence.resourcePolicy }}
helm.sh/resource-policy: {{ $.Values.shardsvr.persistence.resourcePolicy | quote }}
{{- end }}
{{- end }}
{{- end }} {{- end }}
spec: spec:
accessModes: accessModes:

View File

@@ -20,14 +20,25 @@ global:
## @section Common parameters ## @section Common parameters
## ##
## @param nameOverride String to partially override mongodb.fullname template (will maintain the release name) ## @param kubeVersion Override Kubernetes version
##
kubeVersion: ""
## @param nameOverride String to partially override common.names.name
## ##
nameOverride: "" nameOverride: ""
## @param fullnameOverride String to fully override mongodb.fullname template ## @param fullnameOverride String to fully override common.names.fullname
## ##
fullnameOverride: "" fullnameOverride: ""
## @param clusterDomain Kubernetes Cluster Domain ## @param namespaceOverride String to fully override common.names.namespace
## ref: https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/#introduction ##
namespaceOverride: ""
## @param commonLabels Labels to add to all deployed objects
##
commonLabels: {}
## @param commonAnnotations Annotations to add to all deployed objects
##
commonAnnotations: {}
## @param clusterDomain Kubernetes cluster domain name
## ##
clusterDomain: cluster.local clusterDomain: cluster.local
## @param extraDeploy Array of extra objects to deploy with the release ## @param extraDeploy Array of extra objects to deploy with the release
@@ -64,7 +75,7 @@ diagnosticMode:
image: image:
registry: docker.io registry: docker.io
repository: bitnami/mongodb-sharded repository: bitnami/mongodb-sharded
tag: 4.4.13-debian-10-r50 tag: 5.0.8-debian-10-r5
## Specify a imagePullPolicy ## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## ref: https://kubernetes.io/docs/user-guide/images/#pre-pulling-images
@@ -81,27 +92,42 @@ image:
## Set to true if you would like to see extra information on logs ## Set to true if you would like to see extra information on logs
## ##
debug: false debug: false
## MongoDB&reg; credentials
## @param mongodbRootPassword MongoDB&reg; root password ## MongoDB(&reg;) Authentication parameters
## If set to null it will be randomly generated
## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run
## e.g:
## mongodbRootPassword: password
## ##
mongodbRootPassword: "" auth:
## @param replicaSetKey Replica Set key (shared for shards and config servers) ## @param auth.enabled Enable authentication
## e.g: ## ref: https://docs.mongodb.com/manual/tutorial/enable-authentication/
## replicaSetKey: testkey123 ##
## enabled: true
replicaSetKey: "" ## @param auth.rootUser MongoDB(&reg;) root user
## @param existingSecret Existing secret with MongoDB&reg; credentials ##
## e.g: rootUser: root
## existingSecret: name-of-existing-secret ## @param auth.rootPassword MongoDB(&reg;) root password
## ## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run
existingSecret: "" ##
## @param usePasswordFile Mount credentials as files instead of using environment variables rootPassword: ""
## ## MongoDB(&reg;) custom user and database
usePasswordFile: false ## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#creating-users-and-databases-on-first-run
## @param auth.username Custom user to be created during the initialization
## @param auth.password Password for the custom user set at `auth.username`
## @param auth.database Database to be created during the initialization
##
username: ""
password: ""
database: ""
## @param auth.replicaSetKey Key used for authentication in the replicaset (only when `architecture=replicaset`)
##
replicaSetKey: ""
## @param auth.existingSecret Existing secret with MongoDB(&reg;) credentials (keys: `mongodb-password`, `mongodb-root-password`, ` mongodb-replica-set-key`)
## NOTE: When it's set the previous parameters are ignored.
##
existingSecret: ""
## @param auth.usePasswordFile Mount credentials as files instead of using environment variables
##
usePasswordFile: false
## @param shards Number of shards to be created ## @param shards Number of shards to be created
## ref: https://docs.mongodb.com/manual/core/sharded-cluster-shards/ ## ref: https://docs.mongodb.com/manual/core/sharded-cluster-shards/
## ##
@@ -187,10 +213,10 @@ common:
## @param common.extraVolumeMounts Array to add extra mounts (normally used with extraVolumes) ## @param common.extraVolumeMounts Array to add extra mounts (normally used with extraVolumes)
## ##
extraVolumeMounts: [] extraVolumeMounts: []
## @param common.containerPorts.mongo MongoDB container port ## @param common.containerPorts.mongodb MongoDB container port
## ##
containerPorts: containerPorts:
mongo: 27017 mongodb: 27017
## K8s Service Account. ## K8s Service Account.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
## ##
@@ -202,6 +228,12 @@ common:
## If not set and create is true, a name is generated using the XXX.fullname template ## If not set and create is true, a name is generated using the XXX.fullname template
## ##
name: "" name: ""
## @param common.serviceAccount.annotations Additional Service Account annotations (evaluated as a template)
##
annotations: {}
## @param common.serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true
## Init containers parameters: ## Init containers parameters:
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section. ## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
@@ -219,7 +251,7 @@ volumePermissions:
image: image:
registry: docker.io registry: docker.io
repository: bitnami/bitnami-shell repository: bitnami/bitnami-shell
tag: 10-debian-10-r404 tag: 10-debian-10-r410
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets. ## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace. ## Secrets must be manually created in the namespace.
@@ -232,18 +264,6 @@ volumePermissions:
## @param volumePermissions.resources Init container resource requests/limit ## @param volumePermissions.resources Init container resource requests/limit
## ##
resources: {} resources: {}
## Pod Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param securityContext.enabled Enable security context
## @param securityContext.fsGroup Group ID for the container
## @param securityContext.runAsUser User ID for the container
## @param securityContext.runAsNonRoot Run containers as non-root users
##
securityContext:
enabled: true
fsGroup: 1001
runAsUser: 1001
runAsNonRoot: true
## Kubernetes service type ## Kubernetes service type
## ref: https://kubernetes.io/docs/concepts/services-networking/service/ ## ref: https://kubernetes.io/docs/concepts/services-networking/service/
## ##
@@ -264,17 +284,19 @@ service:
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
## ##
externalTrafficPolicy: Cluster externalTrafficPolicy: Cluster
## @param service.port MongoDB&reg; service port ## @param service.ports.mongodb MongoDB&reg; service port
## ##
port: 27017 ports:
mongodb: 27017
## @param service.clusterIP Static clusterIP or None for headless services ## @param service.clusterIP Static clusterIP or None for headless services
## ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#servicespec-v1-core ## ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#servicespec-v1-core
## ##
clusterIP: "" clusterIP: ""
## @param service.nodePort Specify the nodePort value for the LoadBalancer and NodePort service types. ## @param service.nodePorts.mongodb Specify the nodePort value for the LoadBalancer and NodePort service types.
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
## ##
nodePort: "" nodePorts:
mongodb: ""
## @param service.externalIPs External IP list to use with ClusterIP service type ## @param service.externalIPs External IP list to use with ClusterIP service type
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
## ##
@@ -295,40 +317,12 @@ service:
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
## ##
sessionAffinity: None sessionAffinity: None
## Configure extra options for liveness probes ## @param service.sessionAffinityConfig Additional settings for the sessionAffinity
## This applies to all the MongoDB&reg; in the sharded cluster ## sessionAffinityConfig:
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## clientIP:
## @param livenessProbe.enabled Enable livenessProbe ## timeoutSeconds: 300
## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe ##
## @param livenessProbe.periodSeconds Period seconds for livenessProbe sessionAffinityConfig: {}
## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
## @param livenessProbe.failureThreshold Failure threshold for livenessProbe
## @param livenessProbe.successThreshold Success threshold for livenessProbe
##
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 12
successThreshold: 1
## Configure extra options for readiness probe
## This applies to all the MongoDB&reg; in the sharded cluster
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
## @param readinessProbe.enabled Enable readinessProbe
## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
## @param readinessProbe.periodSeconds Period seconds for readinessProbe
## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
## @param readinessProbe.failureThreshold Failure threshold for readinessProbe
## @param readinessProbe.successThreshold Success threshold for readinessProbe
##
readinessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 12
successThreshold: 1
## @section Config Server parameters ## @section Config Server parameters
## ##
@@ -337,9 +331,9 @@ readinessProbe:
## ref: https://docs.mongodb.com/manual/core/sharded-cluster-config-servers/ ## ref: https://docs.mongodb.com/manual/core/sharded-cluster-config-servers/
## ##
configsvr: configsvr:
## @param configsvr.replicas Number of nodes in the replica set (the first node will be primary) ## @param configsvr.replicaCount Number of nodes in the replica set (the first node will be primary)
## ##
replicas: 1 replicaCount: 1
## @param configsvr.resources Configure pod resources ## @param configsvr.resources Configure pod resources
## ref: https://kubernetes.io/docs/user-guide/compute-resources/ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
## ##
@@ -354,6 +348,10 @@ configsvr:
## - "--wiredTigerCacheSizeGB=2" ## - "--wiredTigerCacheSizeGB=2"
## ##
mongodbExtraFlags: [] mongodbExtraFlags: []
## @param configsvr.topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
##
topologySpreadConstraints: {}
## @param configsvr.priorityClassName Pod priority class name ## @param configsvr.priorityClassName Pod priority class name
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
## ##
@@ -468,9 +466,9 @@ configsvr:
## Pod disruption budget ## Pod disruption budget
## ##
pdb: pdb:
## @param configsvr.pdb.enabled Enable pod disruption budget ## @param configsvr.pdb.create Enable pod disruption budget
## ##
enabled: false create: false
## @param configsvr.pdb.minAvailable Minimum number of available config pods allowed (`0` to disable) ## @param configsvr.pdb.minAvailable Minimum number of available config pods allowed (`0` to disable)
## ##
minAvailable: 0 minAvailable: 0
@@ -511,6 +509,8 @@ configsvr:
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
## ##
annotations: {} annotations: {}
## @param configsvr.persistence.resourcePolicy Setting it to "keep" to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted
resourcePolicy: ""
## K8s Service Account. ## K8s Service Account.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
## ##
@@ -522,6 +522,12 @@ configsvr:
## If not set and create is true, a name is generated using the XXX.fullname template ## If not set and create is true, a name is generated using the XXX.fullname template
## ##
name: "" name: ""
## @param configsvr.serviceAccount.annotations Additional Service Account annotations (evaluated as a template)
##
annotations: {}
## @param configsvr.serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true
## Use a external config server instead of deploying one ## Use a external config server instead of deploying one
## ##
external: external:
@@ -537,6 +543,100 @@ configsvr:
## @param configsvr.external.replicasetKey Replicaset key of an external Config Server ## @param configsvr.external.replicasetKey Replicaset key of an external Config Server
## ##
replicasetKey: "" replicasetKey: ""
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param configsvr.podSecurityContext.enabled Enable security context
## @param configsvr.podSecurityContext.fsGroup Group ID for the container
##
podSecurityContext:
enabled: true
fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param configsvr.containerSecurityContext.enabled Enabled containers' Security Context
## @param configsvr.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param configsvr.containerSecurityContext.runAsNonRoot Set containers' Security Context runAsNonRoot
## @param configsvr.containerSecurityContext.readOnlyRootFilesystem Set containers' Security Context runAsNonRoot
##
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsNonRoot: true
readOnlyRootFilesystem: false
## @param configsvr.command Override default container command (useful when using custom images)
##
command:
- /bin/bash
- /entrypoint/replicaset-entrypoint.sh
## @param configsvr.args Override default container args (useful when using custom images)
##
args: []
## @param configsvr.terminationGracePeriodSeconds Seconds Redmine pod needs to terminate gracefully
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods
##
terminationGracePeriodSeconds: ""
## @param configsvr.lifecycleHooks for the Config Server container(s) to automate configuration before or after startup
##
lifecycleHooks: {}
## Configure extra options for liveness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param configsvr.livenessProbe.enabled Enable livenessProbe
## @param configsvr.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
## @param configsvr.livenessProbe.periodSeconds Period seconds for livenessProbe
## @param configsvr.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
## @param configsvr.livenessProbe.failureThreshold Failure threshold for livenessProbe
## @param configsvr.livenessProbe.successThreshold Success threshold for livenessProbe
##
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 2
successThreshold: 1
## Configure extra options for readiness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param configsvr.readinessProbe.enabled Enable readinessProbe
## @param configsvr.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
## @param configsvr.readinessProbe.periodSeconds Period seconds for readinessProbe
## @param configsvr.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
## @param configsvr.readinessProbe.failureThreshold Failure threshold for readinessProbe
## @param configsvr.readinessProbe.successThreshold Success threshold for readinessProbe
##
readinessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 6
successThreshold: 1
## Configure extra options for startup probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param configsvr.startupProbe.enabled Enable startupProbe
## @param configsvr.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param configsvr.startupProbe.periodSeconds Period seconds for startupProbe
## @param configsvr.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param configsvr.startupProbe.failureThreshold Failure threshold for startupProbe
## @param configsvr.startupProbe.successThreshold Success threshold for startupProbe
##
startupProbe:
enabled: true
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
## @param configsvr.customLivenessProbe Custom livenessProbe that overrides the default one
##
customLivenessProbe: {}
## @param configsvr.customReadinessProbe Custom readinessProbe that overrides the default one
##
customReadinessProbe: {}
## @param configsvr.customStartupProbe Custom startupProbe that overrides the default one
##
customStartupProbe: {}
## @section Mongos parameters ## @section Mongos parameters
## ##
@@ -545,9 +645,9 @@ configsvr:
## ref: https://docs.mongodb.com/manual/reference/program/mongos/#bin.mongos ## ref: https://docs.mongodb.com/manual/reference/program/mongos/#bin.mongos
## ##
mongos: mongos:
## @param mongos.replicas Number of replicas ## @param mongos.replicaCount Number of replicas
## ##
replicas: 1 replicaCount: 1
## @param mongos.resources Configure pod resources ## @param mongos.resources Configure pod resources
## ref: https://kubernetes.io/docs/user-guide/compute-resources/ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
## ##
@@ -562,6 +662,10 @@ mongos:
## - "--wiredTigerCacheSizeGB=2" ## - "--wiredTigerCacheSizeGB=2"
## ##
mongodbExtraFlags: [] mongodbExtraFlags: []
## @param mongos.topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
##
topologySpreadConstraints: {}
## @param mongos.priorityClassName Pod priority class name ## @param mongos.priorityClassName Pod priority class name
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
## ##
@@ -700,22 +804,22 @@ mongos:
## @param mongos.servicePerReplica.port MongoDB&reg; service port ## @param mongos.servicePerReplica.port MongoDB&reg; service port
## ##
port: 27017 port: 27017
## @param mongos.servicePerReplica.clusterIP Static clusterIP or None for headless services ## @param mongos.servicePerReplica.clusterIPs Array of static clusterIPs for each MongoDB@reg; replica. Length must be the same as mongos.replicaCount
## ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#servicespec-v1-core ## ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/#servicespec-v1-core
## ##
clusterIP: "" clusterIPs: []
## @param mongos.servicePerReplica.nodePort Specify the nodePort value for the LoadBalancer and NodePort service types ## @param mongos.servicePerReplica.nodePorts Array of node ports used for each MongoDB@reg; replica. Length must be the same as mongos.replicaCount
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
## ##
nodePort: "" nodePorts: []
## @param mongos.servicePerReplica.externalIPs External IP list to use with ClusterIP service type ## @param mongos.servicePerReplica.externalIPs External IP list to use with ClusterIP service type
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#external-ips
## ##
externalIPs: [] externalIPs: []
## @param mongos.servicePerReplica.loadBalancerIP Static IP Address to use for LoadBalancer service type ## @param mongos.servicePerReplica.loadBalancerIPs Array of static IP Address to use for each replica LoadBalancer service type. Length must be the same as mongos.replicaCount
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer
## ##
loadBalancerIP: "" loadBalancerIPs: []
## @param mongos.servicePerReplica.loadBalancerSourceRanges List of IP ranges allowed access to load balancer (if supported) ## @param mongos.servicePerReplica.loadBalancerSourceRanges List of IP ranges allowed access to load balancer (if supported)
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service ## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
## ##
@@ -728,12 +832,18 @@ mongos:
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
## ##
sessionAffinity: None sessionAffinity: None
## @param mongos.servicePerReplica.sessionAffinityConfig Additional settings for the sessionAffinity
## sessionAffinityConfig:
## clientIP:
## timeoutSeconds: 300
##
sessionAffinityConfig: {}
## Pod disruption budget ## Pod disruption budget
## ##
pdb: pdb:
## @param mongos.pdb.enabled Enable pod disruption budget ## @param mongos.pdb.create Enable pod disruption budget
## ##
enabled: false create: false
## @param mongos.pdb.minAvailable Minimum number of available mongo pods allowed (`0` to disable) ## @param mongos.pdb.minAvailable Minimum number of available mongo pods allowed (`0` to disable)
## ##
minAvailable: 0 minAvailable: 0
@@ -751,7 +861,104 @@ mongos:
## If not set and create is true, a name is generated using the XXX.fullname template ## If not set and create is true, a name is generated using the XXX.fullname template
## ##
name: "" name: ""
## @param mongos.serviceAccount.annotations Additional Service Account annotations (evaluated as a template)
##
annotations: {}
## @param mongos.serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param mongos.podSecurityContext.enabled Enable security context
## @param mongos.podSecurityContext.fsGroup Group ID for the container
##
podSecurityContext:
enabled: true
fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param mongos.containerSecurityContext.enabled Enabled containers' Security Context
## @param mongos.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param mongos.containerSecurityContext.runAsNonRoot Set containers' Security Context runAsNonRoot
## @param mongos.containerSecurityContext.readOnlyRootFilesystem Set containers' Security Context runAsNonRoot
##
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsNonRoot: true
readOnlyRootFilesystem: false
## @param mongos.command Override default container command (useful when using custom images)
##
command: []
## @param mongos.args Override default container args (useful when using custom images)
##
args: []
## @param mongos.terminationGracePeriodSeconds Seconds Redmine pod needs to terminate gracefully
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods
##
terminationGracePeriodSeconds: ""
## @param mongos.lifecycleHooks for the Mongo container(s) to automate configuration before or after startup
##
lifecycleHooks: {}
## Configure extra options for liveness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param mongos.livenessProbe.enabled Enable livenessProbe
## @param mongos.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
## @param mongos.livenessProbe.periodSeconds Period seconds for livenessProbe
## @param mongos.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
## @param mongos.livenessProbe.failureThreshold Failure threshold for livenessProbe
## @param mongos.livenessProbe.successThreshold Success threshold for livenessProbe
##
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 2
successThreshold: 1
## Configure extra options for readiness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param mongos.readinessProbe.enabled Enable readinessProbe
## @param mongos.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
## @param mongos.readinessProbe.periodSeconds Period seconds for readinessProbe
## @param mongos.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
## @param mongos.readinessProbe.failureThreshold Failure threshold for readinessProbe
## @param mongos.readinessProbe.successThreshold Success threshold for readinessProbe
##
readinessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 6
successThreshold: 1
## Configure extra options for startup probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param mongos.startupProbe.enabled Enable startupProbe
## @param mongos.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param mongos.startupProbe.periodSeconds Period seconds for startupProbe
## @param mongos.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param mongos.startupProbe.failureThreshold Failure threshold for startupProbe
## @param mongos.startupProbe.successThreshold Success threshold for startupProbe
##
startupProbe:
enabled: false
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
## @param mongos.customLivenessProbe Custom livenessProbe that overrides the default one
##
customLivenessProbe: {}
## @param mongos.customReadinessProbe Custom readinessProbe that overrides the default one
##
customReadinessProbe: {}
## @param mongos.customStartupProbe Custom startupProbe that overrides the default one
##
customStartupProbe: {}
## @section Shard configuration: Data node parameters ## @section Shard configuration: Data node parameters
## ##
@@ -762,9 +969,9 @@ shardsvr:
## Properties for data nodes (primary and secondary) ## Properties for data nodes (primary and secondary)
## ##
dataNode: dataNode:
## @param shardsvr.dataNode.replicas Number of nodes in each shard replica set (the first node will be primary) ## @param shardsvr.dataNode.replicaCount Number of nodes in each shard replica set (the first node will be primary)
## ##
replicas: 1 replicaCount: 1
## @param shardsvr.dataNode.resources Configure pod resources ## @param shardsvr.dataNode.resources Configure pod resources
## ref: https://kubernetes.io/docs/user-guide/compute-resources/ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
## ##
@@ -775,6 +982,10 @@ shardsvr:
## - "--wiredTigerCacheSizeGB=2" ## - "--wiredTigerCacheSizeGB=2"
## ##
mongodbExtraFlags: [] mongodbExtraFlags: []
## @param shardsvr.dataNode.topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
##
topologySpreadConstraints: {}
## @param shardsvr.dataNode.priorityClassName Pod priority class name ## @param shardsvr.dataNode.priorityClassName Pod priority class name
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
## ##
@@ -906,9 +1117,9 @@ shardsvr:
## Pod disruption budget ## Pod disruption budget
## ##
pdb: pdb:
## @param shardsvr.dataNode.pdb.enabled Enable pod disruption budget ## @param shardsvr.dataNode.pdb.create Enable pod disruption budget
## ##
enabled: false create: false
## @param shardsvr.dataNode.pdb.minAvailable Minimum number of available data pods allowed (`0` to disable) ## @param shardsvr.dataNode.pdb.minAvailable Minimum number of available data pods allowed (`0` to disable)
## ##
minAvailable: 0 minAvailable: 0
@@ -926,6 +1137,106 @@ shardsvr:
## If not set and create is true, a name is generated using the XXX.fullname template ## If not set and create is true, a name is generated using the XXX.fullname template
## ##
name: "" name: ""
## @param shardsvr.dataNode.serviceAccount.annotations Additional Service Account annotations (evaluated as a template)
##
annotations: {}
## @param shardsvr.dataNode.serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param shardsvr.dataNode.podSecurityContext.enabled Enable security context
## @param shardsvr.dataNode.podSecurityContext.fsGroup Group ID for the container
##
podSecurityContext:
enabled: true
fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param shardsvr.dataNode.containerSecurityContext.enabled Enabled containers' Security Context
## @param shardsvr.dataNode.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param shardsvr.dataNode.containerSecurityContext.runAsNonRoot Set containers' Security Context runAsNonRoot
## @param shardsvr.dataNode.containerSecurityContext.readOnlyRootFilesystem Set containers' Security Context runAsNonRoot
##
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsNonRoot: true
readOnlyRootFilesystem: false
## @param shardsvr.dataNode.command Override default container command (useful when using custom images)
##
command:
- /bin/bash
- /entrypoint/replicaset-entrypoint.sh
## @param shardsvr.dataNode.args Override default container args (useful when using custom images)
##
args: []
## @param shardsvr.dataNode.terminationGracePeriodSeconds Seconds Redmine pod needs to terminate gracefully
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods
##
terminationGracePeriodSeconds: ""
## @param shardsvr.dataNode.lifecycleHooks for the Data container(s) to automate configuration before or after startup
##
lifecycleHooks: {}
## Configure extra options for liveness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.dataNode.livenessProbe.enabled Enable livenessProbe
## @param shardsvr.dataNode.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
## @param shardsvr.dataNode.livenessProbe.periodSeconds Period seconds for livenessProbe
## @param shardsvr.dataNode.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
## @param shardsvr.dataNode.livenessProbe.failureThreshold Failure threshold for livenessProbe
## @param shardsvr.dataNode.livenessProbe.successThreshold Success threshold for livenessProbe
##
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 2
successThreshold: 1
## Configure extra options for readiness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.dataNode.readinessProbe.enabled Enable readinessProbe
## @param shardsvr.dataNode.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
## @param shardsvr.dataNode.readinessProbe.periodSeconds Period seconds for readinessProbe
## @param shardsvr.dataNode.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
## @param shardsvr.dataNode.readinessProbe.failureThreshold Failure threshold for readinessProbe
## @param shardsvr.dataNode.readinessProbe.successThreshold Success threshold for readinessProbe
##
readinessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 6
successThreshold: 1
## Configure extra options for startup probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.dataNode.startupProbe.enabled Enable startupProbe
## @param shardsvr.dataNode.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param shardsvr.dataNode.startupProbe.periodSeconds Period seconds for startupProbe
## @param shardsvr.dataNode.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param shardsvr.dataNode.startupProbe.failureThreshold Failure threshold for startupProbe
## @param shardsvr.dataNode.startupProbe.successThreshold Success threshold for startupProbe
##
startupProbe:
enabled: false
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
## @param shardsvr.dataNode.customLivenessProbe Custom livenessProbe that overrides the default one
##
customLivenessProbe: {}
## @param shardsvr.dataNode.customReadinessProbe Custom readinessProbe that overrides the default one
##
customReadinessProbe: {}
## @param shardsvr.dataNode.customStartupProbe Custom startupProbe that overrides the default one
##
customStartupProbe: {}
## @section Shard configuration: Persistence parameters ## @section Shard configuration: Persistence parameters
## ##
@@ -963,6 +1274,8 @@ shardsvr:
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
## ##
annotations: {} annotations: {}
## @param shardsvr.persistence.resourcePolicy Setting it to "keep" to avoid removing PVCs during a helm delete operation. Leaving it empty will delete PVCs after the chart deleted
resourcePolicy: ""
## @section Shard configuration: Arbiter parameters ## @section Shard configuration: Arbiter parameters
## ##
@@ -971,9 +1284,9 @@ shardsvr:
## ref: https://docs.mongodb.com/manual/tutorial/add-replica-set-arbiter/ ## ref: https://docs.mongodb.com/manual/tutorial/add-replica-set-arbiter/
## ##
arbiter: arbiter:
## @param shardsvr.arbiter.replicas Number of arbiters in each shard replica set (the first node will be primary) ## @param shardsvr.arbiter.replicaCount Number of arbiters in each shard replica set (the first node will be primary)
## ##
replicas: 0 replicaCount: 0
## @param shardsvr.arbiter.hostAliases Deployment pod host aliases ## @param shardsvr.arbiter.hostAliases Deployment pod host aliases
## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ ## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/
## ##
@@ -988,6 +1301,10 @@ shardsvr:
## - "--wiredTigerCacheSizeGB=2" ## - "--wiredTigerCacheSizeGB=2"
## ##
mongodbExtraFlags: [] mongodbExtraFlags: []
## @param shardsvr.arbiter.topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template
## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods
##
topologySpreadConstraints: {}
## @param shardsvr.arbiter.priorityClassName Pod priority class name ## @param shardsvr.arbiter.priorityClassName Pod priority class name
## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ ## https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
## ##
@@ -1115,7 +1432,104 @@ shardsvr:
## If not set and create is true, a name is generated using the XXX.fullname template ## If not set and create is true, a name is generated using the XXX.fullname template
## ##
name: "" name: ""
## @param shardsvr.arbiter.serviceAccount.annotations Additional Service Account annotations (evaluated as a template)
##
annotations: {}
## @param shardsvr.arbiter.serviceAccount.automountServiceAccountToken Automount service account token for the server service account
##
automountServiceAccountToken: true
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
## @param shardsvr.arbiter.podSecurityContext.enabled Enable security context
## @param shardsvr.arbiter.podSecurityContext.fsGroup Group ID for the container
##
podSecurityContext:
enabled: true
fsGroup: 1001
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param shardsvr.arbiter.containerSecurityContext.enabled Enabled containers' Security Context
## @param shardsvr.arbiter.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param shardsvr.arbiter.containerSecurityContext.runAsNonRoot Set containers' Security Context runAsNonRoot
## @param shardsvr.arbiter.containerSecurityContext.readOnlyRootFilesystem Set containers' Security Context runAsNonRoot
##
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsNonRoot: true
readOnlyRootFilesystem: false
## @param shardsvr.arbiter.command Override default container command (useful when using custom images)
##
command: []
## @param shardsvr.arbiter.args Override default container args (useful when using custom images)
##
args: []
## @param shardsvr.arbiter.terminationGracePeriodSeconds Seconds Redmine pod needs to terminate gracefully
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods
##
terminationGracePeriodSeconds: ""
## @param shardsvr.arbiter.lifecycleHooks for the arbiter container(s) to automate configuration before or after startup
##
lifecycleHooks: {}
## Configure extra options for liveness probes
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.arbiter.livenessProbe.enabled Enable livenessProbe
## @param shardsvr.arbiter.livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe
## @param shardsvr.arbiter.livenessProbe.periodSeconds Period seconds for livenessProbe
## @param shardsvr.arbiter.livenessProbe.timeoutSeconds Timeout seconds for livenessProbe
## @param shardsvr.arbiter.livenessProbe.failureThreshold Failure threshold for livenessProbe
## @param shardsvr.arbiter.livenessProbe.successThreshold Success threshold for livenessProbe
##
livenessProbe:
enabled: true
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 2
successThreshold: 1
## Configure extra options for readiness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.arbiter.readinessProbe.enabled Enable readinessProbe
## @param shardsvr.arbiter.readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe
## @param shardsvr.arbiter.readinessProbe.periodSeconds Period seconds for readinessProbe
## @param shardsvr.arbiter.readinessProbe.timeoutSeconds Timeout seconds for readinessProbe
## @param shardsvr.arbiter.readinessProbe.failureThreshold Failure threshold for readinessProbe
## @param shardsvr.arbiter.readinessProbe.successThreshold Success threshold for readinessProbe
##
readinessProbe:
enabled: true
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 20
failureThreshold: 6
successThreshold: 1
## Configure extra options for startup probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param shardsvr.arbiter.startupProbe.enabled Enable startupProbe
## @param shardsvr.arbiter.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param shardsvr.arbiter.startupProbe.periodSeconds Period seconds for startupProbe
## @param shardsvr.arbiter.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param shardsvr.arbiter.startupProbe.failureThreshold Failure threshold for startupProbe
## @param shardsvr.arbiter.startupProbe.successThreshold Success threshold for startupProbe
##
startupProbe:
enabled: false
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 30
successThreshold: 1
## @param shardsvr.arbiter.customLivenessProbe Custom livenessProbe that overrides the default one
##
customLivenessProbe: {}
## @param shardsvr.arbiter.customReadinessProbe Custom readinessProbe that overrides the default one
##
customReadinessProbe: {}
## @param shardsvr.arbiter.customStartupProbe Custom startupProbe that overrides the default one
##
customStartupProbe: {}
## @section Metrics parameters ## @section Metrics parameters
## ##
@@ -1132,7 +1546,7 @@ metrics:
image: image:
registry: docker.io registry: docker.io
repository: bitnami/mongodb-exporter repository: bitnami/mongodb-exporter
tag: 0.31.2-debian-10-r14 tag: 0.32.0-debian-10-r3
pullPolicy: Always pullPolicy: Always
## Optionally specify an array of imagePullSecrets. ## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace. ## Secrets must be manually created in the namespace.
@@ -1153,6 +1567,18 @@ metrics:
## ref: https://kubernetes.io/docs/user-guide/compute-resources/ ## ref: https://kubernetes.io/docs/user-guide/compute-resources/
## ##
resources: {} resources: {}
## Configure Container Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
## @param metrics.containerSecurityContext.enabled Enabled containers' Security Context
## @param metrics.containerSecurityContext.runAsUser Set containers' Security Context runAsUser
## @param metrics.containerSecurityContext.runAsNonRoot Set containers' Security Context runAsNonRoot
## @param metrics.containerSecurityContext.readOnlyRootFilesystem Set containers' Security Context runAsNonRoot
##
containerSecurityContext:
enabled: true
runAsUser: 1001
runAsNonRoot: true
readOnlyRootFilesystem: false
## Metrics exporter liveness probe ## Metrics exporter liveness probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
## @param metrics.livenessProbe.enabled Enable livenessProbe ## @param metrics.livenessProbe.enabled Enable livenessProbe
@@ -1185,9 +1611,36 @@ metrics:
timeoutSeconds: 1 timeoutSeconds: 1
failureThreshold: 3 failureThreshold: 3
successThreshold: 1 successThreshold: 1
## @param metrics.containerPort Port of the Prometheus metrics container ## Configure extra options for startup probe
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#configure-probes
## @param metrics.startupProbe.enabled Enable startupProbe
## @param metrics.startupProbe.initialDelaySeconds Initial delay seconds for startupProbe
## @param metrics.startupProbe.periodSeconds Period seconds for startupProbe
## @param metrics.startupProbe.timeoutSeconds Timeout seconds for startupProbe
## @param metrics.startupProbe.failureThreshold Failure threshold for startupProbe
## @param metrics.startupProbe.successThreshold Success threshold for startupProbe
## ##
containerPort: 9216 startupProbe:
enabled: false
initialDelaySeconds: 0
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 15
successThreshold: 1
## @param metrics.customLivenessProbe Custom livenessProbe that overrides the default one
##
customLivenessProbe: {}
## @param metrics.customReadinessProbe Custom readinessProbe that overrides the default one
##
customReadinessProbe: {}
## @param metrics.customStartupProbe Custom startupProbe that overrides the default one
##
customStartupProbe: {}
## @param metrics.containerPorts.metrics Port of the Prometheus metrics container
##
containerPorts:
metrics: 9216
## @param metrics.podAnnotations [object] Metrics exporter pod Annotation ## @param metrics.podAnnotations [object] Metrics exporter pod Annotation
## ##
podAnnotations: podAnnotations: