Skip to content

Commit 2273bef

Browse files
author
Jeff McCormick
committed
update openshift docs and rename CMD to CO_CMD and NAMESPACE to CO_NAMESPACE
1 parent ddfc3a2 commit 2273bef

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

docs/build.asciidoc

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,27 @@ see the following links for examples:
8787
https://gitlab.com/gitlab-org/gitlab-ce/issues/24557
8888
https://docs.openshift.org/latest/admin_guide/manage_scc.html#use-the-hostpath-volume-plugin
8989

90+
You will need to allow your openshift user (e.g. jeff) permissions to view
91+
the ThirdPartyResources, this is done by the following command
92+
as the openshift admin user:
93+
....
94+
oc adm policy add-cluster-role-to-user cluster-admin jeff
95+
....
96+
9097
To test on an Origin system, you will need to specify
91-
a CMD environment variable with the value of *oc* as follows:
98+
a CO_CMD environment variable with the value of *oc* as follows:
99+
....
100+
export CO_CMD=oc
101+
....
102+
103+
Also, you can set the namespace to use for deploying the operator
104+
as follows, if not set, the namespace is set to *default*:
92105
....
93-
export CMD=oc
106+
export CO_NAMESPACE=myproject
94107
....
95108

96109
This will cause the *oc* command to be used within the operator
97-
startup script.
110+
startup script and deploy the operator to the *myproject* namespace or project.
98111

99112
== Create Project and Clone
100113
In your .bashrc file, include the following:

examples/operator/cleanup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
$CMD delete configmap operator-conf
1616

17-
$CMD --namespace=$NAMESPACE delete deployment postgres-operator
17+
$CMD --namespace=$CO_NAMESPACE delete deployment postgres-operator
1818

1919
sleep 10
2020

examples/operator/create-pv.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ for i in {1..60}
2020
do
2121
echo "creating PV crunchy-pv$i"
2222
export COUNTER=$i
23-
kubectl --namespace=$NAMESPACE delete pv crunchy-pv$i
24-
envsubst < $DIR/crunchy-pv.json | kubectl --namespace=$NAMESPACE create -f -
23+
kubectl --namespace=$CO_NAMESPACE delete pv crunchy-pv$i
24+
envsubst < $DIR/crunchy-pv.json | kubectl --namespace=$CO_NAMESPACE create -f -
2525
done

examples/operator/run.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1717

1818

19-
if [ -z "$NAMESPACE" ]; then
20-
echo "NAMESPACE not set, using default"
21-
export NAMESPACE=default
19+
if [ -z "$CO_NAMESPACE" ]; then
20+
echo "CO_NAMESPACE not set, using default"
21+
export CO_NAMESPACE=default
2222
fi
23-
if [ -z "$CMD" ]; then
24-
echo "CMD not set, using kubectl"
25-
export CMD=kubectl
23+
if [ -z "$CO_CMD" ]; then
24+
echo "CO_CMD not set, using kubectl"
25+
export CO_CMD=kubectl
2626
fi
2727

2828
$DIR/cleanup.sh
2929

30-
$CMD --namespace=$NAMESPACE get pvc crunchy-pvc
30+
$CO_CMD --namespace=$CO_NAMESPACE get pvc crunchy-pvc
3131
rc=$?
3232

3333
if [ ! $rc -eq 0 ]; then
3434
echo "crunchy-pvc does not exist...creating crunchy-pvc "
35-
$CMD --namespace=$NAMESPACE create -f $DIR/crunchy-pvc.json
35+
$CO_CMD --namespace=$CO_NAMESPACE create -f $DIR/crunchy-pvc.json
3636
$DIR/create-pv.sh
3737
else
3838
echo "crunchy-pvc already exists..."
@@ -44,12 +44,12 @@ if [ ! -d /data ]; then
4444
sudo chmod 777 /data
4545
fi
4646

47-
$CMD create configmap operator-conf \
47+
$CO_CMD create configmap operator-conf \
4848
--from-file=$COROOT/conf/postgres-operator/backup-job.json \
4949
--from-file=$COROOT/conf/postgres-operator/pvc.json \
5050
--from-file=$COROOT/conf/postgres-operator/cluster/1
5151

52-
envsubst < $DIR/deployment.json | $CMD --namespace=$NAMESPACE create -f -
52+
envsubst < $DIR/deployment.json | $CO_CMD --namespace=$CO_NAMESPACE create -f -
5353

5454
sleep 3
55-
$CMD get pod --selector=name=postgres-operator
55+
$CO_CMD get pod --selector=name=postgres-operator

0 commit comments

Comments
 (0)