kubbedge: Enable kubectl logs Feature

Posted Kris_u

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了kubbedge: Enable kubectl logs Feature相关的知识,希望对你有一定的参考价值。

 Deploying using Keadm | KubeEdge

#Enable kubectl logs Feature
funEnableLogs()
   echo "master node ip: $1"
   read masterNodeIp
   if [ -f "/etc/kubernetes/pki/ca.crt" ] && [ -f "/etc/kubernetes/pki/ca.key" ];then
        echo "Both ca.crt and ca.key are exist."
        export CLOUDCOREIPS=$masterNodeIp
        echo $CLOUDCOREIPS
        cp $GOPATH/src/github.com/kubeedge/kubeedge/build/tools/certgen.sh /etc/kubeedge/
        cd  /etc/kubeedge/ && /etc/kubeedge/certgen.sh stream
        kubectl get cm tunnelport -nkubeedge -oyaml | tee ipTunnelPort.txt
        cloudcoreIp = $(grep -Po '(1\\d2|2[0-4]\\d|25[0-5]|[1-9]\\d|[1-9])(\\.(1\\d2|2[0-4]\\d|25[0-5]|[1-9]\\d|\\d))3' ipTunnelPort.txt)
        tunnelPortTmp = $(grep -Po '":[0-9]1,5' ipTunnelPort.txt)
        tunnelPort = $(echo "$tunnelPortTmp"|cut -f2 -d":")
        echo "$tunnelIp" && echo "$tunnelPort"
        iptables -t nat -A OUTPUT -p tcp --dport $tunnelPort -j DNAT --to $cloudcoreIp:10003

        #Modify both /etc/kubeedge/config/cloudcore.yaml and /etc/kubeedge/config/edgecore.yaml on cloudcore and edgecore.
        #Set up cloudStream and edgeStream to enable: true.



   else
        echo "Both ca.crt and ca.key are not exist."
   fi

以上是关于kubbedge: Enable kubectl logs Feature的主要内容,如果未能解决你的问题,请参考以下文章

kubectl常用命令

06-kubectl常见命令整理

kubectl介绍及使用

K8s kubectl 常用命令总结,建议收藏!

kubernetes集群客户端命令 kubectl

kubectl logs