mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-20 13:28:31 +02:00
Set node_readiness_label default to an empty value. (#204)
Previously, it was set to the lifecycle-status:ready, breaking a lot of minikube deployments. Also it was not possible befor to run with this label set to an empty value. Document the effect of the label in the new section of the documentation.
This commit is contained in:
@@ -238,6 +238,9 @@ PatroniInitDBParams:
|
||||
|
||||
func (c *Cluster) nodeAffinity() *v1.Affinity {
|
||||
matchExpressions := make([]v1.NodeSelectorRequirement, 0)
|
||||
if len(c.OpConfig.NodeReadinessLabel) == 0 {
|
||||
return nil
|
||||
}
|
||||
for k, v := range c.OpConfig.NodeReadinessLabel {
|
||||
matchExpressions = append(matchExpressions, v1.NodeSelectorRequirement{
|
||||
Key: k,
|
||||
@@ -431,10 +434,13 @@ func (c *Cluster) generatePodTemplate(
|
||||
ServiceAccountName: c.OpConfig.ServiceAccountName,
|
||||
TerminationGracePeriodSeconds: &terminateGracePeriodSeconds,
|
||||
Containers: []v1.Container{container},
|
||||
Affinity: c.nodeAffinity(),
|
||||
Tolerations: c.tolerations(tolerationsSpec),
|
||||
}
|
||||
|
||||
if affinity := c.nodeAffinity(); affinity != nil {
|
||||
podSpec.Affinity = affinity
|
||||
}
|
||||
|
||||
if c.OpConfig.ScalyrAPIKey != "" && c.OpConfig.ScalyrImage != "" {
|
||||
podSpec.Containers = append(
|
||||
podSpec.Containers,
|
||||
|
||||
@@ -32,7 +32,7 @@ type Resources struct {
|
||||
DefaultCPULimit string `name:"default_cpu_limit" default:"3"`
|
||||
DefaultMemoryLimit string `name:"default_memory_limit" default:"1Gi"`
|
||||
PodEnvironmentConfigMap string `name:"pod_environment_configmap" default:""`
|
||||
NodeReadinessLabel map[string]string `name:"node_readiness_label" default:"lifecycle-status:ready"`
|
||||
NodeReadinessLabel map[string]string `name:"node_readiness_label" default:""`
|
||||
MaxInstances int32 `name:"max_instances" default:"-1"`
|
||||
MinInstances int32 `name:"min_instances" default:"-1"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user