Open camilamacedo86 opened 6 months ago
We can try to workaround by creating the JOB
kubectl apply -f - <<EOF
apiVersion: batch/v1
kind: Job
metadata:
annotations:
operator.couchbase.com/version: 2.5.0
name: couchbase-restore-test
namespace: couchbase
labels:
app: couchbase
couchbase_cluster: couchbase
couchbase_restore: couchbase-restore
spec:
backoffLimit: 2
completionMode: NonIndexed
completions: 1
parallelism: 1
suspend: false
template:
metadata:
labels:
app: couchbase
couchbase_cluster: couchbase
couchbase_restore: couchbase-restore
spec:
containers:
- args:
- --mode
- restore
- --v
- "DEBUG"
- --log-ret
- "168.00"
- couchbase
- --repo
- couchbase-2024-05-28T06_41_38
- --threads
- "1"
- --obj-endpoint
- storage.googleapis.com
- --obj-store
- gs://my-couchbase
image: docker.io/couchbase/operator-backup:1.3.8
imagePullPolicy: IfNotPresent
name: cbbackupmgr-restore
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /data
name: couchbase-cluster-backup-volume
- mountPath: /var/run/secrets/couchbase
name: couchbase-admin
readOnly: true
workingDir: /
dnsPolicy: ClusterFirst
restartPolicy: Never
schedulerName: default-scheduler
securityContext:
fsGroup: 1000
serviceAccountName: couchbase-backup
terminationGracePeriodSeconds: 30
volumes:
- name: couchbase-cluster-backup-volume
persistentVolumeClaim:
claimName: couchbase-backup
- name: couchbase-admin
secret:
defaultMode: 420
secretName: my-secret
EOF
However, that will fails because the Operator will say that the CR is not created
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"couchbasebackuprestores.couchbase.com \"couchbase-restore\" not found","reason":"NotFound","details":{"name":"couchbase-restore","group":"couchbase.com","kind":"couchbasebackuprestores"},"code":404}
I could workaround this issue by
- --default-recovery
- "purge"
See: https://docs.couchbase.com/operator/current/howto-backup.html#restoring-from-a-backup
By applying the resource it will not workout the issue faced is described following and it is the same scenario of to create the backup at the first place: https://github.com/couchbase-partners/helm-charts/issues/126#issuecomment-2126675183
PS.: This issue seems to be impossible to workaround since the Operator will delete the Cronjob.