zalando / spilo

Highly available elephant herd: HA PostgreSQL cluster using Docker
Apache License 2.0
1.54k stars 382 forks source link

WALG_AZ_PREFIX variable is mandatory in Azure backup configuration #981

Open uladzimir-tryputska opened 7 months ago

uladzimir-tryputska commented 7 months ago

Spilo is using WALG_AZ_PREFIX environment variable as an indicator, that Azure cloud provider should be used for backups https://github.com/zalando/spilo/blob/3.2-p1/postgres-appliance/scripts/configure_spilo.py#L865

It makes usage of the default WALG_AZ_PREFIX value not possible https://github.com/zalando/spilo/blob/3.2-p1/postgres-appliance/scripts/configure_spilo.py#L898

Without default WALG_AZ_PREFIX it is not possible to use cluster uid in the bucket path names. https://github.com/zalando/postgres-operator/issues/2227

AWS and GCP setup allows usage of the default WALG_PREFIX, because WALG_PREFIX is not mandatory and other variables can be used to enable backups, like here https://github.com/zalando/spilo/blob/3.2-p1/postgres-appliance/scripts/configure_spilo.py#L898

I would suggest to add more checks here https://github.com/zalando/spilo/blob/3.2-p1/postgres-appliance/scripts/configure_spilo.py#L898, like elif wale.get("WALG_AZ_PREFIX") or wale.get("AZURE_STORAGE_ACCOUNT") or ... :

youvegotmoxie commented 4 months ago

I am also facing this issue