Giter Site home page Giter Site logo

keadm join不成功,日志显示Error: failed to get CA certificate, err: Get "https://192.168.15.128:10002/ca.crt": dial tcp 192.168.15.128:10002: connect: connection refused about kubeedge HOT 12 OPEN

leepoplee avatar leepoplee commented on May 25, 2024
keadm join不成功,日志显示Error: failed to get CA certificate, err: Get "https://192.168.15.128:10002/ca.crt": dial tcp 192.168.15.128:10002: connect: connection refused

from kubeedge.

Comments (12)

Shelley-BaoYue avatar Shelley-BaoYue commented on May 25, 2024 1

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)

from kubeedge.

wbc6080 avatar wbc6080 commented on May 25, 2024

Based on your description, I would like to ask a question, has the edge node already joined the kubernetes cluster before deploying kubeedge?

from kubeedge.

SherlockShemol avatar SherlockShemol commented on May 25, 2024

Do you use minikube to start a cluster?

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 2024

Based on your description, I would like to ask a question, has the edge node already joined the kubernetes cluster before deploying kubeedge?

没有加入,我执行下面的命令,重复加入了好几次也是同样的错误。edgecore.service服务restart也是如此。

> systemctl stop edgecore
> systemctl daemon-reload
> keadm reset --force
> rm -rf /var/lib/kubeedge /var/lib/edged /etc/kubeedge
> rm -rf /etc/systemd/system/edgecore.service
> rm -rf /usr/local/bin/edgecore

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 2024

Do you use minikube to start a cluster?

不好意思,我是第一次安装k8s和kubeedge,按照教程摸索着部署到最后了,但是出现了自己无法解决的问题,正如上面所述。minikube没有用过。

from kubeedge.

Shelley-BaoYue avatar Shelley-BaoYue commented on May 25, 2024

When you join the edge node, set --cloudcore-ipport=192.168.15.129:10000 and try again.

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 2024

When you join the edge node, set --cloudcore-ipport=192.168.15.129:10000 and try again.

我把IP修改后,报的错误有一点区别,如下:
Error: failed to get edge certificate from the cloudcore, error: Get "https://192.168.15.129:10002/edge.crt": tls: failed to verify certificate: x509: certificate is valid for 192.168.15.128, not 192.168.15.129
image
image

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 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)

大概我明白你的意思了。也就说keadm init 初始化的时候要把k8s的所有节点IP都要加上,--advertise-address=192.168.15.128,192.168.15.129。还有edgecore再join的时候,IP要指定cloudcore真正运行的节点上。
我试一试,重新初始化下。
有任何问题我再及时反馈,谢谢!

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 2024

@Shelley-BaoYue

keadm init --advertise-address=192.168.15.128,192.168.15.129 --kube-config=/root/.kube/config --kubeedge-version=1.16.0
keadm join --cloudcore-ipport=192.168.15.129:10000 --kubeedge-version=1.16.0 --token=aeccddf70f878fa6d6bb9c21faa040b6902d0f930d570fb7da6191b9d8e88018.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MDk4MTU1NzJ9.QeXsM6jcGFsgxz2zVveFpGEE5uU_AhHfsWja26cZUFk

通过以上命令,显示成功部署了edge,但是由于我安装了calico插件,遇到了和这个问题一样的情况,#5062 (comment)

enable dynamiccontroller in cloudcore config and enable metaserver in edgecore config

我也按照说明把dynamiccontroller 和 metaserver 设置了true,并且相应的重启了cloudcore和edgecore,但是错误还是存在。
难道必须要安装edgemesh才可以吗?还有下图中不知为何cloudcore出现了两个服务,是每加入一个节点就会出现一个吗?
image
image
image

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 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)

from kubeedge.

Piwriw avatar Piwriw commented on May 25, 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?

from kubeedge.

leepoplee avatar leepoplee commented on May 25, 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状态。

from kubeedge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.