Skip to content

Commit

Permalink
kubeedge部署文档内容优化:边缘节点资源紧张无法正常部署的问题处理
Browse files Browse the repository at this point in the history
Signed-off-by: hyp4293 <[email protected]>
  • Loading branch information
hyp4293 committed May 22, 2024
1 parent 4c47a8c commit c96e24a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/setup/install-with-keadm.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,23 @@ keadm init --set server.advertiseAddress="THE-EXPOSED-IP" --set server.nodeName=
If you are familiar with the helm chart installation, please refer to [KubeEdge Helm Charts](https://github.com/kubeedge/kubeedge/tree/master/manifests/charts).


**SPECIAL SCENARIO:**
In the case of insufficient qualifications for edge nodes, we need to label them to prevent some applications from extending to edge nodes.

```
kubectl get daemonset -n kube-system |grep -v NAME |awk '{print $1}' | xargs -n 1 kubectl patch daemonset -n kube-system --type='json' -p='[{"op": "replace","path": "/spec/template/spec/affinity","value":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"node-role.kubernetes.io/edge","operator":"DoesNotExist"}]}]}}}}]'
```


```
kubectl get daemonset -n metallb-system |grep -v NAME |awk '{print $1}' | xargs -n 1 kubectl patch daemonset -n metallb-system --type='json' -p='[{"op": "replace","path": "/spec/template/spec/affinity","value":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"node-role.kubernetes.io/edge","operator":"DoesNotExist"}]}]}}}}]'
```

Any daemonset cannot occupy the hardware resources of edge nodes.


### keadm manifest generate

You can also get the manifests with `keadm manifest generate`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ KubeEdge cloudcore is running, For logs visit: /var/log/kubeedge/cloudcore.log

当您看到以上信息,说明 KubeEdge 的云端组件 cloudcore 已经成功运行。

**特殊场景:**
边缘计算的硬件条件不好的情况,这里我们需要打上标签,让一些应用不扩展到edge节点上去。


```
kubectl get daemonset -n kube-system |grep -v NAME |awk '{print $1}' | xargs -n 1 kubectl patch daemonset -n kube-system --type='json' -p='[{"op": "replace","path": "/spec/template/spec/affinity","value":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"node-role.kubernetes.io/edge","operator":"DoesNotExist"}]}]}}}}]'
```


```
kubectl get daemonset -n metallb-system |grep -v NAME |awk '{print $1}' | xargs -n 1 kubectl patch daemonset -n metallb-system --type='json' -p='[{"op": "replace","path": "/spec/template/spec/affinity","value":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"node-role.kubernetes.io/edge","operator":"DoesNotExist"}]}]}}}}]'
```

凡是daemonset的都不可以去占用edge节点的硬件资源。


### keadm beta init

如果您想要使用容器化方式部署云端组件 cloudcore ,您可以使用 `keadm beta init` 进行云端组件安装。
Expand Down

0 comments on commit c96e24a

Please sign in to comment.