-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathbsroot.sh
executable file
·67 lines (62 loc) · 2.17 KB
/
bsroot.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
#!/usr/bin/env bash
# bsroot.sh doing the preparing stage of running the sextant bootstrapper.
#
# Usage: bsroot.sh <cluster-desc.yml> [\$SEXTANT_DIR/bsroot]
#
#
# Things include:
# 1. Create a "bsroot" directory, download contents that is needed:
# 1) PXE images
# 2) Linux images, currently CoreOS and CentOS7
# 3) docker images that is needed to deploy kubernetes and ceph
# 4) NVIDIA gpu drivers
# 2. Compile cloud-config-server binaries in a docker container
# 3. Generate configurations accroding to 'cluster-desc.yaml'
# 4. Generate root CA and api-server certs under 'ssl/'.
# 4. Package the bootstrapper as a docker image. Put dnsmasq, docker registry
# cloud-config-server and scripts needed into one image.
# ***** Important *****
# bsroot.sh considers the situation of a "offline cluster", which is not able to
# connect to the internet directly. So all the images/files must be prepared
# under generated "./bsroot" directory. Copy this directory to the "real"
# bootstrap server when the bootstrapper server is "offline". Or, you can run
# bsroot.sh directly on the bootstrap server.
alias cp='cp'
SEXTANT_ROOT=${PWD}
source $SEXTANT_ROOT/scripts/log.sh
source $SEXTANT_ROOT/scripts/common.sh
check_prerequisites
check_cluster_desc_file
echo "Install OS: ${cluster_desc_os_name}"
if [[ $cluster_desc_os_name == "CentOS" ]]; then
source $SEXTANT_DIR/scripts/centos.sh
download_centos_images
generate_pxe_centos_config
generate_kickstart_config
generate_post_cloudinit_script
generate_rpmrepo_config
if [[ $cluster_desc_set_gpu == "y" ]];then
download_centos_gpu_drivers
fi
elif [[ $cluster_desc_os_name == "CoreOS" ]]; then
source $SEXTANT_DIR/scripts/coreos.sh
check_coreos_version
download_pxe_images
generate_pxe_config
update_coreos_images
generate_install_script
if [[ $cluster_desc_set_gpu == "y" ]];then
build_coreos_nvidia_gpu_drivers
fi
else
echo "Unsupport OS: ${cluster_desc_os_name}"
exit -1
fi
generate_registry_config
generate_ceph_install_scripts
download_k8s_images
build_bootstrapper_image
generate_tls_assets
prepare_setup_kubectl
generate_addons_config
log info "bsroot done!"