forked from mehmetihsansevinc/decice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkubeedge-installation.txt
127 lines (103 loc) · 5.33 KB
/
kubeedge-installation.txt
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
In decie-spray repository, the playbooks are present. You just need to run:
- source /home/msevinc/ansible-git/ansible-venv/bin/activate
- ansible-playbook -i inventory/decice-mehmet/hosts.yaml --become --become-user=root -u msevinc cluster.yml
- ansible-playbook -i "192.168.23.13," --become --become-user=root -u msevinc playbooks/kubeedge-edgecore-install.yaml
###---On Master---###
- export KUBECONFIG=/etc/kubernetes/admin.conf
- mkdir -p /home/msevinc/kubeedge
- sudo wget https://github.com/kubeedge/kubeedge/releases/download/v1.18.0/keadm-v1.18.0-linux-arm64.tar.gz -P /home/msevinc/kubeedge/
- sudo tar -zxvf /home/msevinc/kubeedge/keadm-v1.18.0-linux-arm64.tar.gz -C /home/msevinc/kubeedge/
- sudo cp /home/msevinc/kubeedge/keadm-v1.18.0-linux-arm64/keadm/keadm /usr/local/bin
- sudo chmod +r /root/.kube/config
- sudo cp /root/.kube/config /home/msevinc/.kube/config
- sudo chown msevinc:msevinc /home/msevinc/.kube/config
- sudo chown msevinc:msevinc /home/msevinc/kubeedge
- sudo chown msevinc:msevinc /root/.kube/config
- sudo ln -s /usr/bin/dnf /usr/bin/yum
- sed -i 's|server: https://127.0.0.1:6443|server: https://192.168.23.11:6443|' /home/msevinc/.kube/config
- keadm init --advertise-address="192.168.23.11" --profile version=v1.12.1 --kube-config=/home/msevinc/.kube/config --set cloudCore.modules.dynamicController.enable=true
- keadm gettoken --kube-config=/home/msevinc/.kube/config > /home/msevinc/kubeedge/token
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/devices/devices_v1beta1_device.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/devices/devices_v1beta1_devicemodel.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/reliablesyncs/cluster_objectsync_v1alpha1.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/reliablesyncs/objectsync_v1alpha1.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/router/router_v1_ruleEndpoint.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/router/router_v1_rule.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/apps/apps_v1alpha1_edgeapplication.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/apps/apps_v1alpha1_nodegroup.yaml
- kubectl apply -f https://raw.githubusercontent.com/kubeedge/kubeedge/master/build/crds/operations/operations_v1alpha1_nodeupgradejob.yaml
Patch the service to NodePort:
kubectl patch service cloudcore -n kubeedge -p '{
"spec": {
"type": "NodePort",
"ports": [
{
"port": 10000,
"protocol": "TCP",
"targetPort": 10000,
"nodePort": 31733
},
{
"port": 10001,
"protocol": "UDP",
"targetPort": 10001,
"nodePort": 32099
},
{
"port": 10002,
"protocol": "TCP",
"targetPort": 10002,
"nodePort": 31508
},
{
"port": 10003,
"protocol": "TCP",
"targetPort": 10003,
"nodePort": 31680
},
{
"port": 10004,
"protocol": "TCP",
"targetPort": 10004,
"nodePort": 30979
}
]
}
}'
Delete the current flannel and apply the edited one
- kubectl delete daemonsets.apps -n kube-system kube-flannel-ds-arm64
- wget https://raw.githubusercontent.com/mehmetihsansevinc/decice/refs/heads/main/flannel-edge-access.yaml -P /home/msevinc/kubeedge/
- kubectl apply -f /home/msevinc/kubeedge/flannel-edge-access.yaml
==============================================================================================================================
###---On Edge CN03 Host---###
- wget https://github.com/kubeedge/kubeedge/releases/download/v1.18.0/kubeedge-v1.18.0-linux-arm64.tar.gz -P /home/msevinc/kubeedge/
- sudo tar -zxvf /home/msevinc/kubeedge/kubeedge-v1.18.0-linux-arm64.tar.gz -C /home/msevinc/kubeedge/
- sudo cp /home/msevinc/kubeedge/kubeedge-v1.18.0-linux-arm64/edge/edgecore /usr/local/bin/edgecore
extract cni targz on all nodes and " cp * /opt/cni/bin"
- sudo mkdir -p /opt/cni/bin/
- sudo tar zxvf /home/msevinc/cni-plugins-linux-arm64-v1.3.0.tgz -C /opt/cni/bin
copy cni binaries to related path check crio /usr/libexec/cni/ , /etc/crio/crio.conf edit to look at /opt/cni/bin
- sudo sed -i 's|/usr/libexec/cni/|/opt/cni/bin|' /etc/crio/crio.conf
- sudo mkdir -p /usr/libexec/bin/
- sudo cp /opt/cni/bin/* /usr/libexec/bin/
Create the /home/msevinc/kubeedge/edgecore.yaml
- wget https://raw.githubusercontent.com/mehmetihsansevinc/decice/refs/heads/main/edgecore.yaml -P /home/msevinc/kubeedge/
- export TOKEN=$(cat /home/msevinc/kubeedge/token)
- sed -i "s/token: \"\"/token: \"$(cat /home/msevinc/kubeedge/token)\"/" /home/msevinc/kubeedge/edgecore.yaml
Create an edgecore.service file under /etc/systemd/system/edgecore.service
sudo bash -c 'cat <<EOF > /etc/systemd/system/edgecore.service
[Unit]
Description=edgecore.service
[Service]
Type=simple
ExecStart=/usr/local/bin/edgecore --config /home/msevinc/kubeedge/edgecore.yaml
Environment="CHECK_EDGECORE_ENVIRONMENT=false"
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF'
Start the services
- sudo systemctl daemon-reload
- sudo systemctl restart crio
- sudo service edgecore start