Skip to content

Commit

Permalink
Merge pull request #295 from percona/k8spsmdb-1042
Browse files Browse the repository at this point in the history
K8SPSMDB-1042 - psmdb - release 1.16.0 and convert replsets from array to map
  • Loading branch information
tplavcic authored May 24, 2024
2 parents 878d860 + 876f904 commit 7bbc281
Show file tree
Hide file tree
Showing 10 changed files with 1,949 additions and 337 deletions.
4 changes: 2 additions & 2 deletions charts/psmdb-db/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: "1.15.0"
appVersion: "1.16.0"
description: A Helm chart for installing Percona Server MongoDB Cluster Databases using the PSMDB Operator.
name: psmdb-db
home: https://www.percona.com/doc/kubernetes-operator-for-psmongodb/index.html
version: 1.15.3
version: 1.16.0
maintainers:
- name: tplavcic
email: [email protected]
Expand Down
193 changes: 105 additions & 88 deletions charts/psmdb-db/README.md

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions charts/psmdb-db/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ Percona Server for MongoDB cluster is deployed now. Get the username and passwor
Connect to the cluster:
{{- if .Values.sharding.enabled }}

kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:5.0 --restart=Never \
-- mongo "mongodb://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-mongos.{{ .Release.Namespace }}.svc.cluster.local/admin?ssl=false"
kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:7.0 --restart=Never \
-- mongosh "mongodb://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-mongos.{{ .Release.Namespace }}.svc.cluster.local/admin?ssl=false"

{{- else }}

kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:5.0 --restart=Never \
-- mongo "mongodb+srv://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-{{ (index .Values.replsets 0).name }}.{{ .Release.Namespace }}.svc.cluster.local/admin?replicaSet=rs0&ssl=false"
kubectl run -i --rm --tty percona-client --image=percona/percona-server-mongodb:7.0 --restart=Never \
-- mongosh "mongodb+srv://${ADMIN_USER}:${ADMIN_PASSWORD}@{{ include "psmdb-database.fullname" . }}-{{ .Values.replsets.rs0.name }}.{{ .Release.Namespace }}.svc.cluster.local/admin?replicaSet=rs0&ssl=false"

{{- end }}

35 changes: 30 additions & 5 deletions charts/psmdb-db/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ spec:
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.imagePullPolicy }}"
{{- if .Values.allowUnsafeConfigurations }}
allowUnsafeConfigurations: true
{{- if .Values.unsafeFlags }}
unsafeFlags:
{{ .Values.unsafeFlags | toYaml | indent 4 }}
{{- end }}
{{- if .Values.ignoreAnnotations }}
ignoreAnnotations:
Expand Down Expand Up @@ -76,8 +77,12 @@ spec:
image: "{{ .Values.pmm.image.repository }}:{{ .Values.pmm.image.tag }}"
serverHost: {{ .Values.pmm.serverHost }}
replsets:
{{- range $replset := .Values.replsets }}
{{- range $k,$replset := .Values.replsets }}
{{- if $replset.name }}
- name: {{ $replset.name }}
{{- else }}
- name: {{ $k }}
{{- end }}
size: {{ $replset.size }}
{{- if $replset.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ $replset.terminationGracePeriodSeconds }}
Expand All @@ -97,8 +102,10 @@ spec:
{{- if $replset.serviceAccountName }}
serviceAccountName: {{ $replset.serviceAccountName }}
{{- end }}
{{- if $replset.affinity }}
affinity:
{{ $replset.affinity | toYaml | indent 6 }}
{{- end }}
{{- if $replset.priorityClass }}
priorityClassName: {{ $replset.priorityClass }}
{{- end }}
Expand Down Expand Up @@ -186,9 +193,11 @@ spec:
schedulerName: {{ $replset.schedulerName }}
{{- end }}
resources:
{{- if $replset.resources }}
{{ $replset.resources | toYaml | indent 6 }}
{{- if $replset.volumeSpec }}
{{- end }}
volumeSpec:
{{- if $replset.volumeSpec }}
{{- if $replset.volumeSpec.hostPath }}
hostPath:
path: {{ $replset.volumeSpec.hostPath.path }}
Expand Down Expand Up @@ -220,7 +229,9 @@ spec:
serviceAccountName: {{ $replset.nonvoting.serviceAccountName }}
{{- end }}
affinity:
{{- if $replset.nonvoting.affinity }}
{{ $replset.nonvoting.affinity | toYaml | indent 8 }}
{{- end }}
{{- if $replset.nonvoting.priorityClass }}
priorityClassName: {{ $replset.nonvoting.priorityClass }}
{{- end }}
Expand Down Expand Up @@ -256,8 +267,10 @@ spec:
minAvailable: {{ $replset.nonvoting.podDisruptionBudget.minAvailable }}
{{- end }}
{{- end }}
{{- if $replset.nonvoting.resources }}
resources:
{{ $replset.nonvoting.resources | toYaml | indent 8 }}
{{- end }}
{{- if $replset.nonvoting.volumeSpec }}
volumeSpec:
{{- if $replset.nonvoting.volumeSpec.hostPath }}
Expand All @@ -283,8 +296,10 @@ spec:
{{- if $replset.arbiter.serviceAccountName }}
serviceAccountName: {{ $replset.arbiter.serviceAccountName }}
{{- end }}
{{- if $replset.affinity }}
affinity:
{{ $replset.arbiter.affinity | toYaml | indent 8 }}
{{- end }}
{{- if $replset.arbiter.priorityClass }}
priorityClassName: {{ $replset.arbiter.priorityClass }}
{{- end }}
Expand Down Expand Up @@ -388,12 +403,14 @@ spec:
sidecarPVCs:
{{ .Values.sharding.configrs.sidecarPVCs | toYaml | indent 8 }}
{{- end }}
{{- if .Values.sharding.configrs.podDisruptionBudget }}
podDisruptionBudget:
{{- if .Values.sharding.configrs.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.sharding.configrs.podDisruptionBudget.maxUnavailable }}
{{- else }}
minAvailable: {{ .Values.sharding.configrs.podDisruptionBudget.minAvailable }}
{{- end }}
{{- end }}
{{- if .Values.sharding.configrs.expose }}
expose:
enabled: {{ .Values.sharding.configrs.expose.enabled }}
Expand Down Expand Up @@ -506,12 +523,14 @@ spec:
sidecarPVCs:
{{ .Values.sharding.mongos.sidecarPVCs | toYaml | indent 8 }}
{{- end }}
{{- if .Values.sharding.mongos.podDisruptionBudget }}
podDisruptionBudget:
{{- if .Values.sharding.mongos.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.sharding.mongos.podDisruptionBudget.maxUnavailable }}
{{- else }}
minAvailable: {{ .Values.sharding.mongos.podDisruptionBudget.minAvailable }}
{{- end }}
{{- end }}
resources:
limits:
cpu: {{ .Values.sharding.mongos.resources.limits.cpu }}
Expand All @@ -536,6 +555,9 @@ spec:
serviceLabels:
{{ .Values.sharding.mongos.expose.serviceLabels | toYaml | indent 10 }}
{{- end }}
{{- if .Values.sharding.mongos.expose.nodePort }}
nodePort: {{ .Values.sharding.mongos.expose.nodePort }}
{{- end }}
{{- if .Values.sharding.mongos.auditLog }}
auditLog:
{{ .Values.sharding.mongos.auditLog | toYaml | indent 8 }}
Expand All @@ -560,7 +582,6 @@ spec:
{{ .Values.backup.containerSecurityContext | toYaml | indent 6 }}
{{- end }}
image: "{{ .Values.backup.image.repository }}:{{ .Values.backup.image.tag }}"
serviceAccountName: {{ .Values.backup.serviceAccountName }}
{{- if .Values.backup.resources }}
resources:
{{ .Values.backup.resources | toYaml | indent 6 }}
Expand All @@ -585,5 +606,9 @@ spec:
{{- else }}
enabled: false
{{- end }}
{{- if .Values.backup.configuration }}
configuration:
{{ .Values.backup.configuration | toYaml | indent 6 }}
{{- end }}
tasks:
{{ .Values.backup.tasks | toYaml | indent 6 }}
53 changes: 46 additions & 7 deletions charts/psmdb-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,16 @@ finalizers:
nameOverride: ""
fullnameOverride: ""

crVersion: 1.15.0
crVersion: 1.16.0
pause: false
unmanaged: false
allowUnsafeConfigurations: false
unsafeFlags:
tls: false
replsetSize: false
mongosSize: false
terminationGracePeriod: false
backupIfUnhealthy: false

# ignoreAnnotations:
# - service.beta.kubernetes.io/aws-load-balancer-backend-protocol
# ignoreLabels:
Expand All @@ -38,7 +44,7 @@ upgradeOptions:

image:
repository: percona/percona-server-mongodb
tag: 6.0.9-7
tag: 7.0.8-5

imagePullPolicy: Always
# imagePullSecrets: []
Expand All @@ -47,23 +53,33 @@ imagePullPolicy: Always
# tag: 1.14.0
# initContainerSecurityContext: {}
# tls:
# mode: preferTLS
# # 90 days in hours
# certValidityDuration: 2160h
# allowInvalidCertificates: true
# issuerConf:
# name: special-selfsigned-issuer
# kind: ClusterIssuer
# group: cert-manager.io
secrets: {}
# If you set users secret here the operator will use existing one or generate random values
# If not set the operator generates the default secret with name <cluster_name>-secrets
# users: my-cluster-name-secrets
# encryptionKey: my-cluster-name-mongodb-encryption-key
# vault: my-cluster-name-vault
# ldapSecret: my-ldap-secret
# sse: my-cluster-name-sse

pmm:
enabled: false
image:
repository: percona/pmm-client
tag: 2.41.0
tag: 2.41.2
serverHost: monitoring-service

replsets:
- name: rs0
rs0:
name: rs0
size: 3
# terminationGracePeriodSeconds: 300
# externalNodes:
Expand Down Expand Up @@ -449,6 +465,7 @@ sharding:
# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
# serviceLabels:
# some-label: some-key
# nodePort: 32017
# auditLog:
# destination: file
# format: BSON
Expand All @@ -463,8 +480,7 @@ backup:
enabled: true
image:
repository: percona/percona-backup-mongodb
tag: 2.3.0
serviceAccountName: percona-server-mongodb-operator
tag: 2.4.1
# annotations:
# iam.amazonaws.com/role: role-arn
# podSecurityContext: {}
Expand All @@ -487,6 +503,10 @@ backup:
# sseAlgorithm: aws:kms
# sseCustomerAlgorithm: AES256
# sseCustomerKey: Y3VzdG9tZXIta2V5
# retryer:
# numMaxRetries: 3
# minRetryDelay: 30ms
# maxRetryDelay: 5m
# region: us-west-2
# prefix: ""
# uploadPartSize: 10485760
Expand All @@ -506,13 +526,32 @@ backup:
# azure:
# container: CONTAINER-NAME
# prefix: PREFIX-NAME
# endpointUrl: https://accountName.blob.core.windows.net
# credentialsSecret: SECRET-NAME
pitr:
enabled: false
oplogOnly: false
# oplogSpanMin: 10
# compressionType: gzip
# compressionLevel: 6
# configuration:
# backupOptions:
# priority:
# "localhost:28019": 2.5
# "localhost:27018": 2.5
# timeouts:
# startingStatus: 33
# oplogSpanMin: 10
# restoreOptions:
# batchSize: 500
# numInsertionWorkers: 10
# numDownloadWorkers: 4
# maxDownloadBufferMb: 0
# downloadChunkMb: 32
# mongodLocation: /usr/bin/mongo
# mongodLocationMap:
# "node01:2017": /usr/bin/mongo
# "node03:27017": /usr/bin/mongo
tasks:
# - name: daily-s3-us-west
# enabled: true
Expand Down
4 changes: 2 additions & 2 deletions charts/psmdb-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: "1.15.0"
appVersion: "1.16.0"
description: A Helm chart for deploying the Percona Operator for MongoDB
name: psmdb-operator
home: https://docs.percona.com/percona-operator-for-mongodb/
version: 1.15.4
version: 1.16.0
maintainers:
- name: tplavcic
email: [email protected]
Expand Down
6 changes: 3 additions & 3 deletions charts/psmdb-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Useful links:
- [Operator Documentation](https://www.percona.com/doc/kubernetes-operator-for-psmongodb/index.html)

## Pre-requisites
* Kubernetes 1.24+
* Kubernetes 1.25+
* Helm v3

# Installation
Expand All @@ -19,15 +19,15 @@ To install the chart with the `psmdb` release name using a dedicated namespace (

```sh
helm repo add percona https://percona.github.io/percona-helm-charts/
helm install my-operator percona/psmdb-operator --version 1.15.0 --namespace my-namespace
helm install my-operator percona/psmdb-operator --version 1.16.0 --namespace my-namespace
```

The chart can be customized using the following configurable parameters:

| Parameter | Description | Default |
| ------------------------------- | ------------------------------------------------------------------------------| ------------------------------------------|
| `image.repository` | PSMDB Operator Container image name | `percona/percona-server-mongodb-operator` |
| `image.tag` | PSMDB Operator Container image tag | `1.15.0` |
| `image.tag` | PSMDB Operator Container image tag | `1.16.0` |
| `image.pullPolicy` | PSMDB Operator Container pull policy | `Always` |
| `image.pullSecrets` | PSMDB Operator Pod pull secret | `[]` |
| `replicaCount` | PSMDB Operator Pod quantity | `1` |
Expand Down
Loading

0 comments on commit 7bbc281

Please sign in to comment.