charts icon indicating copy to clipboard operation
charts copied to clipboard

Missing `region` in `barmanObjectStore.s3Credentials`

Open gpkc opened this issue 1 year ago • 3 comments

I suspect from the current code, that region seems to be used just to infer the S3 endpoint if endpointURL is not provided, as seen:

https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/templates/_barman_object_store.tpl#L18-L31

However, region is important for the AWS CLI functioning as it should set AWS_DEFAULT_REGION as well. Seems that upstream it is supported via barmanObjectStore.s3Credentials.region:

https://github.com/cloudnative-pg/cloudnative-pg/blob/main/docs/src/release_notes/old/v1.16.md?plain=1#L222-L223

If this is not possible, then some alternative S3 providers will not work. For instance, I am trying to setup OVH object stores for the backups, and if I run the command below using the same credentials I'm feeding barman:

AWS_ENDPOINT_URL_S3=https://s3.de.io.cloud.ovh.net aws s3 ls my-db-backups

it will not work. However, if I add --region or AWS_DEFAULT_REGION it works:

AWS_ENDPOINT_URL_S3=https://s3.de.io.cloud.ovh.net aws --region de s3 ls my-db-backups

gpkc avatar Nov 29 '24 11:11 gpkc

Just to understand - the functionality as it is works completely OK for the purposes of the database. Your problem is simply the fact that you cannot use the AWS CLI when you kubectl exec into the database pods. Is that correct?

itay-grudev avatar Dec 07 '24 17:12 itay-grudev

@itay-grudev No the functionaly actually does not work. The backup keeps failing because the AWS_DEFAULT_REGION env var is missing As it is right now, in the chart, if the endpointURL is provided, then s3.region is just thrown away

gpkc avatar Dec 07 '24 18:12 gpkc

Hi! I can confirm that adding AWS_REGION in a Chart solved problem with OVH, if you are interested I may do pull request for you )

vintikzzz avatar Dec 22 '24 09:12 vintikzzz

Hi, @gpkc. I'm Dosu, and I'm helping the charts team manage their backlog. I'm marking this issue as stale.

Issue Summary

  • The issue was about the absence of a region parameter in barmanObjectStore.s3Credentials.
  • This parameter is necessary for setting AWS_DEFAULT_REGION for compatibility with S3 providers like OVH.
  • You clarified that the backup functionality fails without this environment variable.
  • @vintikzzz confirmed that adding AWS_REGION resolved the issue and offered to submit a pull request.

Next Steps

  • Please let me know if this issue is still relevant to the latest version of the charts repository. If so, you can keep the discussion open by commenting here.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Apr 10 '25 16:04 dosubot[bot]