Skip to content

Commit fecdfa6

Browse files
author
Jeff McCormick
committed
update build doc
1 parent 5717ed6 commit fecdfa6

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

docs/build.asciidoc

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,36 @@ environment. There are many ways to install a Kube cluster, but for the
1919
purposes of this document, I have created a test VM on Centos 7 that
2020
installs a Kube cluster using the kubeadm project as described here. link: http://linoxide.com/containers/setup-kubernetes-kubeadm-centos/
2121

22+
The kubeadm installation will create */etc/kubernetes/admin.conf* for
23+
the kubeconfig file you will use to execute the *postgres-operator*, it
24+
needs to be readable from your user account, to enable this change
25+
the permissions:
26+
....
27+
sudo chmod +r /etc/kubernetes/admin.conf
28+
....
29+
2230
Once you have your Kube VM created, install some of the
2331
required dependencies:
2432
....
2533
yum -y install git
2634
....
2735

2836
=== Create Project and Clone
37+
In your .bashrc file, include the following:
2938
....
30-
mkdir -p $HOME/odev/src $HOME/odev/bin $HOME/odev/pkg
3139
export GOPATH=$HOME/odev
32-
export GOBIN=$GOPATH/bin;export PATH=$PATH:$GOBIN
40+
export GOBIN=$GOPATH/bin
41+
export PATH=$PATH:$GOBIN
42+
export COROOT=$GOPATH/src/github.com/crunchydata/postgres-operator
43+
....
44+
45+
Then execute these commands to build the project structure:
46+
....
47+
mkdir -p $HOME/odev/src $HOME/odev/bin $HOME/odev/pkg
3348
mkdir -p $GOPATH/src/github.com/crunchydata/
3449
cd $GOPATH/src/github.com/crunchydata
3550
git clone https://github.com/CrunchyData/postgres-operator.git
3651
cd postgres-operator
37-
export COROOT=$GOPATH/src/github.com/crunchydata/postgres-operator
3852
....
3953

4054
==== Get the dependencies:
@@ -50,6 +64,17 @@ go get -u github.com/FiloSottile/gvt
5064
gvt restore
5165
....
5266

67+
In a development environment you will likely want to create a
68+
*docker* group and add your user ID to that group, this allows
69+
you as your normal user ID to access the *docker* daemon and
70+
issue commands to it:
71+
....
72+
sudo groupadd docker
73+
sudo usermod -a -G docker youruserID
74+
sudo systemctl restart docker
75+
newgrp docker
76+
....
77+
5378
==== Compile the CLI:
5479
....
5580
cd $COROOT
@@ -84,13 +109,26 @@ When you first run the operator, it will create the required
84109
ThirdPartyResources.
85110

86111
==== Setup initial configuration file for the postgres operator CLI
112+
113+
The *pgo* client requires two configuration files be copied
114+
to your $HOME as follows:
87115
....
88116
cp $COROOT/examples/sample.pgo.yaml $HOME/.pgo.yaml
117+
cp $COROOT/examples/lspvc-template.yaml $HOME/.pgo.lspvc-template.json
118+
vi $HOME/.pgo.yaml
119+
....
120+
121+
Edit the $HOME/.pgo.yaml file changing the following
122+
settings:
123+
....
124+
KUBECONFIG: /etc/kubernetes/admin.conf
125+
LSPVC_TEMPLATE: /home/yourid/.pgo.lspvc-template.json
89126
....
90127

91128
Note that this config file assumes your Kubernetes config file is
92129
located in */etc/kubernetes/admin.conf*. Update this kubeconfig
93-
path to match your local Kube config file location.
130+
path to match your local Kube config file location. Also, update
131+
the location of the LSPVC_TEMPLATE value to match your $HOME value.
94132

95133
==== Viewing Operator Resources
96134

@@ -104,3 +142,5 @@ kubectl get pgclusters
104142
kubectl get pgbackups
105143
....
106144

145+
At this point, you should be ready to start using the *pgo* client!
146+

0 commit comments

Comments
 (0)