Skip to content

Commit 4613bc2

Browse files
committed
cchore(workflow): optimize the components installation process
1 parent 2169025 commit 4613bc2

1 file changed

Lines changed: 31 additions & 5 deletions

File tree

_scripts/install.sh

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ function install_helm {
6060
mv "linux-${ARCH}/helm" /usr/local/bin/helm
6161
rm -rf "${tar_name}" "linux-${ARCH}"
6262
helm repo add --force-update drycc https://charts.drycc.cc/${CHANNEL:-stable}
63+
helm repo update
6364
}
6465

6566
function configure_os {
@@ -172,10 +173,8 @@ function check_metallb {
172173
fi
173174
}
174175

175-
function install_components {
176-
check_metallb
177-
helm repo update
178-
echo -e "\\033[32m---> Waiting for helm to install components...\\033[0m"
176+
function install_network() {
177+
echo -e "\\033[32m--->Start installing network...\\033[0m"
179178
api_server_address=(`ip -o route get to 8.8.8.8 | sed -n 's/.*src \([0-9.]\+\).*/\1/p'`)
180179
helm install cilium drycc/cilium \
181180
--set tunnel=geneve \
@@ -188,7 +187,12 @@ function install_components {
188187
--set global.containerRuntime.socketPath="/var/run/k3s/containerd/containerd.sock" \
189188
--set hostPort.enabled=true \
190189
--namespace kube-system --wait
190+
echo -e "\\033[32m---> Network installed!\\033[0m"
191+
}
191192

193+
function install_metallb() {
194+
check_metallb
195+
echo -e "\\033[32m--->Start installing metallb...\\033[0m"
192196
if [[ -z "${METALLB_CONFIG_FILE}" ]] ; then
193197
helm install metallb drycc/metallb --namespace metallb --create-namespace --wait -f - <<EOF
194198
configInline:
@@ -207,7 +211,11 @@ EOF
207211
else
208212
helm install metallb drycc/metallb --namespace metallb --create-namespace --wait -f ${METALLB_CONFIG_FILE}
209213
fi
210-
214+
echo -e "\\033[32m---> Metallb installed!\\033[0m"
215+
}
216+
217+
function install_traefik() {
218+
echo -e "\\033[32m--->Start installing traefik...\\033[0m"
211219
helm install traefik drycc/traefik \
212220
--namespace traefik \
213221
--create-namespace --wait -f - <<EOF
@@ -227,17 +235,35 @@ additionalArguments:
227235
- "--entrypoints.name.http3"
228236
- "--providers.kubernetesingress.allowEmptyServices=true"
229237
EOF
238+
echo -e "\\033[32m---> Traefik installed!\\033[0m"
239+
}
240+
241+
function install_cert_manager() {
242+
echo -e "\\033[32m--->Start installing cert-manager...\\033[0m"
230243
helm install cert-manager drycc/cert-manager \
231244
--namespace cert-manager \
232245
--create-namespace \
233246
--set clusterResourceNamespace=drycc \
234247
--set installCRDs=true --wait
248+
echo -e "\\033[32m---> Cert-manager installed!\\033[0m"
249+
}
235250

251+
function install_catalog() {
252+
echo -e "\\033[32m--->Start installing catalog...\\033[0m"
236253
helm install catalog drycc/catalog \
237254
--set asyncBindingOperationsEnabled=true \
238255
--set image=docker.io/drycc/service-catalog:canary \
239256
--namespace catalog \
240257
--create-namespace --wait
258+
echo -e "\\033[32m---> Catalog installed!\\033[0m"
259+
}
260+
261+
function install_components {
262+
install_network
263+
install_metallb
264+
install_traefik
265+
install_cert_manager
266+
install_catalog
241267
}
242268

243269
function install_openebs {

0 commit comments

Comments
 (0)