浏览代码

deploy pro/offline-process-schedule:r180705 测试阿里云k8s集群部署

datard 2 年之前
父节点
当前提交
9034d480d9
共有 3 个文件被更改,包括 43 次插入52 次删除
  1. 3 5
      .drone.yml
  2. 37 42
      deploy-tmp.yaml
  3. 3 5
      drone.template.yml

+ 3 - 5
.drone.yml

@@ -15,7 +15,7 @@ steps:
    - git clone $DRONE_GIT_HTTP_URL .
    - git clone $DRONE_GIT_HTTP_URL .
 
 
 - name: deployment
 - name: deployment
-  image: hub.evbj.easou.com/dev/drone-agent:v2.0.0
+  image: hub.evbj.easou.com/dev/drone-agent:v3.0.1
   pull: always
   pull: always
   # privileged: true
   # privileged: true
   environment:
   environment:
@@ -23,7 +23,7 @@ steps:
     JNLP_REPLICAS: 1
     JNLP_REPLICAS: 1
     JNLP_TAG: r180705
     JNLP_TAG: r180705
     JNLP_VERSION: v1  # default v1, v2 for canary
     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_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
     JNLP_INGRESS: nginx
@@ -45,10 +45,8 @@ steps:
     - python3 /root/tools.py -b
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
     - python3 /root/tools.py -a
-    # 检查服务部署状态
-    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     # 添加dns解析记录,生成访问域名
-    - python3 /root/tools.py -d
+#    - python3 /root/tools.py -d
 
 
 - name: success
 - name: success
   image: hub.evbj.easou.com/dev/drone-wechat:20200622
   image: hub.evbj.easou.com/dev/drone-wechat:20200622

+ 37 - 42
deploy-tmp.yaml

@@ -18,19 +18,12 @@ spec:
         app: offline-process-schedule
         app: offline-process-schedule
     spec:
     spec:
       terminationGracePeriodSeconds: 180
       terminationGracePeriodSeconds: 180
-      dnsPolicy: "None"
+      dnsPolicy: ClusterFirstWithHostNet
       dnsConfig:
       dnsConfig:
         nameservers:
         nameservers:
           - 223.5.5.5
           - 223.5.5.5
           - 10.26.22.50
           - 10.26.22.50
           - 10.26.22.150
           - 10.26.22.150
-        searches:
-          - pro.svc.cluster.local
-          - svc.cluster.local
-          - cluster.local
-        options:
-          - name: ndots
-            value: "5"
       initContainers:
       initContainers:
         - name: init
         - name: init
           image: hub.evbj.easou.com/dev/busybox
           image: hub.evbj.easou.com/dev/busybox
@@ -41,18 +34,18 @@ spec:
               mountPath: /data
               mountPath: /data
       #nodeSelector:
       #nodeSelector:
       #  app.touchrs: touchrs
       #  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:
       containers:
         - name: offline-process-schedule
         - name: offline-process-schedule
           image: hub.evbj.easou.com/pro/offline-process-schedule:r180705
           image: hub.evbj.easou.com/pro/offline-process-schedule:r180705
@@ -107,29 +100,29 @@ spec:
               port: 8080
               port: 8080
             initialDelaySeconds: 40
             initialDelaySeconds: 40
             periodSeconds: 15
             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:
   volumeClaimTemplates:
     - metadata:
     - metadata:
         name: volume
         name: volume
       spec:
       spec:
         accessModes: [ "ReadWriteOnce" ]
         accessModes: [ "ReadWriteOnce" ]
-        storageClassName: rbd
+        storageClassName: ceph-block
         resources:
         resources:
           requests:
           requests:
             storage: 100Gi
             storage: 100Gi
@@ -150,22 +143,24 @@ spec:
   selector:
   selector:
     app: offline-process-schedule
     app: offline-process-schedule
 ---
 ---
-apiVersion: extensions/v1beta1
+apiVersion: networking.k8s.io/v1
 kind: Ingress
 kind: Ingress
 metadata:
 metadata:
   name: offline-process-schedule-ingress
   name: offline-process-schedule-ingress
   namespace: pro
   namespace: pro
-  annotations:
-    kubernetes.io/ingress.class: nginx
 spec:
 spec:
   rules:
   rules:
     - host: pro-offline-process-schedule.ieasou.cn
     - host: pro-offline-process-schedule.ieasou.cn
       http:
       http:
         paths:
         paths:
           - path: /
           - path: /
+            pathType: Prefix
             backend:
             backend:
-              serviceName: offline-process-schedule-svc
-              servicePort: 80
+              service:
+                name: offline-process-schedule-svc
+                port:
+                  number: 8080
+  ingressClassName: nginx
 ---
 ---
 apiVersion: v1
 apiVersion: v1
 kind: ConfigMap
 kind: ConfigMap

+ 3 - 5
drone.template.yml

@@ -15,7 +15,7 @@ steps:
    - git clone $DRONE_GIT_HTTP_URL .
    - git clone $DRONE_GIT_HTTP_URL .
 
 
 - name: deployment
 - name: deployment
-  image: hub.evbj.easou.com/dev/drone-agent:v2.0.0
+  image: hub.evbj.easou.com/dev/drone-agent:v3.0.1
   pull: always
   pull: always
   # privileged: true
   # privileged: true
   environment:
   environment:
@@ -23,7 +23,7 @@ steps:
     JNLP_REPLICAS: [REPLICA]
     JNLP_REPLICAS: [REPLICA]
     JNLP_TAG: [TAG]
     JNLP_TAG: [TAG]
     JNLP_VERSION: v1  # default v1, v2 for canary
     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_REPO: hub.evbj.easou.com
     JNLP_CONTAINER_PORT: 80
     JNLP_CONTAINER_PORT: 80
     JNLP_INGRESS: nginx
     JNLP_INGRESS: nginx
@@ -45,10 +45,8 @@ steps:
     - python3 /root/tools.py -b
     - python3 /root/tools.py -b
     # 部署服务到kubernetes上
     # 部署服务到kubernetes上
     - python3 /root/tools.py -a
     - python3 /root/tools.py -a
-    # 检查服务部署状态
-    - python3 /root/tools.py -c
     # 添加dns解析记录,生成访问域名
     # 添加dns解析记录,生成访问域名
-    - python3 /root/tools.py -d
+#    - python3 /root/tools.py -d
 
 
 - name: success
 - name: success
   image: hub.evbj.easou.com/dev/drone-wechat:20200622
   image: hub.evbj.easou.com/dev/drone-wechat:20200622