ansible role update
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{{- if and .Values.shards .Values.shardsvr.arbiter.replicas .Values.shardsvr.arbiter.config }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-shardsvr-arbiter
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.arbiter.config "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,337 @@
|
||||
{{- if and .Values.shards .Values.shardsvr.arbiter.replicas }}
|
||||
{{- $replicas := $.Values.shards | int }}
|
||||
{{- range $i, $e := until $replicas }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-arbiter" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
podManagementPolicy: {{ $.Values.shardsvr.arbiter.podManagementPolicy }}
|
||||
updateStrategy: {{- toYaml $.Values.shardsvr.arbiter.updateStrategy | nindent 4 }}
|
||||
serviceName: {{ include "common.names.fullname" $ }}-headless
|
||||
replicas: {{ $.Values.shardsvr.arbiter.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "common.labels.standard" $ | nindent 8 }}
|
||||
app.kubernetes.io/component: shardsvr-arbiter
|
||||
{{- if $.Values.shardsvr.arbiter.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
shard: {{ $i | quote }}
|
||||
{{- if or $.Values.common.podAnnotations $.Values.shardsvr.arbiter.podAnnotations $.Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if $.Values.common.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.shardsvr.arbiter.serviceAccount "context" $) }}
|
||||
{{- if $.Values.common.schedulerName }}
|
||||
schedulerName: {{ $.Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.affinity "context" (set $ "arbiterLoopId" $i)) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.arbiter.podAffinityPreset "component" "shardsvr-arbiter" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.arbiter.podAntiAffinityPreset "component" "shardsvr-arbiter" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.shardsvr.arbiter.nodeAffinityPreset.type "key" $.Values.shardsvr.arbiter.nodeAffinityPreset.key "values" $.Values.shardsvr.arbiter.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.arbiter.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.priorityClassName }}
|
||||
priorityClassName: {{ $.Values.shardsvr.arbiter.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ $.Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }}
|
||||
{{- if or $.Values.shardsvr.arbiter.initContainers $.Values.common.initContainers }}
|
||||
initContainers:
|
||||
{{- with $.Values.shardsvr.arbiter.initContainers }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ include "common.names.fullname" $ }}-arbiter
|
||||
image: {{ include "mongodb-sharded.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.image.pullPolicy }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
|
||||
runAsUser: {{ $.Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ $.Values.common.containerPorts.mongo }}
|
||||
name: mongodb
|
||||
env:
|
||||
- name: MONGODB_ENABLE_NUMACTL
|
||||
value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }}
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or $.Values.image.debug $.Values.diagnosticMode.enabled) | quote }}
|
||||
- name: MONGODB_SYSTEM_LOG_VERBOSITY
|
||||
value: {{ $.Values.common.mongodbSystemLogVerbosity | quote }}
|
||||
- name: MONGODB_DISABLE_SYSTEM_LOG
|
||||
{{- if $.Values.common.mongodbDisableSystemLog }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
- name: MONGODB_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: MONGODB_MAX_TIMEOUT
|
||||
value: {{ $.Values.common.mongodbMaxWaitTimeout | quote }}
|
||||
- name: MONGODB_SHARDING_MODE
|
||||
value: "shardsvr"
|
||||
- name: MONGODB_REPLICA_SET_MODE
|
||||
value: "arbiter"
|
||||
- name: MONGODB_PORT_NUMBER
|
||||
value: {{ $.Values.common.containerPorts.mongo | quote }}
|
||||
- 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 }}
|
||||
- name: MONGODB_REPLICA_SET_NAME
|
||||
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
|
||||
{{- if $.Values.common.useHostnames }}
|
||||
- name: MONGODB_ADVERTISED_HOSTNAME
|
||||
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
{{- end }}
|
||||
- name: MONGODB_ENABLE_IPV6
|
||||
{{- if $.Values.common.mongodbEnableIPv6 }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
- name: MONGODB_ENABLE_DIRECTORY_PER_DB
|
||||
{{- if $.Values.common.mongodbDirectoryPerDB }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-root-password"
|
||||
- name: MONGODB_REPLICA_SET_KEY_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-replica-set-key"
|
||||
{{- else }}
|
||||
- name: MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-root-password
|
||||
- name: MONGODB_REPLICA_SET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-replica-set-key
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.mongodbExtraFlags }}
|
||||
- name: MONGODB_EXTRA_FLAGS
|
||||
value: {{ $.Values.shardsvr.arbiter.mongodbExtraFlags | join " " | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.common.extraEnvVarsCM $.Values.common.extraEnvVarsSecret $.Values.shardsvr.arbiter.extraEnvVarsCM $.Values.shardsvr.arbiter.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if $.Values.common.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraEnvVarsSecret }}
|
||||
- configMapRef:
|
||||
name: {{ include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
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 }}
|
||||
{{- end }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $.Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: mongodb
|
||||
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ $.Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ $.Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if $.Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: mongodb
|
||||
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ $.Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ $.Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
{{- if or $.Values.shardsvr.arbiter.config $.Values.shardsvr.arbiter.configCM }}
|
||||
- name: config
|
||||
mountPath: /bitnami/mongodb/conf/
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
mountPath: /bitnami/mongodb/secrets/
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
mountPath: /docker-entrypoint-initdb.d/cm
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml $.Values.shardsvr.arbiter.resources | nindent 12 }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "mongodb-sharded.metrics.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
|
||||
runAsUser: {{ $.Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: MONGODB_ROOT_PASSWORD_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-root-password"
|
||||
{{- else }}
|
||||
- name: MONGODB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-root-password
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
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 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- sh
|
||||
- -ec
|
||||
- |-
|
||||
#!/bin/sh
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
|
||||
{{- 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 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
volumeMounts:
|
||||
- name: secrets
|
||||
mountPath: /bitnami/mongodb/secrets/
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ $.Values.metrics.containerPort }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $.Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ $.Values.metrics.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.metrics.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.metrics.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ $.Values.metrics.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ $.Values.metrics.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ $.Values.metrics.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.metrics.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.metrics.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ $.Values.metrics.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ $.Values.metrics.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.arbiter.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if or $.Values.shardsvr.arbiter.config $.Values.shardsvr.arbiter.configCM }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.shardsvr.arbiter.configCM" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
secret:
|
||||
secretName: {{ include "mongodb-sharded.secret" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.initScriptsCM" $ }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
secret:
|
||||
secretName: {{ include "mongodb-sharded.initScriptsSecret" $ }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.arbiter.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.arbiter.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if lt $i (sub $replicas 1) }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if and .Values.shards .Values.shardsvr.dataNode.config }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "common.names.fullname" . }}-shardsvr-data
|
||||
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
data:
|
||||
mongodb.conf: |-
|
||||
{{- include "common.tplvalues.render" (dict "value" .Values.shardsvr.dataNode.config "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,23 @@
|
||||
{{- if and .Values.shards .Values.shardsvr.dataNode.pdb.enabled -}}
|
||||
{{- $replicas := .Values.shards | int -}}
|
||||
{{- range $i, $e := until $replicas -}}
|
||||
kind: PodDisruptionBudget
|
||||
apiVersion: {{ include "common.capabilities.policy.apiVersion" . }}
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
shard: {{ $i | quote }}
|
||||
{{- if $.Values.shardsvr.dataNode.pdb.minAvailable }}
|
||||
minAvailable: {{ $.Values.shardsvr.dataNode.pdb.minAvailable | int }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ $.Values.shardsvr.dataNode.pdb.maxUnavailable | int }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,35 @@
|
||||
{{- if and .Values.shards .Values.metrics.enabled .Values.metrics.podMonitor.enabled }}
|
||||
{{- $replicas := .Values.shards | int }}
|
||||
{{- range $i, $e := until $replicas }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
|
||||
{{- if $.Values.metrics.podMonitor.namespace }}
|
||||
namespace: {{ $.Values.metrics.podMonitor.namespace }}
|
||||
{{- else }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
{{- if $.Values.metrics.podMonitor.additionalLabels }}
|
||||
{{- include "common.tplvalues.render" (dict "value" $.Values.metrics.podMonitor.additionalLabels "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podMetricsEndpoints:
|
||||
- port: metrics
|
||||
path: /metrics
|
||||
{{- if $.Values.metrics.podMonitor.interval }}
|
||||
interval: {{ $.Values.metrics.podMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.podMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ $.Values.metrics.podMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ $.Release.Namespace }}
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,387 @@
|
||||
{{- if .Values.shards }}
|
||||
{{- $replicas := .Values.shards | int }}
|
||||
{{- range $i, $e := until $replicas }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ printf "%s-shard%d-data" (include "common.names.fullname" $ ) $i }}
|
||||
labels: {{- include "common.labels.standard" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
podManagementPolicy: {{ $.Values.shardsvr.dataNode.podManagementPolicy }}
|
||||
updateStrategy: {{- toYaml $.Values.shardsvr.dataNode.updateStrategy | nindent 4 }}
|
||||
serviceName: {{ include "common.names.fullname" $ }}-headless
|
||||
replicas: {{ $.Values.shardsvr.dataNode.replicas }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "common.labels.standard" $ | nindent 8 }}
|
||||
app.kubernetes.io/component: shardsvr
|
||||
{{- if $.Values.shardsvr.dataNode.podLabels }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podLabels "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
shard: {{ $i | quote }}
|
||||
{{- if or $.Values.common.podAnnotations $.Values.shardsvr.dataNode.podAnnotations $.Values.metrics.enabled }}
|
||||
annotations:
|
||||
{{- if $.Values.common.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.podAnnotations }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.metrics.podAnnotations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $.Values.common.schedulerName }}
|
||||
schedulerName: {{ $.Values.common.schedulerName | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.affinity }}
|
||||
affinity: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.affinity "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }}
|
||||
{{- else }}
|
||||
affinity:
|
||||
podAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.dataNode.podAffinityPreset "component" "shardsvr" "context" $) | nindent 10 }}
|
||||
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" $.Values.shardsvr.dataNode.podAntiAffinityPreset "component" "shardsvr" "context" $) | nindent 10 }}
|
||||
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" $.Values.shardsvr.dataNode.nodeAffinityPreset.type "key" $.Values.shardsvr.dataNode.nodeAffinityPreset.key "values" $.Values.shardsvr.dataNode.nodeAffinityPreset.values) | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.hostAliases }}
|
||||
hostAliases: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.hostAliases "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.nodeSelector }}
|
||||
nodeSelector: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.nodeSelector "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.tolerations }}
|
||||
tolerations: {{- include "common.tplvalues.render" (dict "value" $.Values.shardsvr.dataNode.tolerations "context" (set $ "dataNodeLoopId" $i)) | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "mongodb-sharded.serviceAccountName" (dict "value" $.Values.shardsvr.dataNode.serviceAccount "context" $) }}
|
||||
{{- if $.Values.shardsvr.dataNode.priorityClassName }}
|
||||
priorityClassName: {{ $.Values.shardsvr.dataNode.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ $.Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- include "mongodb-sharded.imagePullSecrets" $ | nindent 6 }}
|
||||
initContainers:
|
||||
{{- if and $.Values.volumePermissions.enabled $.Values.shardsvr.persistence.enabled }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "mongodb-sharded.volumePermissions.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command: ["chown", "-R", "{{ $.Values.securityContext.runAsUser }}:{{ $.Values.securityContext.fsGroup }}", "{{ $.Values.shardsvr.persistence.mountPath }}"]
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
resources: {{ toYaml $.Values.volumePermissions.resources | nindent 12 }}
|
||||
volumeMounts:
|
||||
- name: datadir
|
||||
mountPath: {{ $.Values.shardsvr.persistence.mountPath }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.dataNode.initContainers }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.initContainers }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: {{ include "mongodb-sharded.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.image.pullPolicy }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
|
||||
runAsUser: {{ $.Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- containerPort: {{ $.Values.common.containerPorts.mongo }}
|
||||
name: mongodb
|
||||
env:
|
||||
- name: MONGODB_ENABLE_NUMACTL
|
||||
value: {{ ternary "yes" "no" $.Values.common.mongodbEnableNumactl | quote }}
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" (or $.Values.image.debug $.Values.diagnosticMode.enabled) | quote }}
|
||||
- name: MONGODB_SYSTEM_LOG_VERBOSITY
|
||||
value: {{ $.Values.common.mongodbSystemLogVerbosity | quote }}
|
||||
- name: MONGODB_MAX_TIMEOUT
|
||||
value: {{ $.Values.common.mongodbMaxWaitTimeout | quote }}
|
||||
- name: MONGODB_DISABLE_SYSTEM_LOG
|
||||
{{- if $.Values.mongodbDisableSystemLog }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
- name: MONGODB_PORT_NUMBER
|
||||
value: {{ $.Values.common.containerPorts.mongo | quote }}
|
||||
- name: MONGODB_SHARDING_MODE
|
||||
value: "shardsvr"
|
||||
- name: MONGODB_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: MONGODB_MONGOS_HOST
|
||||
value: {{ include "mongodb-sharded.serviceName" $ }}
|
||||
- name: MONGODB_MONGOS_PORT_NUMBER
|
||||
value: {{ $.Values.service.port | quote }}
|
||||
- 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 }}
|
||||
- name: MONGODB_REPLICA_SET_NAME
|
||||
value: {{ printf "%s-shard-%d" ( include "common.names.fullname" $ ) $i }}
|
||||
{{- if $.Values.common.useHostnames }}
|
||||
- name: MONGODB_ADVERTISED_HOSTNAME
|
||||
value: "$(MONGODB_POD_NAME).{{ include "common.names.fullname" $ }}-headless.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}"
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: MONGODB_ROOT_PASSWORD_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-root-password"
|
||||
- name: MONGODB_REPLICA_SET_KEY_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-replica-set-key"
|
||||
{{- else }}
|
||||
- name: MONGODB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-root-password
|
||||
- name: MONGODB_REPLICA_SET_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-replica-set-key
|
||||
{{- end }}
|
||||
- name: MONGODB_ENABLE_IPV6
|
||||
{{- if $.Values.common.mongodbEnableIPv6 }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
- name: MONGODB_ENABLE_DIRECTORY_PER_DB
|
||||
{{- if $.Values.common.mongodbDirectoryPerDB }}
|
||||
value: "yes"
|
||||
{{- else }}
|
||||
value: "no"
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.mongodbExtraFlags }}
|
||||
- name: MONGODB_EXTRA_FLAGS
|
||||
value: {{ $.Values.shardsvr.dataNode.mongodbExtraFlags | join " " | quote }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraEnvVars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraEnvVars "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if or $.Values.common.extraEnvVarsCM $.Values.common.extraEnvVarsSecret $.Values.shardsvr.dataNode.extraEnvVarsCM $.Values.shardsvr.dataNode.extraEnvVarsSecret }}
|
||||
envFrom:
|
||||
{{- if $.Values.common.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.common.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraEnvVarsCM }}
|
||||
- configMapRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.extraEnvVarsCM "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraEnvVarsSecret }}
|
||||
- secretRef:
|
||||
name: {{ include "mongodb-sharded.tplValue" ( dict "value" $.Values.shardsvr.dataNode.extraEnvVarsSecret "context" $ ) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
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 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- /entrypoint/replicaset-entrypoint.sh
|
||||
{{- end }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $.Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- pgrep
|
||||
- mongod
|
||||
initialDelaySeconds: {{ $.Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ $.Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ $.Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if $.Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- mongo
|
||||
- --disableImplicitSessions
|
||||
- --eval
|
||||
- "db.adminCommand('ping')"
|
||||
initialDelaySeconds: {{ $.Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ $.Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ $.Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: replicaset-entrypoint-configmap
|
||||
mountPath: /entrypoint
|
||||
- name: datadir
|
||||
mountPath: {{ $.Values.shardsvr.persistence.mountPath }}
|
||||
{{- if or $.Values.shardsvr.dataNode.config $.Values.shardsvr.dataNode.configCM }}
|
||||
- name: config
|
||||
mountPath: /bitnami/mongodb/conf/
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
mountPath: /bitnami/mongodb/secrets/
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
mountPath: /docker-entrypoint-initdb.d/cm
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
mountPath: /docker-entrypoint-initdb.d/secret
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraVolumeMounts }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumeMounts "context" $ ) | nindent 12 }}
|
||||
{{- end }}
|
||||
resources: {{- toYaml $.Values.shardsvr.dataNode.resources | nindent 12 }}
|
||||
{{- if $.Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
image: {{ include "mongodb-sharded.metrics.image" $ }}
|
||||
imagePullPolicy: {{ $.Values.metrics.image.pullPolicy | quote }}
|
||||
{{- if $.Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsNonRoot: {{ $.Values.securityContext.runAsNonRoot }}
|
||||
runAsUser: {{ $.Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: MONGODB_ROOT_PASSWORD_FILE
|
||||
value: "/bitnami/mongodb/secrets/mongodb-root-password"
|
||||
{{- else }}
|
||||
- name: MONGODB_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "mongodb-sharded.secret" $ }}
|
||||
key: mongodb-root-password
|
||||
{{- end }}
|
||||
{{- if $.Values.diagnosticMode.enabled }}
|
||||
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 }}
|
||||
{{- else }}
|
||||
command:
|
||||
- sh
|
||||
- -ec
|
||||
- |-
|
||||
#!/bin/sh
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
export MONGODB_ROOT_PASSWORD="$(cat "${MONGODB_ROOT_PASSWORD_FILE}")"
|
||||
{{- 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 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
volumeMounts:
|
||||
- name: secrets
|
||||
mountPath: /bitnami/mongodb/secrets/
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: {{ $.Values.metrics.containerPort }}
|
||||
{{- if not $.Values.diagnosticMode.enabled }}
|
||||
{{- if $.Values.metrics.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ $.Values.metrics.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.metrics.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.metrics.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ $.Values.metrics.livenessProbe.failureThreshold }}
|
||||
successThreshold: {{ $.Values.metrics.livenessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- if $.Values.metrics.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: metrics
|
||||
initialDelaySeconds: {{ $.Values.metrics.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ $.Values.metrics.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ $.Values.metrics.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ $.Values.metrics.readinessProbe.failureThreshold }}
|
||||
successThreshold: {{ $.Values.metrics.readinessProbe.successThreshold }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
resources: {{ toYaml $.Values.metrics.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.shardsvr.dataNode.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $.Values.common.sidecars }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
- name: replicaset-entrypoint-configmap
|
||||
configMap:
|
||||
name: {{ include "common.names.fullname" $ }}-replicaset-entrypoint
|
||||
{{- if $.Values.usePasswordFile }}
|
||||
- name: secrets
|
||||
secret:
|
||||
secretName: {{ include "mongodb-sharded.secret" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsCM }}
|
||||
- name: custom-init-scripts-cm
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.initScriptsCM" $ }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if $.Values.common.initScriptsSecret }}
|
||||
- name: custom-init-scripts-secret
|
||||
secret:
|
||||
secretName: {{ include "mongodb-sharded.initScriptsSecret" $ }}
|
||||
defaultMode: 0755
|
||||
{{- end }}
|
||||
{{- if or $.Values.shardsvr.dataNode.config $.Values.shardsvr.dataNode.configCM }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "mongodb-sharded.shardsvr.dataNode.configCM" $ }}
|
||||
{{- end }}
|
||||
{{- if $.Values.common.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.common.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.dataNode.extraVolumes }}
|
||||
{{- include "common.tplvalues.render" ( dict "value" $.Values.shardsvr.dataNode.extraVolumes "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if $.Values.shardsvr.persistence.enabled }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: datadir
|
||||
annotations:
|
||||
{{- range $key, $value := $.Values.shardsvr.persistence.annotations }}
|
||||
{{ $key }}: "{{ $value }}"
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range $.Values.shardsvr.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $.Values.shardsvr.persistence.size | quote }}
|
||||
{{- include "common.storage.class" (dict "persistence" $.Values.shardsvr.persistence "global" $.Values.global) | nindent 8 }}
|
||||
{{- else }}
|
||||
- name: datadir
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if lt $i (sub $replicas 1) }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user