|
1 | 1 | = postgres Operator Design
|
| 2 | +:toc: |
2 | 3 | v2.5, {docdate}
|
3 | 4 |
|
| 5 | + |
4 | 6 | image::crunchy_logo.png?raw=true[]
|
5 | 7 |
|
6 | 8 | == Reference Architecture
|
@@ -98,6 +100,41 @@ pgo create cluster mycluster
|
98 | 100 |
|
99 | 101 | In the above example, the *show*, *backup*, *delete*, and *create* verbs are used. The CLI is case sensitive and supports only lowercase.
|
100 | 102 |
|
| 103 | +== Affinity |
| 104 | + |
| 105 | +You can have the Operator add an affinity section to |
| 106 | +a new Cluster Deployment if you want to cause Kube to |
| 107 | +attempt to schedule a Primary cluster to a specific Kube node. |
| 108 | + |
| 109 | +You can see the nodes on your Kube cluster by: |
| 110 | +.... |
| 111 | +kubectl get nodes |
| 112 | +.... |
| 113 | + |
| 114 | +You can then specify one of those names (e.g. kubeadm-node2) when creating a cluster: |
| 115 | +.... |
| 116 | +pgo create cluster thatcluster --node-name=kubeadm-node2 |
| 117 | +.... |
| 118 | + |
| 119 | +The affinity rule inserted in the Deployment will used a *preferred* |
| 120 | +strategy so that if the node were down or not available, Kube would |
| 121 | +go ahead and schedule the Pod on another node. |
| 122 | + |
| 123 | +You can always view the actual node your cluster pod is scheduled |
| 124 | +on by: |
| 125 | +.... |
| 126 | +kubectl get pod -o wide |
| 127 | +.... |
| 128 | + |
| 129 | +When you scale up a Cluster and add a replica, the scaling will |
| 130 | +take into account the use of "--node-name". If it sees that a |
| 131 | +cluster was created with a specific node name, then the replica |
| 132 | +Deployment will add an affinity rule to attempt to schedule |
| 133 | +the replica on a different node than the node the primary is |
| 134 | +schedule on. This gets you a simple for of High Availability so |
| 135 | +that your primary and replicas will not live on the same Kube node. |
| 136 | + |
| 137 | + |
101 | 138 | == Debugging
|
102 | 139 |
|
103 | 140 | To see if the operator pod is running enter the following:
|
|
0 commit comments