Skip to content

Commit 5103542

Browse files
author
Jeff McCormick
committed
update design doc with affinity
1 parent 5fa4953 commit 5103542

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

docs/design.asciidoc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
= postgres Operator Design
2+
:toc:
23
v2.5, {docdate}
34

5+
46
image::crunchy_logo.png?raw=true[]
57

68
== Reference Architecture
@@ -98,6 +100,41 @@ pgo create cluster mycluster
98100

99101
In the above example, the *show*, *backup*, *delete*, and *create* verbs are used. The CLI is case sensitive and supports only lowercase.
100102

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+
101138
== Debugging
102139

103140
To see if the operator pod is running enter the following:

0 commit comments

Comments
 (0)