percona / percona-xtradb-cluster-operator

Percona Operator for MySQL based on Percona XtraDB Cluster
https://www.percona.com/doc/kubernetes-operator-for-pxc/index.html
Apache License 2.0
512 stars 184 forks source link

Can't configure backup correctly -> Endpoint and Region #1723

Closed adrien-barret closed 1 month ago

adrien-barret commented 1 month ago

Report

I have set a backup on my DB configuration using custom values and deployment. It seems that the endpoint and default region is not took correctly in env as the values keep to be:

│       ACCESS_KEY_ID:      <set to the key 'AWS_ACCESS_KEY_ID' in secret 'mysql-s3-backup-secret'>      Optional: false                                                                                           │4s         │                                                               │
│       SECRET_ACCESS_KEY:  <set to the key 'AWS_SECRET_ACCESS_KEY' in secret 'mysql-s3-backup-secret'>  Optional: false                                                                                           │64s        │                                                               │
│       DEFAULT_REGION:     us-west-2                                                                                                                                                                              │108m       │                                                               │
│       ENDPOINT:           https://sfo2.digitaloceanspaces.com 

whatever I put as region or endpoint the values doesn't change. I tried by the config and by the env variables but still the same.

I use a gcp bucket which is compaptible but I needed to change my secret to use AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY instead of credentialsAccessKey/credentialsSecretKey refered into the values.yaml. using the key refered into the values lead to a secret not found, it's a second problem but still...

More about the problem

my values file:

backup:
  enabled: true
  # allowParallel: true
  image:
    repository: percona/percona-xtradb-cluster-operator
    tag: 1.14.0-pxc8.0-backup-pxb8.0.35
  # backoffLimit: 6
  # serviceAccountName: percona-xtradb-cluster-operator
  # imagePullPolicy: Always
  imagePullSecrets: []
  # - name: private-registry-credentials
  pitr:
    enabled: false
    storageName: s3-us-west-binlogs
    timeBetweenUploads: 60
    timeoutSeconds: 60
    resources:
      requests: {}
      limits: {}
  storages: 
    s3-us-central1:
      type: s3
      s3:
        bucket: myapp-gcp-bucket
        # Use credentialsSecret OR credentialsAccessKey/credentialsSecretKey
        credentialsSecret: mysql-s3-backup-secret     
        region: us-central1
        endpointUrl: https://storage.googleapis.com
      containerOptions:
        env:        
        - name: DEFAULT_REGION
          value: us-central1                                                                                                                                                                              
        - name: ENDPOINT
          value: https://storage.googleapis.com

Steps to reproduce

  1. deploy the operator with helm
  2. deploy the bd with helm and override the values with the example above
  3. check if the backup is working

Versions

  1. Kubernetes: 1.29.1
  2. Operator: latest
  3. Database: 1.14.0-pxc8.0-backup-pxb8.0.35

Anything else?

No response

adrien-barret commented 1 month ago

@hors any chance you can help?

hors commented 1 month ago

@adrien-barret I can't reproduce it :( I have changed the values and then run the backups and pbm got new values from CR. You can confirm it using the following command: kubectl exec some-name-rs0-0 -it -c backup-agent -- pbm config but you need to run a backup to pbm to get new values.

adrien-barret commented 1 month ago

@hors was really weird. As it was a new applications / deployments I've made, I deleted all I had and redeploy it with the same files/config and it worked. we can close this issue but would ne be surprised if another person have the same issue