-
Notifications
You must be signed in to change notification settings - Fork 77
Description
Containers should not be run as root. But in v1.17, the promote_replica_to_primary.sh script in base-kubegres-config ConfigMap was changed to write messages to /usr/share/promotion.log. In the postgres container, /usr/share is only writable by root. Thus, when the container is run as postgres, promotion fails because the PostStartHook fails, leaving the replica pod in a CrashLoopBackoff state.
It is not clear why the 1.16 version of the script, which wrote to STDOUT, was changed to write to a promotion.log file. If there is some need for it, then it needs to be placed in a directory writable by the user running the postgres pod. If not, then simply removing the redirects to go back to STDOUT would be the solution.
The change needs to be made in the promote_replica_to_primary.sh script defined in the internal/controller/spec/template/yaml/BaseConfigMapTemplate.yaml and internal/controller/spec/template/yaml/Templates.go.