作者 yangfu

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

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-dev get pods | grep -q opp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q opp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
if [ "$?" == "0" ];then
echo "opp service install success!"
echo "mmmopp service install success!"
else
echo "opp service install fail!"
echo "mmmopp service install fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q opp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
if [ "$?" == "0" ];then
echo "opp deployment install success!"
echo "mmmopp deployment install success!"
else
echo "opp deployment install fail!"
echo "mmmopp deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/mmm-go-opp/opp.yaml
kubectl -n mmm-suplus-dev get svc | grep -q opp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get svc | grep -q opp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
done
kubectl -n mmm-suplus-dev get pods | grep -q opp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get pods | grep -q opp
kubectl -n mmm-suplus-dev get pods | grep -q mmmopp
done
kubectl create -f /tmp/dev/mmm-go-opp/opp.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q opp
kubectl -n mmm-suplus-dev get svc | grep -q mmmopp
if [ "$?" == "0" ];then
echo "opp service update success!"
echo "mmmopp service update success!"
else
echo "opp service update fail!"
fi
... ...
apiVersion: v1
kind: Service
metadata:
name: opp
name: mmmopp
namespace: mmm-suplus-dev
labels:
k8s-app: opp
k8s-app: mmmopp
spec:
ports:
- name: "http"
port: 80
targetPort: 8080
selector:
k8s-app: opp
k8s-app: mmmopp
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: opp
name: mmmopp
namespace: mmm-suplus-dev
labels:
k8s-app: opp
k8s-app: mmmopp
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: opp
k8s-app: mmmopp
spec:
affinity:
nodeAffinity:
... ... @@ -43,8 +43,8 @@ spec:
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: opp
image: 192.168.0.243:5000/mmm/opp:dev
- name: mmmopp
image: 192.168.0.243:5000/mmm/mmmopp:dev
imagePullPolicy: Always
volumeMounts:
- mountPath: /opt/logs
... ...