作者 yangfu

Merge branch 'dev' of http://gitlab.fjmaimaimai.com/mmm-go/opp into dev

1 #!/bin/bash 1 #!/bin/bash
2 export PATH=/root/local/bin:$PATH 2 export PATH=/root/local/bin:$PATH
3 -kubectl -n mmm-suplus-dev get pods | grep -q opp 3 +kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
4 if [ "$?" == "1" ];then 4 if [ "$?" == "1" ];then
5 kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record 5 kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
6 - kubectl -n mmm-suplus-dev get svc | grep -q opp 6 + kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
7 if [ "$?" == "0" ];then 7 if [ "$?" == "0" ];then
8 - echo "opp service install success!" 8 + echo "mmmopp service install success!"
9 else 9 else
10 - echo "opp service install fail!" 10 + echo "mmmopp service install fail!"
11 fi 11 fi
12 - kubectl -n mmm-suplus-dev get pods | grep -q opp 12 + kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
13 if [ "$?" == "0" ];then 13 if [ "$?" == "0" ];then
14 - echo "opp deployment install success!" 14 + echo "mmmopp deployment install success!"
15 else 15 else
16 - echo "opp deployment install fail!" 16 + echo "mmmopp deployment install fail!"
17 fi 17 fi
18 else 18 else
19 kubectl delete -f /tmp/dev/mmm-go-opp/opp.yaml 19 kubectl delete -f /tmp/dev/mmm-go-opp/opp.yaml
20 - kubectl -n mmm-suplus-dev get svc | grep -q opp 20 + kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
21 while [ "$?" == "0" ] 21 while [ "$?" == "0" ]
22 do 22 do
23 - kubectl -n mmm-suplus-dev get svc | grep -q opp 23 + kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
24 done 24 done
25 - kubectl -n mmm-suplus-dev get pods | grep -q opp 25 + kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
26 while [ "$?" == "0" ] 26 while [ "$?" == "0" ]
27 do 27 do
28 - kubectl -n mmm-suplus-dev get pods | grep -q opp 28 + kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
29 done 29 done
30 kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record 30 kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
31 - kubectl -n mmm-suplus-dev get svc | grep -q opp 31 + kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
32 if [ "$?" == "0" ];then 32 if [ "$?" == "0" ];then
33 - echo "opp service update success!" 33 + echo "mmmopp service update success!"
34 else 34 else
35 echo "opp service update fail!" 35 echo "opp service update fail!"
36 fi 36 fi
1 apiVersion: v1 1 apiVersion: v1
2 kind: Service 2 kind: Service
3 metadata: 3 metadata:
4 - name: opp 4 + name: mmmopp
5 namespace: mmm-suplus-dev 5 namespace: mmm-suplus-dev
6 labels: 6 labels:
7 - k8s-app: opp 7 + k8s-app: mmmopp
8 spec: 8 spec:
9 ports: 9 ports:
10 - name: "http" 10 - name: "http"
11 port: 80 11 port: 80
12 targetPort: 8080 12 targetPort: 8080
13 selector: 13 selector:
14 - k8s-app: opp 14 + k8s-app: mmmopp
15 --- 15 ---
16 apiVersion: extensions/v1beta1 16 apiVersion: extensions/v1beta1
17 kind: Deployment 17 kind: Deployment
18 metadata: 18 metadata:
19 - name: opp 19 + name: mmmopp
20 namespace: mmm-suplus-dev 20 namespace: mmm-suplus-dev
21 labels: 21 labels:
22 - k8s-app: opp 22 + k8s-app: mmmopp
23 spec: 23 spec:
24 replicas: 1 24 replicas: 1
25 template: 25 template:
26 metadata: 26 metadata:
27 labels: 27 labels:
28 - k8s-app: opp 28 + k8s-app: mmmopp
29 spec: 29 spec:
30 affinity: 30 affinity:
31 nodeAffinity: 31 nodeAffinity:
@@ -43,8 +43,8 @@ spec: @@ -43,8 +43,8 @@ spec:
43 - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb 43 - cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
44 - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy 44 - cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
45 containers: 45 containers:
46 - - name: opp  
47 - image: 192.168.0.243:5000/mmm/opp:dev 46 + - name: mmmopp
  47 + image: 192.168.0.243:5000/mmm/mmmopp:dev
48 imagePullPolicy: Always 48 imagePullPolicy: Always
49 volumeMounts: 49 volumeMounts:
50 - mountPath: /opt/logs 50 - mountPath: /opt/logs