Explorar el Código

deploy pro/offline-process-charge-callback:r181301 消费记录迁库

datard hace 2 años
padre
commit
73cf6c942a
Se han modificado 4 ficheros con 59 adiciones y 51 borrados
  1. 10 8
      .drone.yml
  2. 1 1
      Dockerfile
  3. 43 39
      deploy-tmp.yaml
  4. 5 3
      drone.template.yml

+ 10 - 8
.drone.yml

@@ -6,7 +6,7 @@ clone:
   disable: true
 
 metadata:
-  namespace: drone
+  namespace: ci
 
 steps:
 - name: clone
@@ -15,15 +15,15 @@ steps:
    - git clone $DRONE_GIT_HTTP_URL .
 
 - name: deployment
-  image: hub.evbj.easou.com/dev/drone-agent:v3.0.1
+  image: hub.evbj.easou.com/dev/drone-agent:v2.0.0
   pull: always
   # privileged: true
   environment:
     JNLP_ENV: pro
     JNLP_REPLICAS: 2
-    JNLP_TAG: r180714
+    JNLP_TAG: r181301
     JNLP_VERSION: v1  # default v1, v2 for canary
-    DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
+    DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
     JNLP_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
@@ -45,6 +45,8 @@ steps:
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
+    # 检查服务部署状态
+    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     - python3 /root/tools.py -d
 
@@ -54,8 +56,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline pro/offline-process-charge-callback:r180714 Success"
-    description: "${DRONE_BUILD_LINK} pro/offline-process-charge-callback:r180714 部署完成 测试阿里云k8s集群部署"
+    title: "Pipeline pro/offline-process-charge-callback:r181301 Success"
+    description: "${DRONE_BUILD_LINK} pro/offline-process-charge-callback:r181301 部署完成 消费记录迁库"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:
@@ -68,8 +70,8 @@ steps:
     corpid: ww419ee4063735e1c0
     corp_secret: zpiRBLETH9eLwIMQ4eJ_r_dcm3BPSGeLHvTcft8Ot-M
     agent_id: 1000004
-    title: "Pipeline pro/offline-process-charge-callback:r180714 Failure"
-    description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!测试阿里云k8s集群部署"
+    title: "Pipeline pro/offline-process-charge-callback:r181301 Failure"
+    description: "${DRONE_BUILD_LINK} 部署失败,请检查配置!消费记录迁库"
     msg_url: ${DRONE_BUILD_LINK}
     btn_txt: "否"
   when:

+ 1 - 1
Dockerfile

@@ -1 +1 @@
-FROM hub.evbj.easou.com/pro/offline-process-charge-callback:r180714
+FROM hub.evbj.easou.com/pro/offline-process-charge-callback:r181301

+ 43 - 39
deploy-tmp.yaml

@@ -18,12 +18,18 @@ spec:
         app: offline-process-charge-callback
     spec:
       terminationGracePeriodSeconds: 180
-      dnsPolicy: ClusterFirstWithHostNet
+      dnsPolicy: "None"
       dnsConfig:
         nameservers:
           - 223.5.5.5
           - 10.26.22.50
-          - 10.26.22.150
+        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
@@ -34,21 +40,21 @@ spec:
               mountPath: /data
       #nodeSelector:
       #  app.touchrs: touchrs
-#      affinity:
-#        podAntiAffinity:
-#          preferredDuringSchedulingIgnoredDuringExecution:
-#          - weight: 100
-#            podAffinityTerm:
-#              labelSelector:
-#                matchExpressions:
-#                - key: app
-#                  operator: In
-#                  values:
-#                  - offline-process-charge-callback
-#              topologyKey: kubernetes.io/hostname
+      affinity:
+        podAntiAffinity:
+          preferredDuringSchedulingIgnoredDuringExecution:
+          - weight: 100
+            podAffinityTerm:
+              labelSelector:
+                matchExpressions:
+                - key: app
+                  operator: In
+                  values:
+                  - offline-process-charge-callback
+              topologyKey: kubernetes.io/hostname
       containers:
         - name: offline-process-charge-callback
-          image: hub.evbj.easou.com/pro/offline-process-charge-callback:r180714
+          image: hub.evbj.easou.com/pro/offline-process-charge-callback:r181301
           imagePullPolicy: IfNotPresent
           env:
             - name: MY_NODE_NAME
@@ -100,29 +106,29 @@ 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-charge-callback
-#            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-charge-callback
+            items:
+              - key: filebeat.yml
+                path: filebeat.yml
 
   volumeClaimTemplates:
     - metadata:
         name: volume
       spec:
         accessModes: [ "ReadWriteOnce" ]
-        storageClassName: ceph-block
+        storageClassName: rbd
         resources:
           requests:
             storage: 100Gi
@@ -143,24 +149,22 @@ spec:
   selector:
     app: offline-process-charge-callback
 ---
-apiVersion: networking.k8s.io/v1
+apiVersion: extensions/v1beta1
 kind: Ingress
 metadata:
   name: offline-process-charge-callback-ingress
   namespace: pro
+  annotations:
+    kubernetes.io/ingress.class: nginx
 spec:
   rules:
     - host: pro-offline-process-charge-callback.ieasou.cn
       http:
         paths:
           - path: /
-            pathType: Prefix
             backend:
-              service:
-                name: offline-process-charge-callback-svc
-                port:
-                  number: 8080
-  ingressClassName: nginx
+              serviceName: offline-process-charge-callback-svc
+              servicePort: 80
 ---
 apiVersion: v1
 kind: ConfigMap

+ 5 - 3
drone.template.yml

@@ -6,7 +6,7 @@ clone:
   disable: true
 
 metadata:
-  namespace: drone
+  namespace: ci
 
 steps:
 - name: clone
@@ -15,7 +15,7 @@ steps:
    - git clone $DRONE_GIT_HTTP_URL .
 
 - name: deployment
-  image: hub.evbj.easou.com/dev/drone-agent:v3.0.1
+  image: hub.evbj.easou.com/dev/drone-agent:v2.0.0
   pull: always
   # privileged: true
   environment:
@@ -23,7 +23,7 @@ steps:
     JNLP_REPLICAS: [REPLICA]
     JNLP_TAG: [TAG]
     JNLP_VERSION: v1  # default v1, v2 for canary
-    DEPLOY_ENV: k8s-1 # 可以选择把应用部署到集群:k8s-1 or k8s-2
+    DEPLOY_ENV: k8s-2 # 可以选择把应用部署到集群:k8s-1 or k8s-2
     JNLP_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
@@ -45,6 +45,8 @@ steps:
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
+    # 检查服务部署状态
+    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     - python3 /root/tools.py -d