apiVersion: psmdb.percona.com/v1-9-0 kind: PerconaServerMongoDB metadata: annotations: kubectl.kubernetes.io/last-applied-configuration: | {"apiVersion":"psmdb.percona.com/v1-9-0","kind":"PerconaServerMongoDB"} name: {{ include "psmdb-database.fullname" . }} labels: {{ include "psmdb-database.labels" . | indent 4 }} finalizers: {{ .Values.finalizers | toYaml | indent 4 }} spec: pause: {{ .Values.pause }} {{- if .Values.platform }} platform: {{ .Values.platform }} {{- end }} {{- if .Values.DNSsuffix }} clusterServiceDNSSuffix: {{ .Values.DNSsuffix }} {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: Always {{- if .Values.allowUnsafeConfigurations }} allowUnsafeConfigurations: true {{- end }} {{- if .Values.imagePullSecrets }} imagePullSecrets: {{ .Values.imagePullSecrets | toYaml | indent 4 }} {{- end }} {{- if .Values.runUid }} runUid: {{ .Values.runUid }} {{- end }} {{- if .Values.secrets }} secrets: {{ .Values.secrets | toYaml | indent 4 }} {{- else }} secrets: users: {{ include "psmdb-database.fullname" . }}-secrets {{- end }} {{- if .Values.updateStrategy }} updateStrategy: {{ .Values.updateStrategy }} upgradeOptions: versionServiceEndpoint: {{ .Values.upgradeOptions.versionServiceEndpoint }} apply: {{ .Values.upgradeOptions.apply }} schedule: {{ .Values.upgradeOptions.schedule }} setFCV: {{ .Values.upgradeOptions.setFCV }} {{- end }} pmm: enabled: {{ .Values.pmm.enabled }} image: "{{ .Values.pmm.image.repository }}:{{ .Values.pmm.image.tag }}" serverHost: {{ .Values.pmm.serverHost }} replsets: {{- range $replset := .Values.replsets }} - name: {{ $replset.name }} size: {{ $replset.size }} {{- if $replset.configuration }} configuration: | {{ $replset.configuration | indent 6 }} {{- end }} affinity: antiAffinityTopologyKey: {{ $replset.antiAffinityTopologyKey }} {{- if $replset.priorityClass }} priorityClassName: {{ $replset.priorityClass }} {{- end }} {{- if $replset.annotations }} annotations: {{ $replset.annotations | toYaml | indent 6 }} {{- end }} {{- if $replset.labels }} labels: {{ $replset.labels | toYaml | indent 6 }} {{- end }} {{- if $replset.nodeSelector }} nodeSelector: {{ $replset.nodeSelector | toYaml | indent 6 }} {{- end }} {{- if $replset.livenessProbe }} livenessProbe: {{ $replset.livenessProbe | toYaml | indent 6 }} {{- end }} {{- if $replset.runtimeClass }} runtimeClassName: {{ $replset.runtimeClass }} {{- end }} {{- if $replset.sidecars }} sidecars: {{ $replset.sidecars | toYaml | indent 6 }} {{- end }} podDisruptionBudget: {{- if $replset.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ $replset.podDisruptionBudget.maxUnavailable }} {{- else }} minAvailable: {{ $replset.podDisruptionBudget.minAvailable }} {{- end }} expose: enabled: {{ $replset.expose.enabled }} exposeType: {{ $replset.expose.loadBalancer }} arbiter: enabled: {{ $replset.arbiter.enabled }} size: {{ $replset.arbiter.size }} affinity: antiAffinityTopologyKey: {{ $replset.arbiter.antiAffinityTopologyKey }} {{- if $replset.arbiter.priorityClass }} priorityClassName: {{ $replset.arbiter.priorityClass }} {{- end }} {{- if $replset.arbiter.annotations }} annotations: {{ $replset.arbiter.annotations | toYaml | indent 8 }} {{- end }} {{- if $replset.arbiter.labels }} labels: {{ $replset.arbiter.labels | toYaml | indent 8 }} {{- end }} {{- if $replset.arbiter.nodeSelector }} nodeSelector: {{ $replset.arbiter.nodeSelector | toYaml | indent 8 }} {{- end }} {{- if $replset.schedulerName }} schedulerName: {{ $replset.schedulerName }} {{- end }} resources: {{ $replset.resources | toYaml | indent 6 }} volumeSpec: {{- if $replset.volumeSpec.hostPath }} hostPath: path: {{ $replset.volumeSpec.hostPath }} type: Directory {{- else if $replset.volumeSpec.pvc }} persistentVolumeClaim: {{ $replset.volumeSpec.pvc | toYaml | indent 8 }} {{- else }} emptyDir: {} {{- end }} {{- end }} sharding: enabled: {{ .Values.sharding.enabled }} configsvrReplSet: size: {{ .Values.sharding.configrs.size }} {{- if .Values.sharding.configrs.configuration }} configuration: | {{ .Values.sharding.configrs.configuration | indent 8 }} {{- end }} affinity: antiAffinityTopologyKey: {{ .Values.sharding.configrs.antiAffinityTopologyKey }} {{- if .Values.sharding.configrs.priorityClass }} priorityClassName: {{ .Values.sharding.configrs.priorityClass }} {{- end }} {{- if .Values.sharding.configrs.annotations }} annotations: {{ .Values.sharding.configrs.annotations | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.configrs.labels }} labels: {{ .Values.sharding.configrs.labels | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.configrs.nodeSelector }} nodeSelector: {{ .Values.sharding.configrs.nodeSelector | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.configrs.runtimeClass }} runtimeClassName: {{ .Values.sharding.configrs.runtimeClass }} {{- end }} {{- if .Values.sharding.configrs.sidecars }} sidecars: {{ .Values.sharding.configrs.sidecars | toYaml | indent 8 }} {{- end }} podDisruptionBudget: {{- if .Values.sharding.configrs.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ .Values.sharding.configrs.podDisruptionBudget.maxUnavailable }} {{- else }} minAvailable: {{ .Values.sharding.configrs.podDisruptionBudget.minAvailable }} {{- end }} resources: limits: cpu: {{ .Values.sharding.configrs.resources.limits.cpu }} memory: {{ .Values.sharding.configrs.resources.limits.memory }} requests: cpu: {{ .Values.sharding.configrs.resources.requests.cpu }} memory: {{ .Values.sharding.configrs.resources.requests.memory }} volumeSpec: {{- if .Values.sharding.configrs.volumeSpec.hostPath }} hostPath: path: {{ .Values.sharding.configrs.volumeSpec.hostPath }} type: Directory {{- else if .Values.sharding.configrs.volumeSpec.pvc }} persistentVolumeClaim: {{ .Values.sharding.configrs.volumeSpec.pvc | toYaml | indent 10 }} {{- else }} emptyDir: {} {{- end }} mongos: size: {{ .Values.sharding.mongos.size }} {{- if .Values.sharding.mongos.configuration }} configuration: | {{ .Values.sharding.mongos.configuration | indent 8 }} {{- end }} affinity: antiAffinityTopologyKey: {{ .Values.sharding.mongos.antiAffinityTopologyKey }} {{- if .Values.sharding.mongos.priorityClass }} priorityClassName: {{ .Values.sharding.mongos.priorityClass }} {{- end }} {{- if .Values.sharding.mongos.annotations }} annotations: {{ .Values.sharding.mongos.annotations | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.mongos.labels }} labels: {{ .Values.sharding.mongos.labels | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.mongos.nodeSelector }} nodeSelector: {{ .Values.sharding.mongos.nodeSelector | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.mongos.runtimeClass }} runtimeClassName: {{ .Values.sharding.mongos.runtimeClass }} {{- end }} {{- if .Values.sharding.mongos.sidecars }} sidecars: {{ .Values.sharding.mongos.sidecars | toYaml | indent 8 }} {{- end }} podDisruptionBudget: {{- if .Values.sharding.mongos.podDisruptionBudget.maxUnavailable }} maxUnavailable: {{ .Values.sharding.mongos.podDisruptionBudget.maxUnavailable }} {{- else }} minAvailable: {{ .Values.sharding.mongos.podDisruptionBudget.minAvailable }} {{- end }} resources: limits: cpu: {{ .Values.sharding.mongos.resources.limits.cpu }} memory: {{ .Values.sharding.mongos.resources.limits.memory }} requests: cpu: {{ .Values.sharding.mongos.resources.requests.cpu }} memory: {{ .Values.sharding.mongos.resources.requests.memory }} expose: exposeType: {{ .Values.sharding.mongos.expose.exposeType }} {{- if .Values.sharding.mongos.loadBalancerSourceRanges }} loadBalancerSourceRanges: {{ .Values.sharding.mongos.loadBalancerSourceRanges | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.mongos.serviceAnnotations }} serviceAnnotations: {{ .Values.sharding.mongos.serviceAnnotations | toYaml | indent 8 }} {{- end }} {{- if .Values.sharding.mongos.auditLog }} auditLog: {{ .Values.sharding.mongos.auditLog | toYaml | indent 8 }} {{- end }} mongod: net: port: 27017 hostPort: 0 security: redactClientLogData: false enableEncryption: true encryptionKeySecret: {{ include "psmdb-database.fullname" . }}-mongodb-encryption-key encryptionCipherMode: AES256-CBC setParameter: ttlMonitorSleepSecs: 60 wiredTigerConcurrentReadTransactions: 128 wiredTigerConcurrentWriteTransactions: 128 storage: engine: wiredTiger inMemory: engineConfig: inMemorySizeRatio: 0.9 wiredTiger: engineConfig: cacheSizeRatio: 0.5 directoryForIndexes: false journalCompressor: snappy collectionConfig: blockCompressor: snappy indexConfig: prefixCompression: true operationProfiling: mode: slowOp slowOpThresholdMs: 100 rateLimit: 100 backup: enabled: {{ .Values.backup.enabled }} restartOnFailure: true image: "{{ .Values.backup.image.repository }}:{{ .Values.backup.image.tag }}" serviceAccountName: percona-server-mongodb-operator {{- if .Values.backup.resources }} resources: {{ .Values.backup.resources | toYaml | indent 6 }} {{- end }} storages: {{ .Values.backup.storages | toYaml | indent 6 }} pitr: {{- if and .Values.backup.enabled .Values.backup.pitr.enabled }} enabled: true {{- else }} enabled: false {{- end }} tasks: {{ .Values.backup.tasks | toYaml | indent 6 }}