couchbase-partners / helm-charts

Helm charts for deployed couchbase services
Apache License 2.0
23 stars 38 forks source link

Error `[Errno 13] Permission denied: '/data/scriptlogs'` faced when try to use the backup option #126

Open camilamacedo86 opened 3 months ago

camilamacedo86 commented 3 months ago

I am facing the error [Errno 13] Permission denied: '/data/scriptlogs' such as reported in: https://www.couchbase.com/forums/t/issue-with-file-permissions-setting-up-couchbase-backup-using-operator/34290

The SecurityContext option used:

    podSecurityContext:
      fsGroup: 1000
      runAsNonRoot: true
      runAsUser: 1000
      sysctls: []
      windowsOptions: {}
    securityContext:
      allowPrivilegeEscalation: false

Could you please let us know how we should configure the HelmChart to do the backups and do not face this issue?

Versions:

camilamacedo86 commented 3 months ago

If we edit the cronjobs like kubectl edit cronjob couchbase-backup-full -n <namespace> to set

securityContext:                                                                                                                                           
            fsGroup: 1000

that works but the BUG is that the HelmChart and Operator (CRD BackupCouchbase) does not allow you set the securityContext to the cronjob :--(

Example

# -- CouchbaseBackups runs a job which preserves data into backups
backups:
  my-couchbase-backup:
    name: couchbase-backup
    strategy: full_incremental
    full:
      schedule: "0 3 * * 0"
    incremental:
      schedule: "0 3 * * 1-6"
    successfulJobsHistoryLimit: 1
    failedJobsHistoryLimit: 3
    securityContext:
      fsGroup: 1000

The securityContext need also become an spec of CouchbaseBackup.spec

camilamacedo86 commented 3 months ago

Hi @Lumin343, @tahmmee @etos @ceejatec @jeffdgr8

Folks, could you please add the option for we set the SecurityContext via the HelmChart/CouchBase backup ?