Skip to content

Commit 2cb7103

Browse files
author
Jeff McCormick
authored
Merge pull request CrunchyData#26 from xenophenes/master
Misc
2 parents f8f18c5 + 99e1fc3 commit 2cb7103

File tree

1 file changed

+55
-18
lines changed

1 file changed

+55
-18
lines changed

docs/build.asciidoc

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
= PostgreSQL Operator Build and Setup
22
v1.3.2, {docdate}
33

4+
== Table of Contents
5+
6+
* <<Overview>>
7+
* <<Requirements>>
8+
* <<Kubernetes Environment>>
9+
* <<Openshift Origin Environment>>
10+
* <<Create Project and Clone>>
11+
* <<Get Packaged Dependencies>>
12+
* <<Build from Source>>
13+
** <<Compiling the PostgreSQL Operator>>
14+
** <<Build the Docker Images>>
15+
** <<Deploy the PostgreSQL Operator>>
16+
** <<Configuration>>
17+
** <<Viewing Operator Resources>>
18+
* <<Performing a Smoke Test>>
19+
20+
[#Overview]
421
== Overview
522

623
This document describes how to build from source code the
@@ -10,13 +27,18 @@ from source, you can download them from the following:
1027
* Dockerhub (crunchydata/lspvc and crunchydata/postgres-operator images)
1128
* link:https://github.com/CrunchyData/postgres-operator/releases[Github Releases] (pgo client and client configuration files, extracted to your $HOME)
1229

30+
Further details can be found in the link:design.asciidoc[PostgreSQL Operator Design] document on
31+
how the operator is built and how it operates.
32+
33+
[#Requirements]
1334
== Requirements
1435

1536
* Kubernetes 1.5.3+
1637
* Openshift Origin 1.5.1+ and Openshift Container Platform 3.5
1738
* link:https://hub.docker.com/r/crunchydata/crunchy-postgres/[PostgreSQL 9.5+ Container]
1839
* link:https://hub.docker.com/r/crunchydata/crunchy-backup/[PostgreSQL Backup Container]
1940

41+
[#Kubernetes Environment]
2042
== Kubernetes Environment
2143

2244
To test the *postgres-operator* you will need a Kubernetes cluster
@@ -32,7 +54,7 @@ the permissions:
3254
sudo chmod +r /etc/kubernetes/admin.conf
3355
....
3456

35-
Once you have your Kube VM created, install some of the
57+
Once you have your Kube VM created, install some of the
3658
required dependencies:
3759
....
3860
yum -y install git
@@ -58,12 +80,13 @@ details on how to enable RBAC roles.
5880

5981
To test the *postgres-operator* you will need a Kubernetes cluster
6082

83+
[#Openshift Origin Environment]
6184
== Openshift Origin Environment
6285

6386
The postgres operator has been tested using Openshift Origin 1.5.1.
6487

6588
The operator works the same as in a Kubernetes environment except
66-
that you have to configure the Origin permissions to allow
89+
that you have to configure the Origin permissions to allow
6790
the operator to function.
6891

6992
The HostPath volume is by default restricted in Origin, so you
@@ -109,7 +132,8 @@ export CO_NAMESPACE=myproject
109132
This will cause the *oc* command to be used within the operator
110133
startup script and deploy the operator to the *myproject* namespace or project.
111134

112-
== Create Project and Clone
135+
[#Create Project and Clone]
136+
== Create Project and Clone
113137
In your .bashrc file, include the following:
114138
....
115139
export GOPATH=$HOME/odev
@@ -130,7 +154,9 @@ git clone https://github.com/CrunchyData/postgres-operator.git
130154
cd postgres-operator
131155
....
132156

133-
== Get Pre-built Images
157+
[#Get Packaged Dependencies]
158+
== Get Packaged Dependencies
159+
134160
At this point if you want to avoid building the images and binary
135161
from source, you can pull down the Docker images as follows:
136162
....
@@ -148,8 +174,8 @@ tar xvzf ./postgres-operator.1.3.2.tar.gz
148174

149175
Lastly, add the *pgo* client into your PATH.
150176

151-
152-
== Source Dependencies
177+
[#Build from Source]
178+
== Build from Source
153179

154180
Install a golang compiler, this can be done with either
155181
your package manager or by following directions
@@ -162,35 +188,37 @@ go get -u github.com/FiloSottile/gvt
162188
gvt restore
163189
....
164190

165-
In a development environment you will likely want to create a
166-
*docker* group and add your user ID to that group, this allows
167-
you as your normal user ID to access the *docker* daemon and
191+
In a development environment you will likely want to create a
192+
*docker* group and add your user ID to that group, this allows
193+
you as your normal user ID to access the *docker* daemon and
168194
issue commands to it:
169195
....
170196
sudo groupadd docker
171197
sudo usermod -a -G docker youruserID
172198
sudo systemctl restart docker
173-
newgrp docker
199+
newgrp docker
174200
....
175201

176-
== Compile *pgo*
202+
[#Compiling the PostgreSQL Operator]
203+
=== Compiling the PostgreSQL Operator
177204
....
178205
cd $COROOT
179206
make pgo
180207
which pgo
181208
....
182209

183-
== Build the Docker Images
210+
[#Build the Docker Images]
211+
=== Build the Docker Images
184212
....
185213
cd $COROOT
186214
make operatorimage
187215
make lsimage
188216
docker images | grep crunchydata
189217
....
190218

191-
192-
== Deploy the PostgreSQL Operator
193-
note that this will create and use */data* on your
219+
[#Deploy the PostgreSQL Operator]
220+
=== Deploy the PostgreSQL Operator
221+
NOTE: This will create and use */data* on your
194222
local system as the persistent store for the operator to use
195223
for its persistent volume:
196224
....
@@ -207,7 +235,10 @@ desired PVC to use when databases and clusters are created.
207235
When you first run the operator, it will create the required
208236
ThirdPartyResources.
209237

210-
== Setup *pgo* Configuration File
238+
Strategies for deploying the operator can be found in the link:strategies.asciidoc[PostgreSQL Operator Deployment Strategies] document.
239+
240+
[#Configuration]
241+
== Configuration
211242

212243
The *pgo* client requires two configuration files be copied
213244
to your $HOME as follows:
@@ -229,7 +260,11 @@ located in */etc/kubernetes/admin.conf*. Update this kubeconfig
229260
path to match your local Kube config file location. Also, update
230261
the location of the LSPVC_TEMPLATE value to match your $HOME value.
231262

232-
== Viewing Operator Resources
263+
More in-depth explanations of postgres operator configurations are available
264+
in the link:config.asciidoc[Configuration] document.
265+
266+
[#Viewing Operator Resources]
267+
=== Viewing Operator Resources
233268

234269
When you first run the operator, it will look for the presence
235270
of its third party resources, and create them if not found. You can view the various resources created and used by the
@@ -243,11 +278,12 @@ kubectl get pgupgrades
243278

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

281+
[#Performing a Smoke Test]
246282
== Performing a Smoke Test
247283

248284
A simple *smoke test* of the postgres operator includes testing
249285
the following:
250-
286+
251287
* create a cluster (*pgo create cluster testcluster*)
252288
* show a cluster (*pgo show cluster testcluster*)
253289
* show all clusters (*pgo show cluster all*)
@@ -261,3 +297,4 @@ the following:
261297
* clone a cluster (*pgo clone testcluster --name=cloneexample*)
262298
* delete a cluster (*pgo delete cluster testcluster*)
263299

300+
More detailed explanations of the commands can be found in the link:user-guide.asciidoc[User Guide].

0 commit comments

Comments
 (0)