-
Notifications
You must be signed in to change notification settings - Fork 166
K8SPSMDB-1237: add incremental backups #1836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 22 commits
5a9fd78
3642e59
3089c9f
d027dc4
cb39268
fdf064a
2e048f7
12cb4da
20a094a
fd681cf
be557c2
9cf30c3
f533760
1386647
60235d1
2280fca
9b5d933
ea262f8
5e3b374
3c9f920
b5c517f
9f69f5a
0f5899e
88a7ff1
48f95f9
ed8e6bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,6 +71,8 @@ spec: | |
| enum: | ||
| - logical | ||
| - physical | ||
| - incremental | ||
| - incremental-base | ||
| type: string | ||
| type: object | ||
| status: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -723,3 +723,19 @@ spec: | |
| # storageName: s3-us-west | ||
| # compressionType: gzip | ||
| # compressionLevel: 6 | ||
| # - name: weekly-s3-us-west-incremental | ||
| # enabled: false | ||
| # schedule: "0 1 * * *" | ||
| # keep: 5 | ||
| # type: incremental | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pooknull I have error when I try to use it
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to skip
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| # storageName: s3-us-west | ||
| # compressionType: gzip | ||
| # compressionLevel: 6 | ||
| # - name: weekly-s3-us-west-incremental-base | ||
| # enabled: false | ||
| # schedule: "0 5 * * 0" | ||
| # keep: 5 | ||
| # type: incremental-base | ||
| # storageName: s3-us-west | ||
| # compressionType: gzip | ||
| # compressionLevel: 6 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| switched to db myApp | ||
| { "_id" : , "x" : 100501 } | ||
| { "_id" : , "x" : 100502 } | ||
| bye |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| switched to db myApp | ||
| { "_id" : , "x" : 100501 } | ||
| bye |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| switched to db myApp | ||
| { "_id" : , "x" : 100500 } | ||
| bye |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,258 @@ | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| annotations: | ||
| percona.com/restore-in-progress: "true" | ||
| generation: 2 | ||
| labels: | ||
| app.kubernetes.io/component: mongod | ||
| app.kubernetes.io/instance: some-name | ||
| app.kubernetes.io/managed-by: percona-server-mongodb-operator | ||
| app.kubernetes.io/name: percona-server-mongodb | ||
| app.kubernetes.io/part-of: percona-server-mongodb | ||
| app.kubernetes.io/replset: rs0 | ||
| name: some-name-rs0 | ||
| ownerReferences: | ||
| - controller: true | ||
| kind: PerconaServerMongoDB | ||
| name: some-name | ||
| spec: | ||
| podManagementPolicy: OrderedReady | ||
| replicas: 3 | ||
| revisionHistoryLimit: 10 | ||
| selector: | ||
| matchLabels: | ||
| app.kubernetes.io/component: mongod | ||
| app.kubernetes.io/instance: some-name | ||
| app.kubernetes.io/managed-by: percona-server-mongodb-operator | ||
| app.kubernetes.io/name: percona-server-mongodb | ||
| app.kubernetes.io/part-of: percona-server-mongodb | ||
| app.kubernetes.io/replset: rs0 | ||
| serviceName: some-name-rs0 | ||
| template: | ||
| metadata: | ||
| annotations: {} | ||
| labels: | ||
| app.kubernetes.io/component: mongod | ||
| app.kubernetes.io/instance: some-name | ||
| app.kubernetes.io/managed-by: percona-server-mongodb-operator | ||
| app.kubernetes.io/name: percona-server-mongodb | ||
| app.kubernetes.io/part-of: percona-server-mongodb | ||
| app.kubernetes.io/replset: rs0 | ||
| spec: | ||
| containers: | ||
| - args: | ||
| - --bind_ip_all | ||
| - --auth | ||
| - --dbpath=/data/db | ||
| - --port=27017 | ||
| - --replSet=rs0 | ||
| - --storageEngine=wiredTiger | ||
| - --relaxPermChecks | ||
| - --sslAllowInvalidCertificates | ||
| - --clusterAuthMode=x509 | ||
| - --tlsMode=preferTLS | ||
| - --shardsvr | ||
| - --enableEncryption | ||
| - --encryptionKeyFile=/etc/mongodb-encryption/encryption-key | ||
| - --wiredTigerCacheSizeGB=0.25 | ||
| - --wiredTigerIndexPrefixCompression=true | ||
| - --config=/etc/mongodb-config/mongod.conf | ||
| - --quiet | ||
| command: | ||
| - /opt/percona/physical-restore-ps-entry.sh | ||
| env: | ||
| - name: SERVICE_NAME | ||
| value: some-name | ||
| - name: MONGODB_PORT | ||
| value: "27017" | ||
| - name: MONGODB_REPLSET | ||
| value: rs0 | ||
| - name: PBM_AGENT_MONGODB_USERNAME | ||
| valueFrom: | ||
| secretKeyRef: | ||
| key: MONGODB_BACKUP_USER_ESCAPED | ||
| name: internal-some-name-users | ||
| optional: false | ||
| - name: PBM_AGENT_MONGODB_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| key: MONGODB_BACKUP_PASSWORD_ESCAPED | ||
| name: internal-some-name-users | ||
| optional: false | ||
| - name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| apiVersion: v1 | ||
| fieldPath: metadata.name | ||
| - name: PBM_MONGODB_URI | ||
| value: mongodb://$(PBM_AGENT_MONGODB_USERNAME):$(PBM_AGENT_MONGODB_PASSWORD)@$(POD_NAME) | ||
| envFrom: | ||
| - secretRef: | ||
| name: internal-some-name-users | ||
| optional: false | ||
| imagePullPolicy: Always | ||
| livenessProbe: | ||
| exec: | ||
| command: | ||
| - /opt/percona/mongodb-healthcheck | ||
| - k8s | ||
| - liveness | ||
| - --ssl | ||
| - --sslInsecure | ||
| - --sslCAFile | ||
| - /etc/mongodb-ssl/ca.crt | ||
| - --sslPEMKeyFile | ||
| - /tmp/tls.pem | ||
| - --startupDelaySeconds | ||
| - "7200" | ||
| failureThreshold: 4 | ||
| initialDelaySeconds: 60 | ||
| periodSeconds: 30 | ||
| successThreshold: 1 | ||
| timeoutSeconds: 10 | ||
| name: mongod | ||
| ports: | ||
| - containerPort: 27017 | ||
| name: mongodb | ||
| protocol: TCP | ||
| readinessProbe: | ||
| exec: | ||
| command: | ||
| - /opt/percona/mongodb-healthcheck | ||
| - k8s | ||
| - readiness | ||
| - --component | ||
| - mongod | ||
| failureThreshold: 8 | ||
| initialDelaySeconds: 10 | ||
| periodSeconds: 3 | ||
| successThreshold: 1 | ||
| timeoutSeconds: 2 | ||
| resources: | ||
| limits: | ||
| cpu: 500m | ||
| memory: 1G | ||
| requests: | ||
| cpu: 100m | ||
| memory: 100M | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| terminationMessagePath: /dev/termination-log | ||
| terminationMessagePolicy: File | ||
| volumeMounts: | ||
| - mountPath: /data/db | ||
| name: mongod-data | ||
| - mountPath: /etc/mongodb-secrets | ||
| name: some-name-mongodb-keyfile | ||
| readOnly: true | ||
| - mountPath: /etc/mongodb-ssl | ||
| name: ssl | ||
| readOnly: true | ||
| - mountPath: /etc/mongodb-ssl-internal | ||
| name: ssl-internal | ||
| readOnly: true | ||
| - mountPath: /etc/mongodb-config | ||
| name: config | ||
| - mountPath: /opt/percona | ||
| name: bin | ||
| - mountPath: /etc/mongodb-encryption | ||
| name: some-name-mongodb-encryption-key | ||
| readOnly: true | ||
| - mountPath: /etc/users-secret | ||
| name: users-secret-file | ||
| - mountPath: /etc/pbm/ | ||
| name: pbm-config | ||
| readOnly: true | ||
| workingDir: /data/db | ||
| dnsPolicy: ClusterFirst | ||
| initContainers: | ||
| - command: | ||
| - /init-entrypoint.sh | ||
| imagePullPolicy: Always | ||
| name: mongo-init | ||
| resources: | ||
| limits: | ||
| cpu: 500m | ||
| memory: 1G | ||
| requests: | ||
| cpu: 100m | ||
| memory: 100M | ||
| terminationMessagePath: /dev/termination-log | ||
| terminationMessagePolicy: File | ||
| volumeMounts: | ||
| - mountPath: /data/db | ||
| name: mongod-data | ||
| - mountPath: /opt/percona | ||
| name: bin | ||
| - command: | ||
| - bash | ||
| - -c | ||
| - install -D /usr/bin/pbm /opt/percona/pbm && install -D /usr/bin/pbm-agent /opt/percona/pbm-agent | ||
| imagePullPolicy: Always | ||
| name: pbm-init | ||
| resources: {} | ||
| terminationMessagePath: /dev/termination-log | ||
| terminationMessagePolicy: File | ||
| volumeMounts: | ||
| - mountPath: /data/db | ||
| name: mongod-data | ||
| - mountPath: /opt/percona | ||
| name: bin | ||
| restartPolicy: Always | ||
| schedulerName: default-scheduler | ||
| securityContext: {} | ||
| serviceAccount: default | ||
| serviceAccountName: default | ||
| terminationGracePeriodSeconds: 60 | ||
| volumes: | ||
| - name: some-name-mongodb-keyfile | ||
| secret: | ||
| defaultMode: 288 | ||
| optional: false | ||
| secretName: some-name-mongodb-keyfile | ||
| - emptyDir: {} | ||
| name: bin | ||
| - configMap: | ||
| defaultMode: 420 | ||
| name: some-name-rs0-mongod | ||
| optional: true | ||
| name: config | ||
| - name: some-name-mongodb-encryption-key | ||
| secret: | ||
| defaultMode: 288 | ||
| optional: false | ||
| secretName: some-name-mongodb-encryption-key | ||
| - name: ssl | ||
| secret: | ||
| defaultMode: 288 | ||
| optional: false | ||
| secretName: some-name-ssl | ||
| - name: ssl-internal | ||
| secret: | ||
| defaultMode: 288 | ||
| optional: true | ||
| secretName: some-name-ssl-internal | ||
| - name: users-secret-file | ||
| secret: | ||
| defaultMode: 420 | ||
| secretName: internal-some-name-users | ||
| - name: pbm-config | ||
| secret: | ||
| defaultMode: 420 | ||
| secretName: some-name-pbm-config | ||
| updateStrategy: | ||
| rollingUpdate: | ||
| partition: 0 | ||
| type: RollingUpdate | ||
| volumeClaimTemplates: | ||
| - metadata: | ||
| name: mongod-data | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 3Gi | ||
| status: | ||
| phase: Pending |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pooknull please check how the retention works for incremental backups. We can implement it in next release but now we need to remove "keep" option from incremental.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9f69f5a