improve docs
This commit is contained in:
		
							parent
							
								
									8285a3b7b7
								
							
						
					
					
						commit
						16b167b76c
					
				|  | @ -154,6 +154,20 @@ data: | ||||||
|   pod_antiaffinity_topology_key: "failure-domain.beta.kubernetes.io/zone" |   pod_antiaffinity_topology_key: "failure-domain.beta.kubernetes.io/zone" | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | ### Pod Disruption Budget | ||||||
|  | 
 | ||||||
|  | By default the operator uses a PodDisruptionBudget (PDB) to protect the cluster | ||||||
|  | from voluntarily disruptions and hence unwanted DB downtime. The `MinAvailable` | ||||||
|  | parameter of the PDB is set to `1` which makes it work for single-node clusters | ||||||
|  | or in situations when there is no master (e.g. standby clusters). | ||||||
|  | 
 | ||||||
|  | The PDB is only relaxed in two scenarios: | ||||||
|  | * If a cluster is scaled down to `0` instances (e.g. for draining nodes) | ||||||
|  | * If the PDB is disabled in the configuration (`enable_pod_disruption_budget`) | ||||||
|  | 
 | ||||||
|  | The PDB is still in place having `MinAvailable` set to `0`. If enabled it will | ||||||
|  | be automatically set to `1` on scale up. | ||||||
|  | 
 | ||||||
| ### Add cluster-specific labels | ### Add cluster-specific labels | ||||||
| 
 | 
 | ||||||
| In some cases, you might want to add `labels` that are specific to a given | In some cases, you might want to add `labels` that are specific to a given | ||||||
|  |  | ||||||
|  | @ -162,10 +162,11 @@ configuration they are grouped under the `kubernetes` key. | ||||||
|   the template. |   the template. | ||||||
| 
 | 
 | ||||||
| * **enable_pod_disruption_budget** | * **enable_pod_disruption_budget** | ||||||
|   if disabled `MinAvailable` in the PDB's spec will be set to `0`. That means |   PDB is enabled by default to protect the cluster from voluntarily disruptions | ||||||
|   the PDB will get created anyway. The PDB is also relaxed when scaling down the |   and hence unwanted DB downtime. However, on some cloud providers it could be | ||||||
|   Postgres cluster to `"numberOfInstances": 0`. By default PDB is enabled which |   necessary to temporarily disabled it, e.g. for node updates. See | ||||||
|   results in `"MinAvailable": 1`. |   [admin docs](../administrator.md#pod-disruption-budget) for more information. | ||||||
|  |   Default is true. | ||||||
| 
 | 
 | ||||||
| * **secret_name_template** | * **secret_name_template** | ||||||
|   a template for the name of the database user secrets generated by the |   a template for the name of the database user secrets generated by the | ||||||
|  |  | ||||||
|  | @ -1298,7 +1298,7 @@ func (c *Cluster) generatePodDisruptionBudget() *policybeta1.PodDisruptionBudget | ||||||
| 	minAvailable := intstr.FromInt(1) | 	minAvailable := intstr.FromInt(1) | ||||||
| 	pdbEnabled := c.OpConfig.EnablePodDisruptionBudget | 	pdbEnabled := c.OpConfig.EnablePodDisruptionBudget | ||||||
| 
 | 
 | ||||||
| 	// Is PodDisruptionBudget is disabled or if there is no master, set the budget to 0.
 | 	// if PodDisruptionBudget is disabled or if there are no DB pods, set the budget to 0.
 | ||||||
| 	if (pdbEnabled != nil && !*pdbEnabled) || c.Spec.NumberOfInstances <= 0 { | 	if (pdbEnabled != nil && !*pdbEnabled) || c.Spec.NumberOfInstances <= 0 { | ||||||
| 		minAvailable = intstr.FromInt(0) | 		minAvailable = intstr.FromInt(0) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue