charts icon indicating copy to clipboard operation
charts copied to clipboard

`object_store` recovery is not possible without `clusterName` set

Open mrclrchtr opened this issue 2 years ago • 2 comments

Version 0.0.6 of Cluster-Chart

The following full config is not possible without clusterName set:

backups:
  enabled: true
  data:
    encryption: "" # Contabo does not support encryption
  wal:
    encryption: "" # Contabo does not support encryption
  endpointURL: "https://eu2.contabostorage.com"
  s3:
    bucket: "cnpg-cluster"
    accessKey: "xxx"
    secretKey: "xxx"
    path: "/backups"
  scheduledBackups:
    - name: daily-backup
      schedule: "0 * * * * *" # Daily at midnight
      backupOwnerReference: self

mode: recovery
recovery:
  method: "object_store"
  endpointURL: "https://eu2.contabostorage.com"
  # clusterName: "cnpg-cluster"
  s3:
    bucket: "cnpg-cluster"
    accessKey: "xxx"
    secretKey: "xxx"
    path: "/recovery"

With cluster name, the recovery works perfectly.

I did not use a different cluster name for the backup. It's the same config, I want to recover from.

mrclrchtr avatar Apr 02 '24 18:04 mrclrchtr

Is your Helm release called the same?

itay-grudev avatar Apr 08 '24 16:04 itay-grudev

I'm using kustomize:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

helmCharts:
  - name: cnpg-cluster
    repo: https://cloudnative-pg.github.io/charts
    releaseName: cnpg-cluster
    version: 0.0.7
    valuesFile: ../../../base/cnpg-cluster/values.yaml

So the it's the same I assume.

mrclrchtr avatar Apr 08 '24 20:04 mrclrchtr

I'm sorry for the late response, but to understand the issue I need to clarify a couple of things.

According to the documentation for serverName, the underlying parameter:

The server name on S3, the cluster name is used if this parameter is omitted

In turn the cluster name is based on the chart name and release name. Assuming that the release name was identical between the original standalone cluster and the consecutive recovery cluster it would have worked without needing to specify recovery.clusterName.

That being said I'll crate a PR that sets it to:

serverName: {{ default (include "cluster.fullname" .) .Values.recovery.clusterName }}

This should make sure it is consistent.

itay-grudev avatar May 24 '24 22:05 itay-grudev