如果k8s master节点上没有部署需要被代理的应用,也可以不执行此步骤:
kubectl taint nodes --all node-role.kubernetes.io/master-
正常情况下你不会希望 EdgeMesh 去代理 Kubernetes API 服务,因此需要给它添加过滤标签,更多信息请参考 服务过滤。
kubectl label services kubernetes service.edgemesh.kubeedge.io/service-proxy-name=""
修改cloudcore configmap,需要重启cloudcore pod
- $ kubectl edit cm cloudcore -n kubeedge
- modules:
- ...
- dynamicController:
- enable: true
- $ vim /etc/kubeedge/config/edgecore.yaml
- modules:
- ...
- edgeMesh:
- enable: false
- ...
- metaManager:
- metaServer:
- enable: true
- ...
systemctl restart edgecore.service
- $ vim /etc/kubeedge/config/edgecore.yaml
- modules:
- ...
- edged:
- ...
- tailoredKubeletConfig:
- ...
- clusterDNS:
- - 169.254.96.16
- clusterDomain: cluster.local
- ...
systemctl restart edgecore.service
提示
- curl 127.0.0.1:10550/api/v1/services
- {"apiVersion":"v1","items":[{"apiVersion":"v1","kind":"Service","metadata":{"creationTimestamp":"2021-04-14T06:30:05Z","labels":{"component":"apiserver","provider":"kubernetes"},"name":"kubernetes","namespace":"default","resourceVersion":"147","selfLink":"default/services/kubernetes","uid":"55eeebea-08cf-4d1a-8b04-e85f8ae112a9"},"spec":{"clusterIP":"10.96.0.1","ports":[{"name":"https","port":443,"protocol":"TCP","targetPort":6443}],"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}},{"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"prometheus.io/port":"9153","prometheus.io/scrape":"true"},"creationTimestamp":"2021-04-14T06:30:07Z","labels":{"k8s-app":"kube-dns","kubernetes.io/cluster-service":"true","kubernetes.io/name":"KubeDNS"},"name":"kube-dns","namespace":"kube-system","resourceVersion":"203","selfLink":"kube-system/services/kube-dns","uid":"c221ac20-cbfa-406b-812a-c44b9d82d6dc"},"spec":{"clusterIP":"10.96.0.10","ports":[{"name":"dns","port":53,"protocol":"UDP","targetPort":53},{"name":"dns-tcp","port":53,"protocol":"TCP","targetPort":53},{"name":"metrics","port":9153,"protocol":"TCP","targetPort":9153}],"selector":{"k8s-app":"kube-dns"},"sessionAffinity":"None","type":"ClusterIP"},"status":{"loadBalancer":{}}}],"kind":"ServiceList","metadata":{"resourceVersion":"377360","selfLink":"/api/v1/services"}}
- openssl rand -base64 32
- WifvEZLmK/bgc8SzhQ/ptZZc/9uZZ0yUsAABCHEdrQ4=
- helm install edgemesh --namespace kubeedge \
- --set agent.psk=WifvEZLmK/bgc8SzhQ/ptZZc/9uZZ0yUsAABCHEdrQ4= \
- --set agent.relayNodes[0].nodeName=k8s-master,agent.relayNodes[0].advertiseAddress="{1.1.1.1}" \
- https://github.com/kubeedge/edgemesh/blob/v1.15.0/build/helm/edgemesh.tgz