-
Notifications
You must be signed in to change notification settings - Fork 0
/
rebuild.sh
executable file
·90 lines (78 loc) · 2.27 KB
/
rebuild.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Rebuild control plane and prepare data-plane nodes for configuration
NODES=2
NODE_START=0
CLEAN=1
if [ $CLEAN -eq 1 ]; then
# Assuming EDPM_CR EDPM_NODE CONTROL PVC are all 1
bash clean.sh
fi
# Deploy control plane with deps and PVCs
export PVC=1
export DEPS=1
export CONTROL=1
bash deploy.sh
unset PVC
unset DEPS
unset CONTROL
# While control plane is coming up deploy EDPM nodes
export EDPM_NODE=1
bash deploy.sh
unset EDPM_NODE
# Ensure EDPM nodes are all up before proceeding
for I in $(seq $NODE_START $NODES); do
$(bash ssh_node.sh $I) "hostname" 2> /dev/null
if [[ $? -gt 0 ]]; then
echo "Aborting. Unable to SSH into edpm-compute-${I}"
exit 1
fi
done
# Wait until we can deploy prep
eval $(crc oc-env)
oc login -u kubeadmin -p 12345678 https://api.crc.testing:6443
echo "Wait for nova-metadata-internal ingress IP to be set"
while [ 1 ]; do
if [[ ! -z $(oc get svc nova-metadata-internal -o json \
| jq -r '.status.loadBalancer.ingress[0].ip') ]]; then
break
fi
echo -n "."
sleep 1
done
# Create crs/data_plane/base/deployment.yaml to kustomize later
export EDPM_DEPLOY_PREP=1
bash deploy.sh
unset EDPM_DEPLOY_PREP
# View control plane end points
oc get pods | grep nova-api
echo "Waiting for the nova-api pod to be running"
while [ 1 ]; do
if [[ $(oc get pods | grep nova-api | grep Running | wc -l) -gt 0 ]]; then
break
fi
echo -n "."
sleep 1
done
openstack() {
oc rsh -t --shell='/bin/sh' openstackclient openstack $@
}
openstack endpoint list
echo "Waiting for public and private nova endpoints to be listed in keystone"
while [[ 1 ]]; do
if [[ $(openstack endpoint list -f value | grep nova | wc -l) -eq 2 ]]; then
break
else
echo -n "."
sleep 1
fi
done
unset -f openstack
echo "select * from services in nova_cell1"
# list services in cell1
oc exec -it pod/openstack-cell1-galera-0 -- mysql -uroot -p12345678 -e "use nova_cell1; select * from services;"
if [[ $(openstack endpoint list -f value | grep glance | wc -l) -eq 0 ]]; then
echo "WARNING: glance endpoint is missing"
oc get pods -n openstack-operators | grep glance
oc get pods | grep glance
oc get pv --selector provisioned-by=crc-devsetup --no-headers | grep glance
fi