-
Notifications
You must be signed in to change notification settings - Fork 1
/
ocp-start.sh
39 lines (35 loc) · 1.16 KB
/
ocp-start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# start openshift all-in-one env
# supose openshift command already in the path
# usage:
# $ . start-openshift.sh $master_public_ip
public_master=$1
echo $public_master
if [ -d "logs" ]; then
rm -rf logs
fi
mkdir logs
openshift start --write-config=openshift.local.config --public-master=https://${public_master}:8443
nodeConfig=$(ls openshift.local.config |grep node)
openshift start master --config=openshift.local.config/master/master-config.yaml --loglevel=5 &> logs/openshift-master.log &
openshift start node --config=openshift.local.config/${nodeConfig}/node-config.yaml --loglevel=5 &> logs/openshift-node.log &
export KUBECONFIG=`pwd`/openshift.local.config/master/admin.kubeconfig
export CURL_CA_BUNDLE=`pwd`/openshift.local.config/master/ca.crt
sudo chmod a+rwX "$KUBECONFIG"
sleep 10
# start registry and router
oadm registry
oadm policy add-scc-to-user hostnetwork -z router
oadm router
function cleanup(){
kill `pidof openshift`
rm -rf logs/
rm -rf openshift.local.config/
rm -rf openshift.local.etcd/
rm -rf openshift.local.volumes/
}
function buildlatest(){
git clone https://github.com/openshift/origin.git
cd origin
hack/build-go.sh
}