deploy-tmp.yaml 4.1 KB

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