作者 yangfu

k8s文件修改

@@ -22,6 +22,9 @@ metadata: @@ -22,6 +22,9 @@ metadata:
22 k8s-app: ab 22 k8s-app: ab
23 spec: 23 spec:
24 replicas: 1 24 replicas: 1
  25 + selector:
  26 + matchLabels:
  27 + k8s-app: ab
25 template: 28 template:
26 metadata: 29 metadata:
27 labels: 30 labels:
@@ -44,7 +47,7 @@ spec: @@ -44,7 +47,7 @@ spec:
44 # - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy 47 # - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
45 containers: 48 containers:
46 - name: ab 49 - name: ab
47 - image: hub.docker.com/dk1992/ab:dev 50 + image: registry.cn-shanghai.aliyuncs.com/tiptok/ab:master
48 imagePullPolicy: Always 51 imagePullPolicy: Always
49 # volumeMounts: 52 # volumeMounts:
50 # - mountPath: /opt/logs 53 # - mountPath: /opt/logs
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 export PATH=/root/local/bin:$PATH 2 export PATH=/root/local/bin:$PATH
3 kubectl -n mmm-suplus-dev get pods | grep -q ab 3 kubectl -n mmm-suplus-dev get pods | grep -q ab
4 if [ "$?" == "1" ];then 4 if [ "$?" == "1" ];then
5 - kubectl create -f /tmp/dev/ab/opp.yaml --record 5 + kubectl create -f /tmp/dev/ab/ab.yaml --record
6 kubectl -n mmm-suplus-dev get svc | grep -q ab 6 kubectl -n mmm-suplus-dev get svc | grep -q ab
7 if [ "$?" == "0" ];then 7 if [ "$?" == "0" ];then
8 echo "ab service install success!" 8 echo "ab service install success!"
@@ -16,7 +16,7 @@ if [ "$?" == "1" ];then @@ -16,7 +16,7 @@ if [ "$?" == "1" ];then
16 echo "ab deployment install fail!" 16 echo "ab deployment install fail!"
17 fi 17 fi
18 else 18 else
19 - kubectl delete -f /tmp/dev/ab/opp.yaml 19 + kubectl delete -f /tmp/dev/ab/ab.yaml
20 kubectl -n mmm-suplus-dev get svc | grep -q ab 20 kubectl -n mmm-suplus-dev get svc | grep -q ab
21 while [ "$?" == "0" ] 21 while [ "$?" == "0" ]
22 do 22 do
@@ -27,17 +27,17 @@ else @@ -27,17 +27,17 @@ else
27 do 27 do
28 kubectl -n mmm-suplus-dev get pods | grep -q ab 28 kubectl -n mmm-suplus-dev get pods | grep -q ab
29 done 29 done
30 - kubectl create -f /tmp/dev/ab/opp.yaml --record 30 + kubectl create -f /tmp/dev/ab/ab.yaml --record
31 kubectl -n mmm-suplus-dev get svc | grep -q ab 31 kubectl -n mmm-suplus-dev get svc | grep -q ab
32 if [ "$?" == "0" ];then 32 if [ "$?" == "0" ];then
33 echo "ab service update success!" 33 echo "ab service update success!"
34 else 34 else
35 - echo "opp service update fail!" 35 + echo "ab service update fail!"
36 fi 36 fi
37 - kubectl -n mmm-suplus-dev get pods | grep -q opp 37 + kubectl -n mmm-suplus-dev get pods | grep -q ab
38 if [ "$?" == "0" ];then 38 if [ "$?" == "0" ];then
39 - echo "opp deployment update success!" 39 + echo "ab deployment update success!"
40 else 40 else
41 - echo "opp deployment update fail!" 41 + echo "ab deployment update fail!"
42 fi 42 fi
43 fi 43 fi