vim /etc/systemd/system/cmii-startup.service


[Unit]
Description=Cmii Start Up Script

[Service]
ExecStart=/bin/bash /cmii/start-up.sh
User=root
Group=root

[Install]
WantedBy=multi-user.target



vim /cmii/start-up.sh

docker-compose -f /cmii/harbor/docker-compose.yml up -d
sleep 10

docker-compose -f /cmii/0-minio-dockercompose.yml up -d

rm -rf /nfsdata/zhbf-helm-emqxs-pvc-fdb605a0-5120-481a-bdd5-7ef1213c2363/

sleep 5

kubectl delete -n zhbf pod helm-nacos-0 --force
kubectl delete -n zhbf pod helm-emqxs-0 --force
kubectl delete -n zhbf pod helm-redis-master-0 --force
kubectl delete -n zhbf pod helm-redis-replicas-0 --force

sleep 30

for kindof in  pods
do
  kubectl -n zhbf delete $kindof $(kubectl -n zhbf get $kindof | grep "cmii"| awk '{print$1}')
done


chmod +x /cmii/start-up.sh


systemctl daemon-reload
sudo systemctl enable cmii-startup.service

