浏览代码

deploy qa/offline-process-promotion:v1.0.40 运行环境test

datard 3 年之前
父节点
当前提交
f58f544683
共有 3 个文件被更改,包括 69 次插入14 次删除
  1. 6 6
      .drone.yml
  2. 1 1
      Dockerfile
  3. 62 7
      deploy-tmp.yaml

+ 6 - 6
.drone.yml

@@ -23,9 +23,9 @@ steps:
     mirror: https://ci7pm4nx.mirror.aliyuncs.com
     registry: hub.evbj.easou.com
     repo: hub.evbj.easou.com/qa/offline-process-promotion
-    tag: v1.0.38
+    tag: v1.0.40
 #    build_args:
-#      - JAR_FILE=offline-process-charge-callback-test.jar
+#      - JAR_FILE=offline-process-promotion-test.jar
 #      - SERVER_PORT=8080
 
 - name: deployment
@@ -35,7 +35,7 @@ steps:
   environment:
     JNLP_ENV: qa
     JNLP_REPLICAS: 1
-    JNLP_TAG: v1.0.38
+    JNLP_TAG: v1.0.40
     JNLP_VERSION: v1  # default v1, v2 for canary
     DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
     JNLP_REPO: hub.evbj.easou.com
@@ -70,8 +70,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/offline-process-promotion:v1.0.38 Success"
-    description: "${DRONE_BUILD_LINK} qa/offline-process-promotion:v1.0.38 部署完成"
+    title: "Pipeline qa/offline-process-promotion:v1.0.40 Success"
+    description: "${DRONE_BUILD_LINK} qa/offline-process-promotion:v1.0.40 部署完成"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:
@@ -84,7 +84,7 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline qa/offline-process-promotion:v1.0.38 Failure"
+    title: "Pipeline qa/offline-process-promotion:v1.0.40 Failure"
     description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"

+ 1 - 1
Dockerfile

@@ -1 +1 @@
-FROM hub.evbj.easou.com/qa/offline-process-promotion:v1.0.38
+FROM hub.evbj.easou.com/qa/offline-process-promotion:v1.0.40

+ 62 - 7
deploy-tmp.yaml

@@ -30,7 +30,7 @@ spec:
       #  app.touchrs: touchrs
       containers:
         - name: offline-process-promotion
-          image: hub.evbj.easou.com/qa/offline-process-promotion:v1.0.38
+          image: hub.evbj.easou.com/qa/offline-process-promotion:v1.0.40
           imagePullPolicy: Always
           env:
             - name: JAVA_OPTS
@@ -46,16 +46,16 @@ spec:
           lifecycle:
             preStop:
               exec:
-                command: ["/bin/sh","-c","curl -u amdin:ea1so2ua3dm4in5 -X POST 127.0.0.1:8080/actuator/shutdown"]
+                command: ["/bin/sh","-c","curl -X POST 127.0.0.1:8080/actuator/shutdown"]
           livenessProbe:
             httpGet:
               path: /actuator/health
               port: 8080
               httpHeaders:
-              - name: Custom-Header
-                value: Awesome
-              - name: Custom-Header
-                value: Awesome
+                - name: Custom-Header
+                  value: Awesome
+                - name: Custom-Header
+                  value: Awesome
             initialDelaySeconds: 30        #60s后启动第一次探测
             periodSeconds: 10              # 每隔10s启动一次探测
             timeoutSeconds: 3              # 超时时间3s
@@ -66,6 +66,23 @@ spec:
               port: 8080
             initialDelaySeconds: 30
             periodSeconds: 15
+        - image: docker.elastic.co/beats/filebeat:6.8.12
+          imagePullPolicy: Always
+          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-promotion
+            items:
+              - key: filebeat.yml
+                path: filebeat.yml
+
   volumeClaimTemplates:
     - metadata:
         name: volume
@@ -107,4 +124,42 @@ spec:
           - path: /
             backend:
               serviceName: offline-process-promotion-svc
-              servicePort: 80
+              servicePort: 80
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: filebeat-config-offline-process-promotion
+  namespace: qa
+data:
+  filebeat.yml: |
+    filebeat.inputs:
+    - type: log
+      enabled: true
+      #多行合并
+      multiline.pattern: '^\[[0-9]{4}-[0-9]{2}-[0-9]{2}'
+      multiline.negate: true
+      multiline.match: after
+      multiline.timeout: 30
+      fields:
+          log_topic: offline-process-promotion
+      fields_under_root: true
+      paths:
+        - "/data/logs/app/*.log"
+        - "/data/logs/*.log"
+    setup.template.enabled: true
+    setup.template.name: offline-process-promotion
+    setup.template.pattern: offline-process-promotion*
+    setup.dashboards.enabled: true
+    output.kafka:
+      version: 0.10.2.1
+      enable: true
+      hosts: ["kafka-0.kafka-svc.qa.svc.cluster.local:9093", "kafka-1.kafka-svc.qa.svc.cluster.local:9093", "kafka-2.kafka-svc.qa.svc.cluster.local:9093"]
+      topic: 'offline-process-topic'
+      partition.round_robin:
+        reachable_only: false
+      required_acks: 0
+      compression: gzip
+      max_message_bytes: 1000000
+    setup.kibana:
+      host: 'qa-kibana.ieasou.cn:80'