作者 yangfu

部署配置修改

@@ -49,7 +49,7 @@ spec: @@ -49,7 +49,7 @@ spec:
49 volumeMounts: 49 volumeMounts:
50 - mountPath: /opt/logs 50 - mountPath: /opt/logs
51 name: accesslogs 51 name: accesslogs
52 - - mountPath: /var/www/opp/file 52 + - mountPath: /var/www/opp-dev/file
53 name: mmmjihuitest-pvc1 53 name: mmmjihuitest-pvc1
54 ports: 54 ports:
55 - containerPort: 8080 55 - containerPort: 8080
@@ -85,7 +85,7 @@ spec: @@ -85,7 +85,7 @@ spec:
85 name: suplus-config 85 name: suplus-config
86 key: mysql.password 86 key: mysql.password
87 - name: MYSQL_DB_NAME 87 - name: MYSQL_DB_NAME
88 - value: "opportunity_test" 88 + value: "opportunity_dev"
89 - name: RUN_MODE 89 - name: RUN_MODE
90 value: "test" 90 value: "test"
91 - name: LOG_LEVEL 91 - name: LOG_LEVEL
@@ -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-test get pods | grep -q opp 3 kubectl -n mmm-suplus-test get pods | grep -q opp
4 if [ "$?" == "1" ];then 4 if [ "$?" == "1" ];then
5 - kubectl create -f /tmp/test/opp/opp.yaml --record 5 + kubectl create -f /tmp/test/mmm-go-opp/opp.yaml --record
6 kubectl -n mmm-suplus-test get svc | grep -q opp 6 kubectl -n mmm-suplus-test get svc | grep -q opp
7 if [ "$?" == "0" ];then 7 if [ "$?" == "0" ];then
8 echo "opp service install success!" 8 echo "opp service install success!"
@@ -16,7 +16,7 @@ if [ "$?" == "1" ];then @@ -16,7 +16,7 @@ if [ "$?" == "1" ];then
16 echo "opp deployment install fail!" 16 echo "opp deployment install fail!"
17 fi 17 fi
18 else 18 else
19 - kubectl delete -f /tmp/test/opp/opp.yaml 19 + kubectl delete -f /tmp/test/mmm-go-opp/opp.yaml
20 kubectl -n mmm-suplus-test get svc | grep -q opp 20 kubectl -n mmm-suplus-test get svc | grep -q opp
21 while [ "$?" == "0" ] 21 while [ "$?" == "0" ]
22 do 22 do
@@ -27,7 +27,7 @@ else @@ -27,7 +27,7 @@ else
27 do 27 do
28 kubectl -n mmm-suplus-test get pods | grep -q opp 28 kubectl -n mmm-suplus-test get pods | grep -q opp
29 done 29 done
30 - kubectl create -f /tmp/test/opp/opp.yaml --record 30 + kubectl create -f /tmp/test/mmm-go-opp/opp.yaml --record
31 kubectl -n mmm-suplus-test get svc | grep -q opp 31 kubectl -n mmm-suplus-test get svc | grep -q opp
32 if [ "$?" == "0" ];then 32 if [ "$?" == "0" ];then
33 echo "opp service update success!" 33 echo "opp service update success!"
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-test 5 namespace: mmm-suplus-test
6 labels: 6 labels:
7 - k8s-app: opp 7 + k8s-app: mmmopp
8 spec: 8 spec:
9 ports: 9 ports:
10 - - name: "http"  
11 - port: 80  
12 - targetPort: 8082 10 + - name: "http"
  11 + port: 80
  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-test 20 namespace: mmm-suplus-test
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,54 +43,60 @@ spec: @@ -43,54 +43,60 @@ 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:test  
48 - imagePullPolicy: Always  
49 - ports:  
50 - - containerPort: 8082  
51 - volumeMounts:  
52 - - mountPath: /opt/logs  
53 - name: accesslogs  
54 - env:  
55 - - name: ENTERPRISE_SERVICE_HOST  
56 - valueFrom:  
57 - configMapKeyRef:  
58 - name: suplus-config  
59 - key: service.enterprise  
60 - - name: MYSQL_HOST  
61 - valueFrom:  
62 - configMapKeyRef:  
63 - name: suplus-config  
64 - key: mysql.host  
65 - - name: MYSQL_PORT  
66 - valueFrom:  
67 - configMapKeyRef:  
68 - name: suplus-config  
69 - key: mysql.port  
70 - - name: MYSQL_USER  
71 - valueFrom:  
72 - configMapKeyRef:  
73 - name: suplus-config  
74 - key: mysql.user  
75 - - name: MYSQL_PASSWORD  
76 - valueFrom:  
77 - configMapKeyRef:  
78 - name: suplus-config  
79 - key: mysql.password  
80 - - name: MYSQL_DB_NAME  
81 - value: "opp_test"  
82 - - name: LOG_LEVEL  
83 - value: "debug"  
84 - - name: ERROR_BASE_CODE  
85 - value: "9"  
86 - - name: ERROR_BASE_CODE_MULTIPLE  
87 - value: "1000"  
88 - - name: RUN_MODE  
89 - value: "prod"  
90 - - name: aliyun_logs_suplus  
91 - value: "stdout"  
92 - - name: aliyun_logs_access  
93 - value: "/opt/logs/app.log" 46 + - name: mmmopp
  47 + image: 192.168.0.243:5000/mmm/mmmopp:dev
  48 + imagePullPolicy: Always
  49 + volumeMounts:
  50 + - mountPath: /opt/logs
  51 + name: accesslogs
  52 + - mountPath: /var/www/opp-test/file
  53 + name: mmmjihuitest-pvc1
  54 + ports:
  55 + - containerPort: 8080
  56 + env:
  57 + - name: MYSQL_HOST
  58 + valueFrom:
  59 + configMapKeyRef:
  60 + name: suplus-config
  61 + key: mysql.host
  62 + - name: MYSQL_PORT
  63 + valueFrom:
  64 + configMapKeyRef:
  65 + name: suplus-config
  66 + key: mysql.port
  67 + - name: REDIS_HOST
  68 + valueFrom:
  69 + configMapKeyRef:
  70 + name: suplus-config
  71 + key: redis.ip
  72 + - name: REDIS_PORT
  73 + valueFrom:
  74 + configMapKeyRef:
  75 + name: suplus-config
  76 + key: redis.port
  77 + - name: MYSQL_USER
  78 + valueFrom:
  79 + configMapKeyRef:
  80 + name: suplus-config
  81 + key: mysql.user
  82 + - name: MYSQL_PASSWORD
  83 + valueFrom:
  84 + configMapKeyRef:
  85 + name: suplus-config
  86 + key: mysql.password
  87 + - name: MYSQL_DB_NAME
  88 + value: "opportunity_test"
  89 + - name: RUN_MODE
  90 + value: "test"
  91 + - name: LOG_LEVEL
  92 + value: "debug"
  93 + - name: aliyun_logs_suplusfile
  94 + value: "stdout"
  95 + - name: aliyun_logs_access
  96 + value: " /opt/logs/app.log"
94 volumes: 97 volumes:
95 - - name: accesslogs  
96 - emptyDir: {}  
  98 + - name: accesslogs
  99 + emptyDir: {}
  100 + - name: mmmjihuitest-pvc1
  101 + persistentVolumeClaim:
  102 + claimName: mmmjihuitest-pvc