作者 yangfu

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

#!/bin/bash
export PATH=/root/local/bin:$PATH
kubectl -n mmm-suplus-test get pods | grep -q partner
kubectl -n mmm-suplus-test get pods | grep -q mmmpartner
if [ "$?" == "1" ];then
kubectl create -f /tmp/test/partner/partner.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q partner
kubectl -n mmm-suplus-test get svc | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "partner service install success!"
echo "mmmpartner service install success!"
else
echo "partner service install fail!"
echo "mmmpartner service install fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q partner
kubectl -n mmm-suplus-test get pods | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "partner deployment install success!"
echo "mmmpartner deployment install success!"
else
echo "partner deployment install fail!"
echo "mmmpartner deployment install fail!"
fi
else
kubectl delete -f /tmp/test/partner/partner.yaml
kubectl -n mmm-suplus-test get svc | grep -q partner
kubectl -n mmm-suplus-test get svc | grep -q mmmpartner
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get svc | grep -q partner
kubectl -n mmm-suplus-test get svc | grep -q mmmpartner
done
kubectl -n mmm-suplus-test get pods | grep -q partner
kubectl -n mmm-suplus-test get pods | grep -q mmmpartner
while [ "$?" == "0" ]
do
kubectl -n mmm-suplus-test get pods | grep -q partner
kubectl -n mmm-suplus-test get pods | grep -q mmmpartner
done
kubectl create -f /tmp/test/partner/partner.yaml --record
kubectl -n mmm-suplus-test get svc | grep -q partner
kubectl -n mmm-suplus-test get svc | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "partner service update success!"
echo "mmmpartner service update success!"
else
echo "partner service update fail!"
echo "mmmpartner service update fail!"
fi
kubectl -n mmm-suplus-test get pods | grep -q partner
kubectl -n mmm-suplus-test get pods | grep -q mmmpartner
if [ "$?" == "0" ];then
echo "partner deployment update success!"
echo "mmmpartner deployment update success!"
else
echo "partner deployment update fail!"
echo "mmmpartner deployment update fail!"
fi
fi
\ No newline at end of file
... ...
apiVersion: v1
kind: Service
metadata:
name: partner
name: mmmpartner
namespace: mmm-suplus-test
labels:
k8s-app: partner
k8s-app: mmmpartner
spec:
ports:
- name: "http"
port: 80
targetPort: 8082
selector:
k8s-app: partner
k8s-app: mmmpartner
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: partner
name: mmmpartner
namespace: mmm-suplus-test
labels:
k8s-app: partner
k8s-app: mmmpartner
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: partner
k8s-app: mmmpartner
spec:
affinity:
nodeAffinity:
... ... @@ -43,8 +43,8 @@ spec:
- cn-hangzhou.i-bp1euf5u1ph9kbhtndhb
- cn-hangzhou.i-bp1hyp5oips9cdwxxgxy
containers:
- name: partner
image: 192.168.0.243:5000/mmm/partner:test
- name: mmmpartner
image: 192.168.0.243:5000/mmm/partner:dev
imagePullPolicy: Always
ports:
- containerPort: 8082
... ... @@ -52,20 +52,10 @@ spec:
- mountPath: /opt/logs
name: accesslogs
env:
- name: REDIS_HOST
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.ip
- name: REDIS_PORT
valueFrom:
configMapKeyRef:
name: suplus-config
key: redis.port
- name: HTTP_PORT
value: "8082"
value: "8082"
- name: POSTGRESQL_DB_NAME
value: "partner_test"
value: "partner_dev"
- name: POSTGRESQL_USER
value: "postgres"
- name: POSTGRESQL_PASSWORD
... ... @@ -81,9 +71,9 @@ spec:
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
- name: ABILITY_SERVICE_HOST
value: "https://suplus-worth-app-gateway-test.fjmaimaimai.com"
value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com"
- name: MMM_OPEN_API_SERVICE_HOST
value: "http://mmm-open-api-test.fjmaimaimai.com"
value: "http://mmm-open-api-dev.fjmaimaimai.com"
volumes:
- name: accesslogs
emptyDir: {}
\ No newline at end of file
... ...