Skip to content

Commit a7867d5

Browse files
author
Jeff McCormick
committed
final updates for 1.1.0 release
1 parent ed604f2 commit a7867d5

14 files changed

+206
-114
lines changed

README.asciidoc

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= PostgreSQL Operator
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44
== Overview
55

@@ -17,6 +17,7 @@ Once the objects are detected, the PostgreSQL Operator enables users to perform
1717
* Destroy Database or Cluster
1818
* Backup Database or Cluster
1919
* Restore Database or Cluster
20+
* Upgrade Database or Cluster
2021
* View PVC
2122

2223
What actually gets created on the Kube cluster for a *pgdatabase* or
@@ -28,6 +29,7 @@ are documented in detail here link:docs/strategies.asciidoc[Deployment Strategie
2829
* Kubernetes 1.5.3+
2930
* link:https://hub.docker.com/r/crunchydata/crunchy-postgres/[PostgreSQL 9.5+ Container]
3031
* link:https://hub.docker.com/r/crunchydata/crunchy-backup/[PostgreSQL Backup Container]
32+
* link:https://hub.docker.com/r/crunchydata/crunchy-upgrade/[PostgreSQL Upgrade Container]
3133

3234
== Example Commands Usage
3335

@@ -68,6 +70,18 @@ pgo create backup mydatabase
6870
pgo create database myrestore --backup-pvc=mypvc --backup-path=foo-backups/2017-03-21-15-57-21
6971
----
7072

73+
.Upgrade Database (minor Postgres version upgrade)
74+
[source,bash]
75+
----
76+
pgo create upgrade mydatabase
77+
----
78+
79+
.Upgrade Database (major Postgres version upgrade from 9.5 to 9.6)
80+
[source,bash]
81+
----
82+
pgo create upgrade mydatabase --upgrade-type=major
83+
----
84+
7185
.View PVC
7286
[source,bash]
7387
----

centos7/Dockerfile.lspvc.centos7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM centos:7
22

3-
LABEL Release="1.0.0" Vendor="Crunchy Data Solutions"
3+
LABEL Release="1.1.0" Vendor="Crunchy Data Solutions"
44

55
VOLUME ["/pgdata"]
66

centos7/Dockerfile.postgres-operator.centos7

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM centos:7
22

3-
LABEL Release="1.0.0" Vendor="Crunchy Data Solutions"
3+
LABEL Release="1.1.0" Vendor="Crunchy Data Solutions"
44

55
RUN yum -y install bind-utils \
66
hostname \

docs/build.asciidoc

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= PostgreSQL Operator Build and Setup
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44
== Overview
55

@@ -63,7 +63,7 @@ export GOBIN=$GOPATH/bin
6363
export PATH=$PATH:$GOBIN
6464
export COROOT=$GOPATH/src/github.com/crunchydata/postgres-operator
6565
export CO_BASEOS=centos7
66-
export CO_VERSION=1.0.0
66+
export CO_VERSION=1.1.0
6767
export CO_IMAGE_TAG=$CO_BASEOS-$CO_VERSION
6868
....
6969

@@ -80,16 +80,16 @@ cd postgres-operator
8080
At this point if you want to avoid building the images and binary
8181
from source, you can pull down the Docker images as follows:
8282
....
83-
docker pull crunchydata/lspvc:centos7-1.0.0
84-
docker pull crunchydata/postgres-operator:centos7-1.0.0
83+
docker pull crunchydata/lspvc:centos7-1.1.0
84+
docker pull crunchydata/postgres-operator:centos7-1.1.0
8585
....
8686

8787
Then to get the *pgo* client, go to the Releases page and download the tar ball, uncompress
8888
it into your $HOME directory:
8989
....
9090
cd $HOME
91-
wget https://github.com/CrunchyData/postgres-operator/releases/download/v1.0/postgres-operator.1.0.0.tar.gz
92-
tar xvzf ./postgres-operator.1.0.0.tar.gz
91+
wget https://github.com/CrunchyData/postgres-operator/releases/download/v1.1.0/postgres-operator.1.1.0.tar.gz
92+
tar xvzf ./postgres-operator.1.1.0.tar.gz
9393
....
9494

9595
Lastly, add the *pgo* client into your PATH.
@@ -185,7 +185,30 @@ kubectl get thirdpartyresources
185185
kubectl get pgdatabases
186186
kubectl get pgclusters
187187
kubectl get pgbackups
188+
kubectl get pgupgrades
188189
....
189190

190191
At this point, you should be ready to start using the *pgo* client!
191192

193+
== Performing a Smoke Test
194+
195+
A simple *smoke test* of the postgres operator includes testing
196+
the following:
197+
198+
* create a database
199+
* show a database
200+
* backup a database
201+
* show backup of database
202+
* delete a database
203+
* restore a database
204+
* create a cluster
205+
* show a cluster
206+
* backup a cluster
207+
* show backup of cluster
208+
* delete a cluster
209+
* restore a cluster
210+
* minor upgrade a database
211+
* major upgrade a database
212+
* minor upgrade a cluster
213+
* major upgrade a cluster
214+

docs/config.asciidoc

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= PostgreSQL Operator Configuration
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44

55
This document describes the configuration options
@@ -28,7 +28,7 @@ DB:
2828
PVC_NAME: crunchy-pvc
2929
PVC_SIZE: 100M
3030
PVC_ACCESS_MODE: ReadWriteMany
31-
CCP_IMAGE_TAG: centos7-9.5-1.2.8
31+
CCP_IMAGE_TAG: centos7-9.5-1.4.0
3232
PORT: 5432
3333
PG_MASTER_USER: master
3434
PG_MASTER_PASSWORD: password
@@ -38,12 +38,14 @@ DB:
3838
PG_ROOT_PASSWORD: password
3939
FSGROUP: 26
4040
SUPPLEMENTALGROUPS: 65534
41+
STRATEGY: 1
4142
PGO:
4243
LSPVC_TEMPLATE: /home/jeffmc/.pgo.lspvc-template.json
43-
CO_IMAGE_TAG: centos7-1.0.0
44+
CO_IMAGE_TAG: centos7-1.1.0
4445
DEBUG: false
4546
CLUSTER:
4647
REPLICAS: 2
48+
STRATEGY: 1
4749
....
4850

4951
Values in the pgo configuration file have the following meaning:
@@ -56,7 +58,7 @@ Values in the pgo configuration file have the following meaning:
5658
|DB.PVC_NAME |if set, the PVC to use for created databases, only makes sense when your file system is sharable
5759
|DB.PVC_SIZE |the size to use when creating new PVCs (e.g. 100M, 1Gi)
5860
|DB.PVC_ACCESS_MODE |the access mode for new PVCs (e.g. ReadWriteMany, ReadWriteOnce)
59-
|DB.CCP_IMAGE_TAG |newly created containers will be based on this image version (e.g. centos7-9.6-1.2.8)
61+
|DB.CCP_IMAGE_TAG |newly created containers will be based on this image version (e.g. centos7-9.6-1.4.0)
6062
|DB.PORT | the PostgreSQL port to use for new containers (e.g. 5432)
6163
|DB.PG_MASTER_USER | the PostgreSQL master user name
6264
|DB.PG_MASTER_PASSWORD | the PostgreSQL master user password
@@ -65,10 +67,12 @@ Values in the pgo configuration file have the following meaning:
6567
|DB.PG_ROOT_PASSWORD | the PostgreSQL *postgres* user password
6668
|DB.FSGROUP | if set, will cause a *SecurityContext* and *fsGroup* attributes to be added to generated Pod and Deployment definitions
6769
|DB.SUPPLEMENTALGROUPS | if set, will cause a SecurityContext to be added to generated Pod and Deployment definitions
70+
|DB.STRATEGY | sets the deployment strategy to be used for deploying a database, currently there is only strategy *1*
6871
|PGO.LSPVC_TEMPLATE | the PVC lspvc template file used to view PVCs
6972
|PGO.CO_IMAGE_TAG | image tag to use for the PostgreSQL operator containers
7073
|PGO.DEBUG | set to true if you want to see debug messages from the pgo client
7174
|CLUSTER.REPLICAS | the number of cluster replicas to create for newly created clusters
75+
|CLUSTER.STRATEGY | sets the deployment strategy to be used for deploying a cluster, currently there is only strategy *1*
7276
|======================
7377

7478

docs/design.asciidoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= postgres Operator Design
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44
image::crunchy_logo.png?raw=true[]
55

@@ -14,6 +14,7 @@ of the postgres Operator to define:
1414
* Database - *pgdatabases*
1515
* Cluster - *pgclusters*
1616
* Backup - *pgbackups*
17+
* Upgrade - *pgupgrades*
1718

1819
A Database is made up of Pods and Services, whereas a Cluster is
1920
made up of multiple Pods, Services, and Proxies.
@@ -93,7 +94,7 @@ To verify the operator installed the following ThirdPartyResources:
9394
kubectl get thirdpartyresources
9495
----
9596

96-
You should see 3 crunchy third party resources deployed.
97+
You should see 4 crunchy third party resources deployed.
9798

9899
# Command Line Interface
99100

docs/strategies.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= PostgreSQL Operator Deployment Strategies
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44

55
This document describes the various deployment strategies

docs/user-guide.asciidoc

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
= postgres Operator User Guide
2-
v1.0.0, {docdate}
2+
v1.1.0, {docdate}
33

44
This document is meant for users and demonstrates
55
the basic interface of the *pgo* command line interface.
@@ -134,6 +134,57 @@ pgo delete cluster mycluster
134134
*Note*, when you delete a database or cluster, the operator
135135
will NOT delete any associated PVCs used by the cluster or database.
136136

137+
== Minor Database and Cluster Upgrade
138+
139+
You can perform a minor Postgres version upgrade
140+
of either a database or cluster as follows:
141+
....
142+
pgo create upgrade mydatabase
143+
pgo create upgrade mycluster
144+
....
145+
146+
When you run this command, it will cause the operator
147+
to delete the existing containers of the database or cluster
148+
and recreate them using the currently defined Postgres
149+
container image specified in your pgo configuration file.
150+
151+
The database data files remain untouched, only the container
152+
is updated, this will upgrade your Postgres server version only.
153+
154+
== Major Database and Cluster Upgrade
155+
156+
You can perform a major Postgres version upgrade
157+
of either a database or cluster as follows:
158+
....
159+
pgo create upgrade mydatabase --upgrade-type=major
160+
pgo create upgrade mycluster --upgrade-type=major
161+
....
162+
163+
When you run this command, it will cause the operator
164+
to delete the existing containers of the database or cluster
165+
and recreate them using the currently defined Postgres
166+
container image specified in your pgo configuration file.
167+
168+
The database data files are converted to the new major Postgres
169+
version as specified by the current Postgres image version
170+
in your pgo configuration file. Currently only a Postgres
171+
9.5 to 9.6 upgrade is supported.
172+
173+
In this scenario, the upgrade is performed by the Postgres
174+
pg_upgrade utility which is containerized in the *crunchydata/crunchy-upgrade*
175+
container. The operator will create a Job which runs the upgrade container,
176+
using the existing Postgres database files as input, and output
177+
the updated database files to a new PVC.
178+
179+
Once the upgrade job is completed, the operator will create the
180+
original database or cluster container mounted with the new PVC
181+
which contains the upgraded database files.
182+
183+
As the upgrade is processed, the status of the *pgupgrade* TPR is
184+
updated to give the user some insight into how the upgrade is
185+
proceeding. Upgrades like this can take a long time if your
186+
database is large. The operator creates a watch on the upgrade
187+
job to know when and how to proceed.
137188

138189
== Viewing PVC Information
139190

examples/operator/deployment.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"spec": {
1616
"containers": [{
1717
"name": "postgres-operator",
18-
"image": "crunchydata/postgres-operator:centos7-1.0.0",
18+
"image": "crunchydata/postgres-operator:centos7-1.1.0",
1919
"imagePullPolicy": "IfNotPresent",
2020
"env": [{
2121
"name" : "DEBUG",

examples/operator/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ fi
3636
# copy all the operator templates to the PVC location
3737
sudo cp -r $COROOT/conf/postgres-operator /data
3838

39-
kubectl --namespace=$NAMESPACE create -f $DIR/deployment.json
39+
envsubst < $DIR/deployment.json | kubectl --namespace=$NAMESPACE create -f -

0 commit comments

Comments
 (0)