File tree 4 files changed +22
-18
lines changed
4 files changed +22
-18
lines changed Original file line number Diff line number Diff line change 2
2
set -x
3
3
set -e
4
4
5
- source ocp_install_env.sh
6
5
source common.sh
7
-
8
- export OS_CLOUD=openshift
6
+ source ocp_install_env.sh
9
7
10
8
# check whether we already have a floating ip created
11
9
FLOATING_IP=$( openstack floating ip list --format value | awk -F ' ' ' NR==1 {print $2}' )
@@ -20,21 +18,21 @@ grep -qxF "$FLOATING_IP $API_ADDRESS" /etc/hosts || echo "$FLOATING_IP $API_ADDR
20
18
grep -qxF " $FLOATING_IP $CONSOLE_ADDRESS " /etc/hosts || echo " $FLOATING_IP $CONSOLE_ADDRESS " | sudo tee -a /etc/hosts
21
19
grep -qxF " $FLOATING_IP $AUTH_ADDRESS " /etc/hosts || echo " $FLOATING_IP $AUTH_ADDRESS " | sudo tee -a /etc/hosts
22
20
23
- if [ ! -d ocp ]; then
24
- mkdir -p ocp
21
+ if [ ! -d $CLUSTER_NAME ]; then
22
+ mkdir -p $CLUSTER_NAME
25
23
fi
26
24
27
- if [ ! -f ocp /install-config.yaml ]; then
25
+ if [ ! -f $CLUSTER_NAME /install-config.yaml ]; then
28
26
export CLUSTER_ID=$( uuidgen --random)
29
- cat > ocp /install-config.yaml << EOF
27
+ cat > $CLUSTER_NAME /install-config.yaml << EOF
30
28
apiVersion: v1beta3
31
29
baseDomain: ${BASE_DOMAIN}
32
30
clusterID: ${CLUSTER_ID}
33
31
machines:
34
32
- name: master
35
- replicas: 3
33
+ replicas: 2
36
34
- name: worker
37
- replicas: 3
35
+ replicas: 1
38
36
metadata:
39
37
name: ${CLUSTER_NAME}
40
38
networking:
59
57
fi
60
58
61
59
62
- $GOPATH /src/github.com/openshift/installer/bin/openshift-install --log-level=debug ${1:- create} ${2:- cluster} --dir ocp
60
+ $GOPATH /src/github.com/openshift/installer/bin/openshift-install --log-level=debug ${1:- create} ${2:- cluster} --dir $CLUSTER_NAME
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ set -ex
10
10
source ocp_install_env.sh
11
11
source common.sh
12
12
13
- LB_FLOATING_IP=$( openstack server show ostest -api -f value -c addresses | cut -d " " -f 2)
13
+ LB_FLOATING_IP=$( openstack server show ${CLUSTER_NAME} -api -f value -c addresses | cut -d " " -f 2)
14
14
15
15
echo " Attempting to expose cluster's API on floating IP: ${LB_FLOATING_IP} " | lolcat
16
16
17
17
if ! grep -q ${LB_FLOATING_IP} /etc/hosts ; then
18
- (echo " ${LB_FLOATING_IP} api.ostest .shiftstack.com" && grep -v " api.ostest .shiftstack.com" /etc/hosts) | sudo tee /etc/hosts
18
+ (echo " ${LB_FLOATING_IP} api.${CLUSTER_NAME} .shiftstack.com" && grep -v " api.${CLUSTER_NAME} .shiftstack.com" /etc/hosts) | sudo tee /etc/hosts
19
19
fi
Original file line number Diff line number Diff line change 4
4
5
5
source ocp_install_env.sh
6
6
7
- $GOPATH /src/github.com/openshift/installer/bin/openshift-install --log-level=debug --dir ocp destroy cluster
7
+ $GOPATH /src/github.com/openshift/installer/bin/openshift-install --log-level=debug --dir $CLUSTER_NAME destroy cluster
8
8
9
9
# clean /etc/hosts
10
10
grep -qxF " $API_ADDRESS " /etc/hosts || sudo sed -i " /$API_ADDRESS /d" /etc/hosts
11
11
grep -qxF " $CONSOLE_ADDRESS " /etc/hosts || sudo sed -i " /$CONSOLE_ADDRESS /d" /etc/hosts
12
12
grep -qxF " $AUTH_ADDRESS " /etc/hosts || sudo sed -i " /$AUTH_ADDRESS /d" /etc/hosts
13
13
14
- rm -rf ocp/{auth,terraform.tfstate}
14
+ rm -rf $CLUSTER_NAME /
Original file line number Diff line number Diff line change 1
1
eval " $( go env) "
2
2
3
- export OS_CLOUD=openshift
3
+ if [ -z " $OS_CLOUD " ]; then
4
+ export OS_CLOUD=openshift
5
+ fi
6
+
7
+ if [ -z " $CLUSTER_NAME " ]; then
8
+ export CLUSTER_NAME=ostest
9
+ fi
10
+
4
11
export OPENSHIFT_INSTALL_DATA=" $GOPATH /src/github.com/openshift/installer/data/data"
5
12
export OPENSTACK_REGION=regionOne
6
13
export OPENSTACK_IMAGE=rhcos
7
14
export OPENSTACK_FLAVOR=m1.medium
8
15
export BASE_DOMAIN=shiftstack.com
9
- export CLUSTER_NAME=ostest
10
16
export OPENSTACK_EXTERNAL_NETWORK=public
11
17
export PULL_SECRET=' {"auths": { "quay.io": { "auth": "Y29yZW9zK3RlYzJfaWZidWdsa2VndmF0aXJyemlqZGMybnJ5ZzpWRVM0SVA0TjdSTjNROUUwMFA1Rk9NMjdSQUZNM1lIRjRYSzQ2UlJBTTFZQVdZWTdLOUFIQlM1OVBQVjhEVlla", "email": "" }}}'
12
18
export SSH_PUB_KEY=" ` cat $HOME /.ssh/id_rsa.pub` "
13
19
14
20
export API_ADDRESS=" api.${CLUSTER_NAME} .shiftstack.com"
15
- export CONSOLE_ADDRESS=" console-openshift-console.apps.shiftstack.com"
16
- export AUTH_ADDRESS=" openshift-authentication-openshift-authentication.apps.ostest .shiftstack.com"
21
+ export CONSOLE_ADDRESS=" console-openshift-console.apps.${CLUSTER_NAME} . shiftstack.com"
22
+ export AUTH_ADDRESS=" openshift-authentication-openshift-authentication.apps.${CLUSTER_NAME} .shiftstack.com"
17
23
18
24
# Not used by the installer. Used by s.sh.
19
25
export SSH_PRIV_KEY=" $HOME /.ssh/id_rsa"
You can’t perform that action at this time.
0 commit comments