-
Notifications
You must be signed in to change notification settings - Fork 0
/
fornax2.sh
82 lines (74 loc) · 3.42 KB
/
fornax2.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
#! /bin/bash
set -x
----------------------------------------
hostnamectl set-hostname node-b
ufw disable
swapoff -a
mkdir -p /etc/kubeedge/ca
mkdir -p /etc/kubeedge/certs
apt-get -y update
echo -e 'br_netfilter' | cat > /etc/modules-load.d/k8s.conf
echo -e 'net.bridge.bridge-nf-call-ip6tables = 1\nnet.bridge.bridge-nf-call-iptables = 1' | cat >> /etc/sysctl.d/k8s.conf
sysctl --system
apt-get -y update
apt-get install docker.io -y
systemctl enable docker
systemctl start docker
apt-get -y update
apt-get install -y apt-transport-https ca-certificates curl
curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
echo -e 'deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main' | cat >> /etc/apt/sources.list.d/kubernetes.list
apt-get -y update
apt-get install -qy kubelet=1.21.1-00 kubectl=1.21.1-00 kubeadm=1.21.1-00
apt-mark hold kubelet kubeadm kubectl
systemctl enable docker.service
kubeadm init
export KUBECONFIG=/etc/kubernetes/admin.conf
sleep 120s
kubectl get nodes
export kubever=$(kubectl version | base64 | tr -d '\n')
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$kubever"
sleep 60s
kubectl get nodes
echo y | sudo apt-get install vim
GOLANG_VERSION=${GOLANG_VERSION:-"1.14.15"}
apt -y install make gcc jq
wget https://dl.google.com/go/go1.14.15.linux-amd64.tar.gz -P /tmp
tar -C /usr/local -xzf /tmp/go1.14.15.linux-amd64.tar.gz
echo -e 'export PATH=$PATH:/usr/local/go/bin\nexport GOPATH=/usr/local/go/bin\nexport KUBECONFIG=/etc/kubernetes/admin.conf' |cat >> ~/.bashrc
sleep 10s
cp /usr/local/go/bin/go /usr/local/bin
source /root/.bashrc
go version
mkdir -p go/src/github.com
pushd /root/go/src/github.com
git clone https://github.com/CentaurusInfra/fornax.git
mv fornax kubeedge
pushd /root/go/src/github.com/kubeedge
make all
make WHAT=cloudcore
make WHAT=edgecore
mkdir /etc/kubeedge/config -p
cp /etc/kubernetes/admin.conf /root/.kube/config
_output/local/bin/cloudcore --minconfig > /etc/kubeedge/config/cloudcore.yaml
cp /etc/kubernetes/admin.conf /root/edgecluster.kubeconfig
_output/local/bin/edgecore --edgeclusterconfig > /etc/kubeedge/config/edgecore.yaml
tests/edgecluster/hack/update_edgecore_config.sh admin.conf
sed -i 's+RANDFILE+#RANDFILE+g' /etc/ssl/openssl.cnf
kubectl apply -f build/crds/devices/devices_v1alpha2_device.yaml
kubectl apply -f build/crds/devices/devices_v1alpha2_devicemodel.yaml
kubectl apply -f build/crds/reliablesyncs/cluster_objectsync_v1alpha1.yaml
kubectl apply -f build/crds/reliablesyncs/objectsync_v1alpha1.yaml
kubectl apply -f build/crds/router/router_v1_rule.yaml
kubectl apply -f build/crds/router/router_v1_ruleEndpoint.yaml
kubectl apply -f build/crds/edgecluster/mission_v1.yaml
kubectl apply -f build/crds/edgecluster/edgecluster_v1.yaml
chmod 777 /root/go/src/github.com/kubeedge/_output/local/bin/kubectl/vanilla/kubectl
export KUBECONFIG=/etc/kubernetes/admin.conf
nohup _output/local/bin/edgecore --edgecluster > edgecore.logs 2>&1 &
export KUBECONFIG=/etc/kubernetes/admin.conf
nohup _output/local/bin/cloudcore > cloudcore.logs 2>&1 &
echo yes | scp -r /etc/kubernetes/admin.conf 192.168.2.52:/root/go/src/github.com/kubeedge
sleep 5s
cat cloudcore.logs
cat edgecore.logs