Przeglądaj źródła

deploy pro/offline-process-schedule:r187067 用户升级

pmrd 1 rok temu
rodzic
commit
3951f8ab37
4 zmienionych plików z 49 dodań i 60 usunięć
  1. 7 9
      .drone.yml
  2. 1 1
      Dockerfile
  3. 40 47
      deploy-tmp.yaml
  4. 1 3
      drone.template.yml

+ 7 - 9
.drone.yml

@@ -19,11 +19,11 @@ steps:
   pull: always
   # privileged: true
   environment:
-    JNLP_ENV: qa
+    JNLP_ENV: pro
     JNLP_REPLICAS: 1
-    JNLP_TAG: r185696
+    JNLP_TAG: r187067
     JNLP_VERSION: v1  # default v1, v2 for canary
-    DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
+    DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
     JNLP_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
@@ -45,8 +45,6 @@ steps:
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
-    # 检查服务部署状态
-    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     - python3 /root/tools.py -d
 
@@ -56,8 +54,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/offline-process-schedule:r185696 Success"
-    description: "${DRONE_BUILD_LINK} qa/offline-process-schedule:r185696 部署完成 谷歌支付k8s部署"
+    title: "Pipeline pro/offline-process-schedule:r187067 Success"
+    description: "${DRONE_BUILD_LINK} pro/offline-process-schedule:r187067 部署完成 用户升级"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:
@@ -70,8 +68,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/offline-process-schedule:r185696 Failure"
-    description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!谷歌支付k8s部署"
+    title: "Pipeline pro/offline-process-schedule:r187067 Failure"
+    description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!用户升级"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:

+ 1 - 1
Dockerfile

@@ -1 +1 @@
-FROM hub.evbj.easou.com/qa/offline-process-schedule:r185696
+FROM hub.evbj.easou.com/pro/offline-process-schedule:r187067

+ 40 - 47
deploy-tmp.yaml

@@ -3,7 +3,7 @@ apiVersion: apps/v1
 kind: StatefulSet
 metadata:
   name: offline-process-schedule
-  namespace: qa
+  namespace: pro
   labels:
     app: offline-process-schedule
 spec:
@@ -17,19 +17,12 @@ spec:
       labels:
         app: offline-process-schedule
     spec:
-      terminationGracePeriodSeconds: 180
-      dnsPolicy: "None"
+      terminationGracePeriodSeconds: 30
+      dnsPolicy: None
       dnsConfig:
         nameservers:
           - 223.5.5.5
           - 10.26.22.50
-        searches:
-          - pro.svc.cluster.local
-          - svc.cluster.local
-          - cluster.local
-        options:
-          - name: ndots
-            value: "5"
       initContainers:
         - name: init
           image: hub.evbj.easou.com/dev/busybox
@@ -40,21 +33,21 @@ spec:
               mountPath: /data
       #nodeSelector:
       #  app.touchrs: touchrs
-      affinity:
-        podAntiAffinity:
-          preferredDuringSchedulingIgnoredDuringExecution:
-          - weight: 100
-            podAffinityTerm:
-              labelSelector:
-                matchExpressions:
-                - key: app
-                  operator: In
-                  values:
-                  - offline-process-schedule
-              topologyKey: kubernetes.io/hostname
+#      affinity:
+#        podAntiAffinity:
+#          preferredDuringSchedulingIgnoredDuringExecution:
+#          - weight: 100
+#            podAffinityTerm:
+#              labelSelector:
+#                matchExpressions:
+#                - key: app
+#                  operator: In
+#                  values:
+#                  - offline-process-schedule
+#              topologyKey: kubernetes.io/hostname
       containers:
         - name: offline-process-schedule
-          image: hub.evbj.easou.com/qa/offline-process-schedule:r185696
+          image: hub.evbj.easou.com/pro/offline-process-schedule:r187067
           imagePullPolicy: IfNotPresent
           env:
             - name: MY_NODE_NAME
@@ -74,7 +67,7 @@ spec:
                 fieldRef:
                   fieldPath: metadata.namespace
             - name: JAVA_OPTS
-              value: "-server  -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n  -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=test"
+              value: "-server  -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=product"
           ports:
             - containerPort: 8080
               name: port
@@ -106,22 +99,22 @@ spec:
               port: 8080
             initialDelaySeconds: 40
             periodSeconds: 15
-        - image: hub.evbj.easou.com/pro/filebeat:7.13.3
-          imagePullPolicy: IfNotPresent
-          name: filebeat
-          volumeMounts:
-            - name: volume #日志同时挂载在nginx和filebeat中
-              mountPath: /data
-            - name: filebeat-config
-              mountPath: /usr/share/filebeat/filebeat.yml
-              subPath: filebeat.yml
-      volumes:
-        - name: filebeat-config
-          configMap:
-            name: filebeat-config-offline-process-schedule
-            items:
-              - key: filebeat.yml
-                path: filebeat.yml
+#        - image: hub.evbj.easou.com/pro/filebeat:7.13.3
+#          imagePullPolicy: IfNotPresent
+#          name: filebeat
+#          volumeMounts:
+#            - name: volume #日志同时挂载在nginx和filebeat中
+#              mountPath: /data
+#            - name: filebeat-config
+#              mountPath: /usr/share/filebeat/filebeat.yml
+#              subPath: filebeat.yml
+#      volumes:
+#        - name: filebeat-config
+#          configMap:
+#            name: filebeat-config-offline-process-schedule
+#            items:
+#              - key: filebeat.yml
+#                path: filebeat.yml
 
   volumeClaimTemplates:
     - metadata:
@@ -137,7 +130,7 @@ apiVersion: v1
 kind: Service
 metadata:
   name: offline-process-schedule-svc
-  namespace: qa
+  namespace: pro
   labels:
     app: offline-process-schedule-svc
 spec:
@@ -153,26 +146,26 @@ apiVersion: networking.k8s.io/v1
 kind: Ingress
 metadata:
   name: offline-process-schedule-ingress
-  namespace: qa
+  namespace: pro
 spec:
-  ingressClassName: nginx
   rules:
-    - host: qa-offline-process-schedule.ieasou.cn
+    - host: pro-offline-process-schedule.ieasou.cn
       http:
         paths:
           - path: /
-            pathType: ImplementationSpecific
+            pathType: Prefix
             backend:
               service:
                 name: offline-process-schedule-svc
                 port:
                   number: 8080
+  ingressClassName: nginx
 ---
 apiVersion: v1
 kind: ConfigMap
 metadata:
   name: filebeat-config-offline-process-schedule
-  namespace: qa
+  namespace: pro
 data:
   filebeat.yml: |
     filebeat.inputs:
@@ -192,7 +185,7 @@ data:
     output.kafka:
       version: 2.0.0
       enable: true
-      hosts: ["kafka-0.kafka-headless.qa.svc.cluster.local:9093", "kafka-1.kafka-headless.qa.svc.cluster.local:9093", "kafka-2.kafka-headless.qa.svc.cluster.local:9093"]
+      hosts: ["kafka-0.kafka-headless.pro.svc.cluster.local:9093", "kafka-1.kafka-headless.pro.svc.cluster.local:9093", "kafka-2.kafka-headless.pro.svc.cluster.local:9093"]
       topic: 'offline-process-topic'
       required_acks: 1
       partition.round_robin:

+ 1 - 3
drone.template.yml

@@ -23,7 +23,7 @@ steps:
     JNLP_REPLICAS: [REPLICA]
     JNLP_TAG: [TAG]
     JNLP_VERSION: v1  # default v1, v2 for canary
-    DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
+    DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
     JNLP_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
@@ -45,8 +45,6 @@ steps:
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
-    # 检查服务部署状态
-    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     - python3 /root/tools.py -d