forked from wise2c-devops/breeze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
47 lines (39 loc) · 1.99 KB
/
init.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
#! /bin/bash
set -e
path=`dirname $0`
kubernetes_version=1.13.1
harbor_version=1.7.0
docker_version=18.06.1
haproxy_version=1.8.14
keepalived_version=1.3.5
loadbalancer_version=HAProxy-${haproxy_version}_Keepalived-${keepalived_version}
prometheus_version=2.5.0
prometheus_operator_version=0.26.0
mv ${path}/kubernetes-playbook/version ${path}/kubernetes-playbook/v${kubernetes_version}
mv ${path}/harbor-playbook/version ${path}/harbor-playbook/v${harbor_version}
mv ${path}/docker-playbook/version ${path}/docker-playbook/${docker_version}-CE
mv ${path}/loadbalancer-playbook/version ${path}/loadbalancer-playbook/${loadbalancer_version}
mv ${path}/prometheus-playbook/version ${path}/prometheus-playbook/v${prometheus_version}
docker run --rm --name=kubeadm-version wise2c/kubeadm-version:v${kubernetes_version} kubeadm config images list --kubernetes-version ${kubernetes_version} > ${path}/k8s-images-list.txt
etcd_version=`cat ${path}/k8s-images-list.txt |grep etcd |awk -F ':' '{print $2}'`
mv etcd-playbook/version-by-kubeadm etcd-playbook/${etcd_version}
echo "Kubernetes Version: ${kubernetes_version}" > ${path}/components-version.txt
echo "Harbor Version: ${harbor_version}" >> ${path}/components-version.txt
echo "Docker Version: ${docker_version}" >> ${path}/components-version.txt
echo "HAProxy Version: ${haproxy_version}" >> ${path}/components-version.txt
echo "Keepalived Version: ${keepalived_version}" >> ${path}/components-version.txt
echo "Prometheus Version: ${prometheus_version}" >> ${path}/components-version.txt
echo "PrometheusOperator Version: ${prometheus_operator_version}" >> ${path}/components-version.txt
for dir in `ls ${path}`
do
if [[ ${dir} =~ -playbook$ ]]; then
for version in `ls ${path}/${dir}`
do
echo ${version}
if [ -f ${path}/${dir}/${version}/init.sh ]; then
cp ${path}/components-version.txt ${path}/${dir}/${version}/
bash ${path}/${dir}/${version}/init.sh ${version}
fi
done
fi
done