Skip to content

Commit 984ccc9

Browse files
committed
Install KubeEdge with binary: add integrate edgecore with systemd and some minor bugs fix
Signed-off-by: FengGaoCSC <[email protected]>
1 parent 9a45e99 commit 984ccc9

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

docs/setup/config.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,9 @@ Verify the configurations before running `edgecore`
180180
getconf LONG_BIT
181181
```
182182

183-
+ `kubeedge/pause-arm:3.1` for arm arch
184-
+ `kubeedge/pause-arm64:3.1` for arm64 arch
185-
+ `kubeedge/pause:3.1` for x86 arch
183+
+ `kubeedge/pause-arm:3.x` for arm arch
184+
+ `kubeedge/pause-arm64:3.x` for arm64 arch
185+
+ `kubeedge/pause:3.x` for x86 arch
186186

187187
2. Before KubeEdge v1.3: check whether the cert files for `modules.edgehub.tlsCaFile` and `modules.edgehub.tlsCertFile` and `modules.edgehub.tlsPrivateKeyFile` exists. If those files not exist, you need to copy them from cloud side.
188188

@@ -219,7 +219,7 @@ Verify the configurations before running `edgecore`
219219
7. Configure the token.
220220

221221
```shell
222-
kubectl get secret tokensecret -n kubeedge -oyaml
222+
kubectl get secret tokensecret -n kubeedge -o yaml
223223
```
224224

225225
Then you get it like this:

docs/setup/install-with-binary.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ There're two ways to download `cloudcore` binary.
3131

3232
- Download from github release.
3333

34-
Now KubeEdge github officially holds three arch releases: amd64, arm, arm64. Please download the right package according to your platform.
34+
Now KubeEdge github officially holds three arch releases: amd64, arm, arm64. Please download the right package with correct release binary version (e.g v1.12.0) according to your platform.
3535

3636
```shell
3737
wget https://github.com/kubeedge/kubeedge/releases/download/v1.12.0/kubeedge-v1.12.0-linux-amd64.tar.gz
@@ -69,7 +69,7 @@ There're three ways to download a `edgecore` binary.
6969
7070
- Download from github release.
7171
72-
Now KubeEdge github officially holds three arch releases: amd64, arm, arm64. Please download the right arch package according to your platform.
72+
Now KubeEdge github officially holds three arch releases: amd64, arm, arm64. Please download the right arch package correct release binary version (e.g v1.12.0) according to your platform.
7373
```shell
7474
wget https://github.com/kubeedge/kubeedge/releases/download/v1.12.0/kubeedge-v1.12.0-linux-amd64.tar.gz
7575
tar -zxvf kubeedge-v1.12.0-linux-amd64.tar.gz
@@ -90,13 +90,13 @@ docker run --rm kubeedge/installation-package:v1.12.0 cat /usr/local/bin/edgecor
9090
- generate config file
9191
9292
```shell
93-
edgecore --defaultconfig > edgecore.yaml
93+
edgecore --defaultconfig > /etc/kubeedge/config/edgecore.yaml
9494
```
9595
9696
- get token value at cloud side:
9797
9898
```shell
99-
kubectl get secret -nkubeedge tokensecret -o=jsonpath='{.data.tokendata}' | base64 -d
99+
kubectl get secret -n kubeedge tokensecret -o=jsonpath='{.data.tokendata}' | base64 -d
100100
```
101101
102102
- update token value in edgecore config file:
@@ -109,7 +109,7 @@ The `token` is what above step get.
109109
110110
please refer to [configuration for edge](./config#configuration-edge-side-kubeedge-worker-node) for details.
111111
112-
### Run
112+
### Run
113113
114114
If you want to run cloudcore and edgecore at the same host, run following command first:
115115
@@ -120,13 +120,37 @@ export CHECK_EDGECORE_ENVIRONMENT="false"
120120
Start edgecore:
121121
122122
```shell
123-
edgecore --config edgecore.yaml
123+
edgecore --config /etc/kubeedge/config/edgecore.yaml
124124
```
125125
126126
If running with sudo and need user env vars, use -E:
127127
128128
```shell
129-
sudo -E edgecore --config edgecore.yaml
129+
sudo -E edgecore --config /etc/kubeedge/config/edgecore.yaml
130+
```
131+
132+
If you want to integration edgecore binary with systemd, you need:
133+
134+
```shell
135+
cat > /etc/systemd/system/edgecore.service << "EOF"
136+
[Unit]
137+
Description=edgecore.service
138+
139+
[Service]
140+
Type=simple
141+
ExecStart=/usr/local/bin/edgecore
142+
Restart=always
143+
RestartSec=10
144+
Environment=DEPLOY_MQTT_CONTAINER=false
145+
KillMode=process
146+
147+
[Install]
148+
WantedBy=multi-user.target
149+
EOF
150+
151+
systemctl daemon-reload
152+
systemctl enable edgecore
153+
systemctl start edgecore
130154
```
131155
132156
Run `edgecore -h` to get help info and add options if needed.

0 commit comments

Comments
 (0)