Skip to content

Commit 91a0fcd

Browse files
Merge pull request #170 from xenophenes/quickstart
quickstart updates
2 parents 9ebe737 + 8545894 commit 91a0fcd

File tree

2 files changed

+60
-61
lines changed

2 files changed

+60
-61
lines changed

examples/quickstart-for-gke.sh

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,38 @@ LOG="pgo-installer.log"
1717

1818
export PGORELEASE=2.6
1919

20-
echo "testing for dependencies " | tee -a $LOG
20+
echo "Testing for dependencies..." | tee -a $LOG
2121

2222
which wget > /dev/null 2> /dev/null
2323
if [[ $? -ne 0 ]]; then
24-
echo "wget is missing on your system, a required dependency" | tee -a $LOG
24+
echo "The required dependency wget is missing on your system." | tee -a $LOG
2525
exit 1
2626
fi
2727
which kubectl > /dev/null 2> /dev/null
2828
if [[ $? -ne 0 ]]; then
29-
echo "kubectl is missing on your system, a required dependency" | tee -a $LOG
29+
echo "The required dependency kubectl is missing on your system." | tee -a $LOG
3030
exit 1
3131
fi
3232

3333
echo ""
34-
echo "testing kubectl connection" | tee -a $LOG
34+
echo "Testing kubectl connection..." | tee -a $LOG
3535
echo ""
36-
kubectl get namespaces
36+
kubectl get namespaces
3737
if [[ $? -ne 0 ]]; then
38-
echo "kubectl is not connecting to your Kube Cluster, required to proceed" | tee -a $LOG
38+
echo "kubectl is not connecting to your Kubernetes Cluster. A successful connection is required to proceed." | tee -a $LOG
3939
exit 1
4040
fi
4141

42+
echo "Connected to Kubernetes." | tee -a $LOG
43+
echo ""
44+
4245
NAMESPACE=`kubectl config current-context`
43-
echo "will install postgres-operator into the current namespace which is ["$NAMESPACE"]"
46+
echo "The postgres-operator will be installed into the current namespace which is ["$NAMESPACE"]."
4447

45-
echo -n "do you want to continue the installation? [yes no] "
48+
echo -n "Do you want to continue the installation? [yes no] "
4649
read REPLY
4750
if [[ "$REPLY" != "yes" ]]; then
48-
echo "aborting installation"
51+
echo "Aborting installation."
4952
exit 1
5053
fi
5154

@@ -61,7 +64,7 @@ export PGO_CA_CERT=$COROOT/conf/apiserver/server.crt
6164
export PGO_CLIENT_CERT=$COROOT/conf/apiserver/server.crt
6265
export PGO_CLIENT_KEY=$COROOT/conf/apiserver/server.key
6366

64-
echo "setting environment variables in $HOME/.bashrc" | tee -a $LOG
67+
echo "Setting environment variables in $HOME/.bashrc..." | tee -a $LOG
6568

6669
cat <<'EOF' >> $HOME/.bashrc
6770
@@ -73,28 +76,28 @@ export PGO_CLIENT_KEY=$HOME/odev/src/github.com/crunchydata/postgres-operator/co
7376
#
7477
EOF
7578

76-
echo "setting up installation directory " | tee -a $LOG
79+
echo "Setting up installation directory..." | tee -a $LOG
7780

7881
mkdir -p $HOME/odev/src $HOME/odev/bin $HOME/odev/pkg
7982
mkdir -p $GOPATH/src/github.com/crunchydata/postgres-operator
8083

8184
echo ""
82-
echo "installing pgo server config" | tee -a $LOG
85+
echo "Installing pgo server configuration..." | tee -a $LOG
8386
wget --quiet https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz -O /tmp/postgres-operator.$PGORELEASE.tar.gz
8487
if [[ $? -ne 0 ]]; then
85-
echo "problem getting pgo server config"
88+
echo "ERROR: Problem getting the pgo server configuration."
8689
exit 1
8790
fi
8891

8992
cd $COROOT
9093
tar xzf /tmp/postgres-operator.$PGORELEASE.tar.gz
9194
if [[ $? -ne 0 ]]; then
92-
echo "problem getting 2.6 release"
95+
echo "ERROR: Problem unpackaging the $PGORELEASE release."
9396
exit 1
9497
fi
9598

9699
echo ""
97-
echo "installing pgo client" | tee -a $LOG
100+
echo "Installing pgo client..." | tee -a $LOG
98101

99102
mv pgo $GOBIN
100103
mv pgo-mac $GOBIN
@@ -103,46 +106,44 @@ mv expenv.exe $GOBIN
103106
mv expenv-mac $GOBIN
104107
mv expenv $GOBIN
105108

106-
echo "storage classes on your system..."
109+
echo "The available storage classes on your system:"
107110
kubectl get sc
108111
echo ""
109-
echo -n "enter the name of the storage class to use: "
112+
echo -n "Enter the name of the storage class to use: "
110113
read STORAGE_CLASS
111114

112115
echo ""
113-
echo "setting up pgo storage configuration for storageclass" | tee -a $LOG
116+
echo "Setting up pgo storage configuration for the selected storageclass..." | tee -a $LOG
114117
cp $COROOT/examples/pgo.yaml.storageclass $COROOT/conf/apiserver/pgo.yaml
115118
sed --in-place=.bak 's/standard/'"$STORAGE_CLASS"'/' $COROOT/conf/apiserver/pgo.yaml
116119
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/service-account.yaml
117120
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/rbac.yaml
118121

119122
echo ""
120-
echo "setting up pgo client auth" | tee -a $LOG
123+
echo "Setting up pgo client authentication..." | tee -a $LOG
121124
echo "username:password" > $HOME/.pgouser
122125

123-
echo "for pgo bash completion you will need to install the bash-completion package" | tee -a $LOG
126+
echo "For pgo bash completion you will need to install the bash-completion package." | tee -a $LOG
124127

125128
cp $COROOT/examples/pgo-bash-completion $HOME/.bash_completion
126129

127-
echo -n "do you want to deploy the operator? [yes no] "
130+
echo -n "Do you want to deploy the operator? [yes no] "
128131
read REPLY
129132
if [[ "$REPLY" == "yes" ]]; then
130-
echo "deploy the operator to the Kube cluster" | tee -a $LOG
133+
echo "Deploying the operator to the Kubernetes cluster..." | tee -a $LOG
131134
$COROOT/deploy/deploy.sh | tee -a $LOG
132135
fi
133136

134-
echo "install complete" | tee -a $LOG
137+
echo "Installation complete." | tee -a $LOG
135138
echo ""
136139

137140
echo "At this point you can access the operator by using a port-forward command similar to:"
138141
podname=`kubectl get pod --selector=name=postgres-operator -o jsonpath={..metadata.name}`
139142
echo "kubectl port-forward " $podname " 18443:8443"
140-
echo "do this in another terminal or run in the background"
143+
echo "Run this in another terminal or in the background."
141144

142145
echo ""
143-
echo "WARNING: for the postgres-operator settings to take effect, log out of your session and back in, or reload your .bashrc file"
146+
echo "WARNING: For the postgres-operator settings to take effect, it is necessary to log out of your session and back in or reload your .bashrc file."
144147

145148
echo ""
146-
echo "NOTE: to access the pgo CLI, place it within your PATH, it is located in $HOME/odev/bin/pgo"
147-
148-
149+
echo "NOTE: In order to access the pgo CLI, place it within your PATH from its default location in $HOME/odev/bin/pgo."

examples/quickstart-for-ocp.sh

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,40 +17,38 @@ LOG="pgo-installer.log"
1717

1818
export PGORELEASE=2.6
1919

20-
echo "testing for dependencies " | tee -a $LOG
20+
echo "Testing for dependencies..." | tee -a $LOG
2121

2222
which wget > /dev/null 2> /dev/null
2323
if [[ $? -ne 0 ]]; then
24-
echo "wget is missing on your system, a required dependency" | tee -a $LOG
24+
echo "The required dependency wget is missing on your system." | tee -a $LOG
2525
exit 1
2626
fi
2727
which oc > /dev/null 2> /dev/null
2828
if [[ $? -ne 0 ]]; then
29-
echo "oc is missing on your system, a required dependency" | tee -a $LOG
29+
echo "The required dependency oc is missing on your system." | tee -a $LOG
3030
exit 1
3131
fi
3232

3333
echo ""
34-
echo "testing oc connection" | tee -a $LOG
34+
echo "Testing oc connection..." | tee -a $LOG
3535
echo ""
3636
oc project
3737
if [[ $? -ne 0 ]]; then
38-
echo "oc is not connecting to your Openshift Cluster, required to proceed" | tee -a $LOG
38+
echo "oc is not connecting to your OpenShift Cluster. A successful connection is required to proceed." | tee -a $LOG
3939
exit 1
4040
fi
4141

42-
echo "connected to project" | tee -a $LOG
43-
echo ""
44-
echo "this script will install the postgres operator into the project listed below...."
45-
oc project
42+
echo "Connected to OpenShift." | tee -a $LOG
4643
echo ""
4744

4845
PROJECT=`oc project -q`
49-
echo "installing into project ["$PROJECT"]"
46+
echo "The postgres-operator will be installed into the current namespace which is ["$PROJECT"]."
5047
echo ""
51-
echo -n "do you want to continue the installation? [yes no] "
48+
echo -n "Do you want to continue the installation? [yes no] "
5249
read REPLY
5350
if [[ "$REPLY" == "no" ]]; then
51+
echo "Aborting installation."
5452
exit 0
5553
fi
5654

@@ -67,7 +65,7 @@ export PGO_CLIENT_CERT=$COROOT/conf/apiserver/server.crt
6765
export PGO_CLIENT_KEY=$COROOT/conf/apiserver/server.key
6866

6967
echo ""
70-
echo "setting environment variables in $HOME/.bashrc" | tee -a $LOG
68+
echo "Setting environment variables in $HOME/.bashrc..." | tee -a $LOG
7169
echo ""
7270

7371
cat <<'EOF' >> $HOME/.bashrc
@@ -77,18 +75,18 @@ export CO_APISERVER_URL=https://127.0.0.1:18443
7775
export PGO_CA_CERT=$HOME/odev/src/github.com/crunchydata/postgres-operator/conf/apiserver/server.crt
7876
export PGO_CLIENT_CERT=$HOME/odev/src/github.com/crunchydata/postgres-operator/conf/apiserver/server.crt
7977
export PGO_CLIENT_KEY=$HOME/odev/src/github.com/crunchydata/postgres-operator/conf/apiserver/server.key
80-
#
78+
#
8179
8280
EOF
8381

8482
echo ""
85-
echo "setting up installation directory" | tee -a $LOG
83+
echo "Setting up installation directory..." | tee -a $LOG
8684

8785
mkdir -p $HOME/odev/src $HOME/odev/bin $HOME/odev/pkg
8886
mkdir -p $GOPATH/src/github.com/crunchydata/postgres-operator
8987

9088
echo ""
91-
echo "installing pgo server config" | tee -a $LOG
89+
echo "Installing pgo server configuration..." | tee -a $LOG
9290
wget --quiet https://github.com/CrunchyData/postgres-operator/releases/download/$PGORELEASE/postgres-operator.$PGORELEASE.tar.gz -O /tmp/postgres-operator.$PGORELEASE.tar.gz
9391
#if [[ $? -ne 0 ]]; then
9492
# echo "problem getting pgo server config"
@@ -97,12 +95,12 @@ wget --quiet https://github.com/CrunchyData/postgres-operator/releases/download/
9795
cd $COROOT
9896
tar xzf /tmp/postgres-operator.$PGORELEASE.tar.gz
9997
if [[ $? -ne 0 ]]; then
100-
echo "problem getting 2.6 release"
98+
echo "ERROR: Problem unpackaging the $PGORELEASE release."
10199
exit 1
102100
fi
103101

104102
echo ""
105-
echo "installing pgo client" | tee -a $LOG
103+
echo "Installing pgo client..." | tee -a $LOG
106104

107105
mv pgo $GOBIN
108106
mv pgo-mac $GOBIN
@@ -111,51 +109,51 @@ mv expenv.exe $GOBIN
111109
mv expenv-mac $GOBIN
112110
mv expenv $GOBIN
113111

114-
echo "storage classes on your system..."
112+
echo "The available storage classes on your system:"
115113
oc get sc
116114
echo ""
117-
echo -n "enter the name of the storage class to use: "
115+
echo -n "Enter the name of the storage class to use: "
118116
read STORAGE_CLASS
119117

120118
echo ""
121-
echo "setting up pgo storage configuration for storageclass" | tee -a $LOG
119+
echo "Setting up pgo storage configuration for the selected storageclass..." | tee -a $LOG
122120
cp $COROOT/examples/pgo.yaml.storageclass $COROOT/conf/apiserver/pgo.yaml
123-
sed --in-place=.bak 's/standard/'"$STORAGE_CLASS"'/' $COROOT/conf/apiserver/pgo.yaml
124-
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/service-account.yaml
125-
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/rbac.yaml
121+
sed --in-place=.bak 's/standard/'"$STORAGE_CLASS"'/' $COROOT/conf/apiserver/pgo.yaml
122+
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/service-account.yaml
123+
sed --in-place=.bak 's/demo/'"$PROJECT"'/' $COROOT/deploy/rbac.yaml
126124

127125
echo ""
128-
echo -n "storage classes can require a fsgroup setting to be specified in the security context of your pods, typically this value is 26 but on some storage providers, this value is blank, enter your fsgroup setting if required or blank if not required: "
126+
echo -n "Storage classes can require a fsgroup setting to be specified in the security context of your pods. Typically, this value is 26, but on some storage providers this value is blank. Enter your fsgroup setting if required or leave blank if not required: "
129127
read FSGROUP
130-
sed --in-place=.bak 's/26/'"$FSGROUP"'/' $COROOT/conf/apiserver/pgo.yaml
128+
sed --in-place=.bak 's/26/'"$FSGROUP"'/' $COROOT/conf/apiserver/pgo.yaml
131129

132130
echo ""
133-
echo "setting up pgo client auth" | tee -a $LOG
131+
echo "Setting up pgo client authentication..." | tee -a $LOG
134132
echo "username:password" > $HOME/.pgouser
135133

136134
echo ""
137-
echo "for pgo bash completion you will need to install the bash-completion package" | tee -a $LOG
135+
echo "For pgo bash completion you will need to install the bash-completion package." | tee -a $LOG
138136

139137
cp $COROOT/examples/pgo-bash-completion $HOME/.bash_completion
140138
echo ""
141-
echo -n "do you want to deploy the operator? [yes no] "
139+
echo -n "Do you want to deploy the operator? [yes no] "
142140
read REPLY
143141
if [[ "$REPLY" == "yes" ]]; then
144-
echo "deploy the operator to the OCP cluster" | tee -a $LOG
142+
echo "Deploying the operator to the OCP cluster..." | tee -a $LOG
145143
# $COROOT/deploy/deploy.sh > /dev/null 2> /dev/null | tee -a $LOG
146144
$COROOT/deploy/deploy.sh | tee -a $LOG
147145
fi
148146

149-
echo "install complete" | tee -a $LOG
147+
echo "Installation complete." | tee -a $LOG
150148
echo ""
151149

152150
echo "At this point you can access the operator by using a port-forward command similar to:"
153151
podname=`oc get pod --selector=name=postgres-operator -o jsonpath={..metadata.name}`
154152
echo "oc port-forward " $podname " 18443:8443"
155-
echo "do this in another terminal or run in the background"
153+
echo "Run this in another terminal or in the background."
156154

157155
echo ""
158-
echo "WARNING: for the postgres-operator settings to take effect, log out of your session and back in, or reload your .bashrc file"
156+
echo "WARNING: For the postgres-operator settings to take effect, it is necessary to log out of your session and back in or reload your .bashrc file."
159157

160158
echo ""
161-
echo "NOTE: to access the pgo CLI, place it within your PATH, it is located in $HOME/odev/bin/pgo"
159+
echo "NOTE: In order to access the pgo CLI, place it within your PATH from its default location in $HOME/odev/bin/pgo."

0 commit comments

Comments
 (0)