deploy-tmp.yaml 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: offline-process-eavideo-charge-callback
  6. namespace: pro
  7. labels:
  8. app: offline-process-eavideo-charge-callback
  9. spec:
  10. serviceName: offline-process-eavideo-charge-callback
  11. replicas: 2
  12. selector:
  13. matchLabels:
  14. app: offline-process-eavideo-charge-callback
  15. template:
  16. metadata:
  17. labels:
  18. app: offline-process-eavideo-charge-callback
  19. spec:
  20. terminationGracePeriodSeconds: 30
  21. dnsPolicy: None
  22. dnsConfig:
  23. nameservers:
  24. - 223.5.5.5
  25. - 10.108.30.101
  26. - 10.26.22.50
  27. hostAliases:
  28. - ip: 10.40.23.25
  29. hostnames:
  30. - smtp.easou.cn
  31. initContainers:
  32. - name: init
  33. image: hub.evbj.easou.com/dev/busybox
  34. command: [ "chmod","777","-R","/data" ]
  35. imagePullPolicy: IfNotPresent
  36. volumeMounts:
  37. - name: volume
  38. mountPath: /data
  39. #nodeSelector:
  40. # app.touchrs: touchrs
  41. # affinity:
  42. # podAntiAffinity:
  43. # preferredDuringSchedulingIgnoredDuringExecution:
  44. # - weight: 100
  45. # podAffinityTerm:
  46. # labelSelector:
  47. # matchExpressions:
  48. # - key: app
  49. # operator: In
  50. # values:
  51. # - offline-process-eavideo-charge-callback
  52. # topologyKey: kubernetes.io/hostname
  53. containers:
  54. - name: offline-process-eavideo-charge-callback
  55. image: hub.evbj.easou.com/pro/offline-process-eavideo-charge-callback:r195825
  56. imagePullPolicy: IfNotPresent
  57. env:
  58. - name: MY_NODE_NAME
  59. valueFrom:
  60. fieldRef:
  61. fieldPath: spec.nodeName
  62. - name: MY_POD_IP
  63. valueFrom:
  64. fieldRef:
  65. fieldPath: status.podIP
  66. - name: MY_POD_NAME
  67. valueFrom:
  68. fieldRef:
  69. fieldPath: metadata.name
  70. - name: MY_POD_NAMESPACE
  71. valueFrom:
  72. fieldRef:
  73. fieldPath: metadata.namespace
  74. - name: JAVA_OPTS
  75. value: "-server -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=product"
  76. ports:
  77. - containerPort: 8080
  78. name: port
  79. - containerPort: 8001
  80. name: "jvm-debug"
  81. volumeMounts:
  82. - name: volume
  83. mountPath: /data
  84. lifecycle:
  85. preStop:
  86. exec:
  87. command: ["/bin/sh","-c","curl -H 'loginName:admin' -H 'password:ea1so2ua3dm4in5' -X POST 127.0.0.1:8080/actuator/shutdown"]
  88. livenessProbe:
  89. httpGet:
  90. path: /actuator/health
  91. port: 8080
  92. httpHeaders:
  93. - name: loginName
  94. value: admin
  95. - name: password
  96. value: ea1so2ua3dm4in5
  97. initialDelaySeconds: 40 #60s后启动第一次探测
  98. periodSeconds: 15 # 每隔10s启动一次探测
  99. timeoutSeconds: 3 # 超时时间3s
  100. successThreshold: 1 # 成功1次即表示容器健康
  101. failureThreshold: 5 # 连续5次失败,则判定容器不健康,默认3次
  102. readinessProbe:
  103. tcpSocket:
  104. port: 8080
  105. initialDelaySeconds: 40
  106. periodSeconds: 15
  107. # - image: hub.evbj.easou.com/pro/filebeat:7.13.3
  108. # imagePullPolicy: IfNotPresent
  109. # name: filebeat
  110. # volumeMounts:
  111. # - name: volume #日志同时挂载在nginx和filebeat中
  112. # mountPath: /data
  113. # - name: filebeat-config
  114. # mountPath: /usr/share/filebeat/filebeat.yml
  115. # subPath: filebeat.yml
  116. # volumes:
  117. # - name: filebeat-config
  118. # configMap:
  119. # name: filebeat-config-offline-process-eavideo-charge-callback
  120. # items:
  121. # - key: filebeat.yml
  122. # path: filebeat.yml
  123. volumeClaimTemplates:
  124. - metadata:
  125. name: volume
  126. spec:
  127. accessModes: [ "ReadWriteOnce" ]
  128. storageClassName: rbd
  129. resources:
  130. requests:
  131. storage: 100Gi
  132. ---
  133. apiVersion: v1
  134. kind: Service
  135. metadata:
  136. name: offline-process-eavideo-charge-callback-svc
  137. namespace: pro
  138. labels:
  139. app: offline-process-eavideo-charge-callback-svc
  140. spec:
  141. type: NodePort
  142. ports:
  143. - port: 80
  144. targetPort: 8080
  145. name: "main"
  146. selector:
  147. app: offline-process-eavideo-charge-callback
  148. ---
  149. apiVersion: networking.k8s.io/v1
  150. kind: Ingress
  151. metadata:
  152. name: offline-process-eavideo-charge-callback-ingress
  153. namespace: pro
  154. spec:
  155. rules:
  156. - host: zfapp-eashort.appeasou.com
  157. http:
  158. paths:
  159. - path: /
  160. pathType: Prefix
  161. backend:
  162. service:
  163. name: offline-process-eavideo-charge-callback-svc
  164. port:
  165. number: 8080
  166. ingressClassName: nginx
  167. ---
  168. apiVersion: v1
  169. kind: ConfigMap
  170. metadata:
  171. name: filebeat-config-offline-process-eavideo-charge-callback
  172. namespace: pro
  173. data:
  174. filebeat.yml: |
  175. filebeat.inputs:
  176. - type: log
  177. enabled: true
  178. #多行合并
  179. multiline.pattern: '^\[[0-9]{4}-[0-9]{2}-[0-9]{2}'
  180. multiline.negate: true
  181. multiline.match: after
  182. multiline.timeout: 30
  183. fields:
  184. log_topic: offline-process-eavideo-charge-callback
  185. fields_under_root: true
  186. paths:
  187. - "/data/logs/app/*.log"
  188. - "/data/logs/*.log"
  189. output.kafka:
  190. version: 2.0.0
  191. enable: true
  192. 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"]
  193. topic: 'offline-process-eavideo-topic'
  194. required_acks: 1
  195. partition.round_robin:
  196. reachable_only: false
  197. compression: gzip
  198. max_message_bytes: 1000000