install.sh
2.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n <replace-your-k8s-namespace> get pods | grep -q character-library-metadata-bastion
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion service install success!"
else
echo "character-library-metadata-bastion service install fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion deployment install success!"
else
echo "character-library-metadata-bastion deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/character-library-metadata-bastion/character-library-metadata-bastion.yaml
kubectl -n <replace-your-k8s-namespace> get svc | grep -q character-library-metadata-bastion
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get svc | grep -q character-library-metadata-bastion
done
kubectl -n <replace-your-k8s-namespace> get pods | grep -q character-library-metadata-bastion
while [ "$?" == "0" ]
do
kubectl -n <replace-your-k8s-namespace> get pods | grep -q character-library-metadata-bastion
done
kubectl create -f /tmp/dev/character-library-metadata-bastion/character-library-metadata-bastion.yaml --record
kubectl -n <replace-your-k8s-namespace> get svc | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion service update success!"
else
echo "character-library-metadata-bastion service update fail!"
fi
kubectl -n <replace-your-k8s-namespace> get pods | grep -q character-library-metadata-bastion
if [ "$?" == "0" ];then
echo "character-library-metadata-bastion deployment update success!"
else
echo "character-library-metadata-bastion deployment update fail!"
fi
fi