setup-filesystem init container resources are never updated

Summary

The init container setup-filesystem's resources are only set on cluster creation. Any subsequent changes won't get applied.

Current Behaviour

  • The setup-filesystem resources are set to the patroni resources when creating the instance
  • Changing the patroni resources isn't reflected in setup-filesystem

This creates issues when trying to downscale due to k8s cluster resource usage. Because the init container is stuck with the initial values, the k8s scheduler and quota handling require the setup-filesystem container requests, even if patroni is lower.

Steps to reproduce

  • Create a cluster with high resources
  • Lower the patroni resources after creation
  • Observe that setup-filesystem is still the initial value

Expected Behaviour

setup-filesystem init container resources should either be:

  • Always the same as patroni
  • Be independendent as other init and sidecar containers

Possible Solution

See expected behaviour.

Environment

  • StackGres version: 1.17.x
  • Kubernetes version: 1.31.x
  • Cloud provider or hardware configuration:

Relevant logs and/or screenshots

N/A