k8sConfigs/efk/init.sh
2025-01-23 01:35:27 +08:00

34 lines
1.1 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
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