You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment variables KUBERNETES_LEADER_LABEL_VALUE and KUBERNETES_STANDBY_LEADER_LABEL_VALUE are not available within the Patroni process due to Spilo’s default environment variable filtering in the entrypoint script. This prevents custom leader label values from being applied correctly.
Steps to Reproduce
Set KUBERNETES_LEADER_LABEL_VALUE or KUBERNETES_STANDBY_LEADER_LABEL_VALUE in the Spilo environment.
Deploy Spilo and observe the runtime environment of the Patroni
Trigger the callback_role.py callback during a role
Notice that LEADER_LABEL_VALUE falls back to default instead of using the intended custom value.
Expected Behavior
The variables should be available to Patroni at runtime, allowing the callback_role.py script to correctly use the customized label values.
Actual Behavior
The variables are filtered out and not exposed to the Patroni subprocess, leading to unintended fallback behavior in the callback logic.
Environment
Spilo version: spilo-17:4.0-p2
Postgres-Operator: 1.14
Patroni: 4.0.4
Kubernetes: 1.31
Proposed Fix
Update the run script to include KUBERNETES_LEADER_LABEL_VALUE and KUBERNETES_STANDBY_LEADER_LABEL_VALUE in the whitelist of environment variables passed to the Patroni subprocess.
Additional Context
This issue critically affects Patroni clusters that depend on customized Kubernetes label values to manage cluster behavior—particularly for endpoint updates. When these environment variables are not exposed to the callback_role.py script, Kubernetes endpoint updates may silently be skip, potentially rendering the cluster unreachable or unavailable.
The bug effectively nullifies any configuration relying on KUBERNETES_LEADER_LABEL_VALUE and KUBERNETES_STANDBY_LEADER_LABEL_VALUE, as the callback script cannot access these values at runtime.
As a result, this issue has become a blocker for upgrading to:
Postgres-Operator v1.14
PostgreSQL 17
Patroni 4
Let me know if you'd like me to create a follow-up issue for documentation updates or to cross-reference this issue with the associated Pull Request.
The text was updated successfully, but these errors were encountered:
The environment variables
KUBERNETES_LEADER_LABEL_VALUE
andKUBERNETES_STANDBY_LEADER_LABEL_VALUE
are not available within the Patroni process due to Spilo’s default environment variable filtering in the entrypoint script. This prevents custom leader label values from being applied correctly.Steps to Reproduce
KUBERNETES_LEADER_LABEL_VALUE
orKUBERNETES_STANDBY_LEADER_LABEL_VALUE
in the Spilo environment.LEADER_LABEL_VALUE
falls back to default instead of using the intended custom value.Expected Behavior
The variables should be available to Patroni at runtime, allowing the
callback_role.py
script to correctly use the customized label values.Actual Behavior
The variables are filtered out and not exposed to the Patroni subprocess, leading to unintended fallback behavior in the callback logic.
Environment
Proposed Fix
Update the
run
script to includeKUBERNETES_LEADER_LABEL_VALUE
andKUBERNETES_STANDBY_LEADER_LABEL_VALUE
in the whitelist of environment variables passed to the Patroni subprocess.Additional Context
This issue critically affects Patroni clusters that depend on customized Kubernetes label values to manage cluster behavior—particularly for endpoint updates. When these environment variables are not exposed to the callback_role.py script, Kubernetes endpoint updates may silently be skip, potentially rendering the cluster unreachable or unavailable.
The bug effectively nullifies any configuration relying on
KUBERNETES_LEADER_LABEL_VALUE
andKUBERNETES_STANDBY_LEADER_LABEL_VALUE
, as the callback script cannot access these values at runtime.As a result, this issue has become a blocker for upgrading to:
Let me know if you'd like me to create a follow-up issue for documentation updates or to cross-reference this issue with the associated Pull Request.
The text was updated successfully, but these errors were encountered: