-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.sh
executable file
·147 lines (113 loc) · 3.69 KB
/
deploy.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/usr/bin/env bash
BASE_DIR="$(dirname $(readlink -f $0))"
source $BASE_DIR/include.sh
trap "set +x; add_status 'error' 'DEPLOY FAILED'; sleep 90" TERM INT EXIT
set -x
set -e
export INTERACTIVE=false
if [[ -e /etc/cloud-in-a-box.env ]]; then
source /etc/cloud-in-a-box.env
else
CLOUD_IN_A_BOX_TYPE=${1:-sandbox}
echo "CLOUD_IN_A_BOX_TYPE=$CLOUD_IN_A_BOX_TYPE" | sudo tee /etc/cloud-in-a-box.env
fi
osism apply facts
# Minified version of the Cloud in a Box in which only Kubernetes is deployed.
if [[ $CLOUD_IN_A_BOX_TYPE == "kubernetes" ]]; then
# Deploy kubernetes
osism apply kubernetes
# Deploy kubernetes dashboard
osism apply k8s-dashboard
# Deploy netdata
osism apply netdata
# Deploy netbird
if [[ ! -z "$NB_SETUP_KEY" ]]; then
echo "netbird_hostname: vice-$(head -c 8 /etc/machine-id)" >> /opt/configuration/environments/infrastructure/configuration.yml
echo "netbird_setup_key: $NB_SETUP_KEY" >> /opt/configuration/environments/infrastructure/configuration.yml
if [[ ! -z "$NB_MANAGEMENT_URL" ]]; then
echo "netbird_management_url: $NB_MANAGEMENT_URL" >> /opt/configuration/environments/infrastructure/configuration.yml
fi
osism apply netbird
fi
trap "" TERM INT EXIT
add_status info "DEPLOYMENT COMPLETED SUCCESSFULLY"
exit 0
fi
# Pull container images
osism apply -e custom pull-container-images
osism apply common
osism apply loadbalancer
# OpenSearch is only required on the sandbox type. On the edge type,
# the logs will be delivered to a central location in the future.
if [[ $CLOUD_IN_A_BOX_TYPE == "sandbox" ]]; then
osism apply opensearch
fi
# Deploy infrastructure services
osism apply openvswitch
osism apply ovn
osism apply memcached
osism apply redis
osism apply mariadb
osism apply rabbitmq
# Create LVs for Ceph since that is currently not possible with Curtin
# with percentages. The VG osd-vg itself is already created by Curtin.
if [[ ! -e /dev/osd-vg/osd-1 ]]; then
osism apply --environment custom create-logical-volumes
fi
osism reconciler sync
# Deploy Ceph services
osism apply ceph
osism apply ceph-pools
osism apply copy-ceph-keys
osism apply cephclient
osism apply ceph-bootstrap-dashboard
# Deploy OpenStack services
osism apply keystone
osism apply horizon
osism apply placement
osism apply glance
osism apply neutron
osism apply nova
osism apply cinder
osism apply designate
osism apply octavia
osism apply openstackclient
# Make Swift API endpoint available
osism apply kolla-ceph-rgw
# Upload octavia amphora image
osism manage image octavia
if [[ $CLOUD_IN_A_BOX_TYPE == "sandbox" ]]; then
osism apply skyline
osism apply barbican
osism apply prometheus
osism apply grafana
osism apply phpmyadmin
osism apply homer
osism apply netdata
fi
# Deploy wireguard service
osism apply wireguard
# Apply cloud in a box specific workarounds
osism apply --environment custom workarounds
# Bootstrap the openstack environment
osism apply --environment openstack bootstrap-$CLOUD_IN_A_BOX_TYPE
# Upload machine images
osism manage images --cloud admin --filter Cirros
osism manage images --cloud admin --filter "Ubuntu 22.04 Minimal"
# Create machine types
osism manage flavors
# Create test project (without a server and attached volume)
osism apply --environment openstack test --skip-tags test-server,test-volume
# Deploy kubernetes
osism apply kubernetes
# Deploy kubernetes dashboard
osism apply k8s-dashboard
# Deploy clusterapi
osism apply clusterapi
# Deploy magnum
osism apply copy-kubeconfig
osism apply magnum
touch /etc/cloud/cloud-init.disabled
rm -f /etc/netplan/50-cloud-init.yaml
trap "" TERM INT EXIT
add_status info "DEPLOYMENT COMPLETED SUCCESSFULLY"