@@ -5,21 +5,66 @@ v1.0.0, {docdate}
55This document describes the various deployment strategies
66offered by the operator. A deployment in this case is
77the set of objects created in Kubernetes when a
8- third party resource of type database or cluster is created.
9- TPRs are created by the pgo client command.
8+ third party resource of type *pgdatabase* or *pgcluster* is created.
9+ TPRs are created by the pgo client command and acted upon
10+ by the postgres operator.
1011
1112== Strategies
1213
13- There are different strategies for what pods and services
14- get created for a database and cluster. Right now, the operator
15- supports only a default strategy for a database and cluster, but
16- in the future, more deployment strategies will be supported
14+ To support different types of deployments, the operator supports
15+ multiple strategy implementations. For Release 1.0, there is
16+ only a default *database* strategy and a default *cluster* strategy.
17+
18+ In the future, more deployment strategies will be supported
1719to offer users more customization to what they see deployed
1820in their Kube cluster.
1921
20- == Default Database Deployment Strategy
22+ Being open source, users can also write their own strategy!
23+
24+ === Specifying a Strategy
25+
26+ In the pgo client configuration file, there is a *DB.STRATEGY*
27+ and *CLUSTER.STRATEGY* settings. The current value of the
28+ default strategy is *1*. If you don't set that value, the
29+ default strategy is assumed. If you set that value to something
30+ not supported, the operator will log an error.
31+
32+ === Strategy Template Files
33+
34+ Each strategy supplies its set of templates used by the operator
35+ to create new pods, services, etc.
36+
37+ When the operator is deployed, part of the deployment process
38+ is to copy the required strategy templates into the mounted
39+ volume (*/pgconf*) used by the operator pod. See the
40+ *examples/operator/run.sh* script for an example of this using
41+ a HostPath PV/PVC.
42+
43+ The directory structure of the strategy templates is as
44+ follows:
45+ ....
46+ ├── backup-job.json
47+ ├── cluster
48+ │ └── 1
49+ │ ├── cluster-deployment.json
50+ │ ├── cluster-replica-deployment.json
51+ │ └── cluster-service.json
52+ ├── database
53+ │ └── 1
54+ │ ├── database-pod.json
55+ │ ├── database-service.json
56+ │ └── restore-database-pod.json
57+ ├── pvc.json
58+ ....
59+
60+ In this structure, each strategy's templates live in a subdirectory
61+ that matches the strategy identifier. The default strategy templates
62+ are denoted by the value of *1* in the directory structure above.
63+
64+
65+ == Default Database Deployment Strategy (1)
2166
22- A *database* when created by the operator will create the
67+ Using the default database strategy, a *database* when created by the operator will create the
2368following on a Kube cluster:
2469
2570image::operator-diagram-database.png?raw=true[]
@@ -30,9 +75,9 @@ The default database strategy creates the following:
3075 * service mapped to the Postgres container
3176 * PVC will be created if not specified in configuration
3277
33- == Default Cluster Deployment Strategy
78+ == Default Cluster Deployment Strategy (1)
3479
35- A *cluster* when created by the operator will create the
80+ Using the default cluster strategy, a *cluster* when created by the operator will create the
3681following on a Kube cluster:
3782
3883image::operator-diagram-cluster.png?raw=true[]
0 commit comments