Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edgecore部署Edgemesh,不知怎样配置04-configmap.yaml文件了,永远是在notready状态。 #554

Open
leepoplee opened this issue Mar 11, 2024 · 2 comments

Comments

@leepoplee
Copy link

leepoplee commented Mar 11, 2024

keadm init --advertise-address=192.168.15.128,192.168.15.129 (advertise-address is used to set IPs in cloudcore's cert ) If you can set the node affinity to ensure that cloudcore is scheduled to a fixed node, you can also set only one IP.
If cloudcore is scheduled on 192.168.15.129, you can use keadm join --cloudcore-ipport=192.168.15.129:10000 (This IP must be the node IP that cloudcore scheduled on)

请问EdgeMesh 和 calico 同时安装会有冲突吗?当前存在calico 的情况下,我在安装下EdgeMesh ,是否能避免上面所述的问题?#5450 (comment)
If you have a question about EdgeMesh, maybe go to the EdgeMesh repository and you will get a better answer.Clash Pod of Calico is Running on Cloud Node?

Calico 的 Clash Pod在云节点上运行。我想我也要放弃了,到最后部署Edgemesh进行不下去了,可能就差5%就成功了。最后的状态时edgecore的节点notready,云节点和k8s服务都正常。并且云节点已安装Edgemesh。
基于上面的问题,我做了以下操作。

1. 设置云端(此处注意,需要把k8s的所有节点ip都要配置上)
keadm init --advertise-address=192.168.15.128,192.168.15.129 --kube-config=/root/.kube/config --kubeedge-version=1.16.0
2. 获取token
keadm gettoken
3. 由于安装了calico插件,edge 加入集群的时候不支持。会报错,新增亲和性配置(affinity)
kubectl edit daemonset -n kube-system calico-node
增加以下内容

spec:
  affinity:
    nodeAffinity:
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: node-role.kubernetes.io/edge
            	operator: DoesNotExist

4. 设置边缘端,加入集群(注意此处用的是k8s子节点IP,也就是cloudcore真正运行的IP)
keadm join --cloudcore-ipport=192.168.15.129:10000 --kubeedge-version=1.16.0 --token=c3cfd82da2108a4fb15ccd21fb599ada80d8e65fc32cd95326f00318971dcf3b.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDk5NzMyNDF9.tTrxq7Qk1DOn6xABr8Nfee6nTy6-ag2IZOaIFgfud1s

至此以上部署完成后,edgecore只报一个错误,就是网络错误,所以下面开始安装edgemesh
1. 前期准备
cloudcore 需要配置dynamicController
在云端,开启 dynamicController 模块,并重启 cloudcore
kubectl edit cm cloudcore -n kubeedge
修改如下

modules:
..
dynamicController:
enable: true
..

kubectl rollout restart deployment cloudcore -n kubeedge
上述命令运行后,增加了一个新的cloudcore,但是一直pending状态。重启也是这样,手动删除原来的cloudcore。
kubectl delete pod cloudcore-67f46fb87c-8t7k7 -n kubeedge
edgecore 需要配置metaServer
在边缘端,开启metaServer模块,并重启edgecore
vim /etc/kubeedge/config/edgecore.yaml
修改如下

modules:
..
metaServer::
enable: true
..

systemctl restart edgecore
边缘端继续配置clusterDNS 和 clusterDomain
vim /etc/kubeedge/config/edgecore.yaml
修改如下

modules:
...
edged:
clusterDNS:
- 169.254.96.16
clusterDomain: cluster.local
...

systemctl restart edgecore
测试边缘 Kube-API 端点功能是否正常
curl 127.0.0.1:10550/api/v1/services
2. cloudcore处部署edgemesh

kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl label services kubernetes service.edgemesh.kubeedge.io/service-proxy-name=""
git clone https://github.com/kubeedge/edgemesh.git
cd edgemesh
kubectl apply -f build/crds/istio/
kubectl apply -f build/agent/resources/

重新生成 PSK 密码
openssl rand -base64 32
按图修改文件修改文件,注意云端和边端的nodename和ip不相同

cd build/agent/resources
vim 04-configmap.yaml

image
不知道上面修改的地方是否正确,是否还需要添加edgecore的节点?
重新部署下

cd /root/edgemesh
kubectl apply -f build/agent/resources/

检验部署结果
kubectl get all -n kubeedge -o wide
3. edgecore 处部署edgemesh
到这里进行不下去了,不知道怎样配置04-configmap.yaml文件,其实也配置了好多次,永远是notready状态。

Originally posted by @leepoplee in kubeedge/kubeedge#5450 (comment)

@leepoplee leepoplee changed the title > > > keadm init --advertise-address=192.168.15.128,192.168.15.129 (advertise-address is used to set IPs in cloudcore's cert ) If you can set the node affinity to ensure that cloudcore is scheduled to a fixed node, you can also set only one IP. edgecore部署Edgemesh,不知怎样配置04-configmap.yaml文件了,永远是在notready状态。 Mar 11, 2024
@Poorunga
Copy link
Member

Poorunga commented Mar 13, 2024

@leepoplee 对于kubeedge来说,edgemesh和calico都是可选的插件,并非一定得部署。部署edgecode的节点(边缘节点)是否ready,不依赖于edgemesh和calico

@leepoplee
Copy link
Author

calico

我又放弃edgemesh了,没有解决掉问题。calico是因为k8s报错,所以才安装,然后我又装了cni插件,edgecode是ready状态了,但是另一个错误又出现了。貌似是端口无法访问造成的。错误在这里
kubeedge/kubeedge#5458 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants