cd /home/ubuntu/k8sCongfigs/traefik
microk8s.kubectl apply -f traefik_role.yaml
microk8s.kubectl apply -f traefik_role.yaml
microk8s.kubectl apply -f traefik_roleBind.yaml

cd /home/ubuntu/k8sCongfigs/efk 
sudo su
// 准备 es 配置
mkdir /var/snap/microk8s/common/mnt/data/elasticsearch-data -p || true
mkdir /var/snap/microk8s/common/mnt/data/elasticsearch-config -p || true
cp config/* /var/snap/microk8s/common/mnt/data/elasticsearch-config -r
// 创建 es 资源
microk8s.kubectl apply -f efk-namespace.yaml
microk8s.kubectl apply -f elasticsearch-deployment.yaml
microk8s.kubectl apply -f elasticsearch-ingress.yaml
microk8s.kubectl apply -f elasticsearch-pv.yaml
microk8s.kubectl apply -f elasticsearch-pvc.yaml
microk8s.kubectl apply -f elasticsearch-service.yaml
// 这个时候正在创建elasticsearch的pod,需要拉取镜像,大概1个多小时,如果有离线的直接导入离线的镜像 
sleep 3600
./createSecure_passwd_forES.sh
./createFluentdAccoutnIn.sh

microk8s.kubectl apply -f fluentd-configMap.yaml
microk8s.kubectl apply -f fluentd-daemonset.yaml
microk8s.kubectl apply -f fluentd-service.yaml
microk8s.kubectl apply -f fluentd-ingress.yaml
microk8s.kubectl apply -f fluentd-service.yaml

microk8s.kubectl apply -f kibana-deployment.yaml
microk8s.kubectl apply -f kibana-ingress.yaml
microk8s.kubectl apply -f kibana-service.yaml

./refreshTokenForKibana.sh