作者 yangfu

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

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-dev get pods | grep -q mmm-partner
kubectl -n mmm-suplus-dev get pods | grep -q mmmpartner
if [ "$?" == "1" ];then
kubectl create -f /tmp/dev/partner/partner.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q mmm-partner
kubectl -n mmm-suplus-dev get svc | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "mmm-partner service install success!"
echo "mmmpartner service install success!"
else
echo "mmm-partner service install fail!"
echo "mmmpartner service install fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q mmm-partner
kubectl -n mmm-suplus-dev get pods | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "mmm-partner deployment install success!"
echo "mmmpartner deployment install success!"
else
echo "mmm-partner deployment install fail!"
echo "mmmpartner deployment install fail!"
fi
else
kubectl delete -f /tmp/dev/partner/partner.yaml
kubectl -n mmm-suplus-dev get svc | grep -q mmm-partner
kubectl -n mmm-suplus-dev get svc | grep -q mmmpartner
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get svc | grep -q mmm-partner
kubectl -n mmm-suplus-dev get svc | grep -q mmmpartner
done
kubectl -n mmm-suplus-dev get pods | grep -q mmm-partner
kubectl -n mmm-suplus-dev get pods | grep -q mmmpartner
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-dev get pods | grep -q mmm-partner
kubectl -n mmm-suplus-dev get pods | grep -q mmmpartner
done
kubectl create -f /tmp/dev/partner/partner.yaml --record
kubectl -n mmm-suplus-dev get svc | grep -q mmm-partner
kubectl -n mmm-suplus-dev get svc | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "mmm-partner service update success!"
echo "mmmpartner service update success!"
else
echo "mmm-partner service update fail!"
echo "mmmpartner service update fail!"
fi
kubectl -n mmm-suplus-dev get pods | grep -q mmm-partner
kubectl -n mmm-suplus-dev get pods | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "mmm-partner deployment update success!"
echo "mmmpartner deployment update success!"
else
echo "mmm-partner deployment update fail!"
echo "mmmpartner deployment update fail!"
fi
fi
\ No newline at end of file
... ...
apiVersion: v1
kind: Service
metadata:
name: mmm-partner
name: mmmpartner
namespace: mmm-suplus-dev
labels:
k8s-app: mmm-partner
k8s-app: mmmpartner
spec:
ports:
- name: "http"
port: 80
targetPort: 8082
selector:
k8s-app: mmm-partner
k8s-app: mmmpartner
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: mmm-partner
name: mmmpartner
namespace: mmm-suplus-dev
labels:
k8s-app: mmm-partner
k8s-app: mmmpartner
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: mmm-partner
k8s-app: mmmpartner
spec:
affinity:
nodeAffinity:
... ... @@ -43,7 +43,7 @@ spec:
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: mmm-partner
- name: mmmpartner
image: 192.168.0.243:5000/mmm/partner:dev
imagePullPolicy: Always
ports:
... ... @@ -53,7 +53,7 @@ spec:
name: accesslogs
env:
- name: POSTGRESQL_DB_NAME
value: "mmm-partner_dev"
value: "mmmpartner_dev"
- name: POSTGRESQL_USER
value: "postgres"
- name: POSTGRESQL_PASSWORD
... ...