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\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])(\.(1\d{2}|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
}

你可能感兴趣的:(kubeedge,kubeEdge)