deploy-tmp.yaml 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ---
  2. apiVersion: v1
  3. kind: ConfigMap
  4. metadata:
  5. name: filebeat-config
  6. data:
  7. filebeat.yml: |
  8. filebeat.inputs:
  9. - type: log
  10. paths:
  11. - "/data/logs/app/all.log"
  12. setup.template.name: "filebeat"
  13. setup.template.pattern: "filebeat-*"
  14. output.elasticsearch:
  15. hosts: ["{{ .Values.elastricsearch.addr }}"]
  16. index: "frontend-filebeat"
  17. ---
  18. apiVersion: apps/v1
  19. kind: StatefulSet
  20. metadata:
  21. name: offline-process-charge
  22. namespace: qa
  23. labels:
  24. app: offline-process-charge
  25. spec:
  26. serviceName: offline-process-charge
  27. replicas: 1
  28. selector:
  29. matchLabels:
  30. app: offline-process-charge
  31. template:
  32. metadata:
  33. labels:
  34. app: offline-process-charge
  35. spec:
  36. terminationGracePeriodSeconds: 60
  37. initContainers:
  38. - name: init
  39. image: hub.evbj.easou.com/dev/busybox
  40. command: [ "chmod","777","-R","/data" ]
  41. imagePullPolicy: Always
  42. volumeMounts:
  43. - name: volume
  44. mountPath: /data
  45. #nodeSelector:
  46. # app.touchrs: touchrs
  47. containers:
  48. - name: offline-process-charge
  49. image: hub.evbj.easou.com/qa/offline-process-charge:v1.0.39
  50. imagePullPolicy: Always
  51. env:
  52. - name: JAVA_OPTS
  53. 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"
  54. ports:
  55. - containerPort: 8080
  56. name: port
  57. - containerPort: 8001
  58. name: "jvm-debug"
  59. volumeMounts:
  60. - name: volume
  61. mountPath: /data
  62. lifecycle:
  63. preStop:
  64. exec:
  65. command: ["/bin/sh","-c","curl -u amdin:ea1so2ua3dm4in5 -X POST 127.0.0.1:8080/actuator/shutdown"]
  66. livenessProbe:
  67. httpGet:
  68. path: /actuator/health
  69. port: 8080
  70. httpHeaders:
  71. - name: Custom-Header
  72. value: Awesome
  73. - name: Custom-Header
  74. value: Awesome
  75. initialDelaySeconds: 30 #60s后启动第一次探测
  76. periodSeconds: 10 # 每隔10s启动一次探测
  77. timeoutSeconds: 3 # 超时时间3s
  78. successThreshold: 1 # 成功1次即表示容器健康
  79. failureThreshold: 5 # 连续5次失败,则判定容器不健康,默认3次
  80. readinessProbe:
  81. tcpSocket:
  82. port: 8080
  83. initialDelaySeconds: 30
  84. periodSeconds: 15
  85. - image: docker.elastic.co/beats/filebeat:6.8.12
  86. imagePullPolicy: Always
  87. name: filebeat
  88. volumeMounts:
  89. - name: volume #日志同时挂载在nginx和filebeat中
  90. mountPath: /data
  91. - name: filebeat-config
  92. mountPath: /usr/share/filebeat/filebeat.yml
  93. subPath: filebeat.yml
  94. volumes:
  95. - name: filebeat-config
  96. configMap:
  97. name: filebeat-config
  98. items:
  99. - key: filebeat.yml
  100. path: filebeat.yml
  101. volumeClaimTemplates:
  102. - metadata:
  103. name: volume
  104. spec:
  105. accessModes: [ "ReadWriteOnce" ]
  106. storageClassName: rbd
  107. resources:
  108. requests:
  109. storage: 100Gi
  110. ---
  111. apiVersion: v1
  112. kind: Service
  113. metadata:
  114. name: offline-process-charge-svc
  115. namespace: qa
  116. labels:
  117. app: offline-process-charge-svc
  118. spec:
  119. type: NodePort
  120. ports:
  121. - port: 80
  122. targetPort: 8080
  123. name: "main"
  124. selector:
  125. app: offline-process-charge
  126. ---
  127. apiVersion: extensions/v1beta1
  128. kind: Ingress
  129. metadata:
  130. name: offline-process-charge-ingress
  131. namespace: qa
  132. annotations:
  133. kubernetes.io/ingress.class: nginx
  134. spec:
  135. rules:
  136. - host: qa-offline-process-charge.ieasou.cn
  137. http:
  138. paths:
  139. - path: /
  140. backend:
  141. serviceName: offline-process-charge-svc
  142. servicePort: 80