deploy-tmp.yaml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: realtime-yuewen-v2
  6. namespace: pro
  7. labels:
  8. app: realtime-yuewen-v2
  9. spec:
  10. serviceName: realtime-yuewen-v2
  11. replicas: 3
  12. selector:
  13. matchLabels:
  14. app: realtime-yuewen-v2
  15. template:
  16. metadata:
  17. labels:
  18. app: realtime-yuewen-v2
  19. spec:
  20. terminationGracePeriodSeconds: 30
  21. dnsPolicy: None
  22. dnsConfig:
  23. nameservers:
  24. - 10.108.30.101
  25. - 223.5.5.5
  26. initContainers:
  27. - name: init
  28. image: hub.evbj.easou.com/dev/busybox
  29. command: [ "chmod","777","-R","/data" ]
  30. imagePullPolicy: IfNotPresent
  31. volumeMounts:
  32. - name: volume
  33. mountPath: /data
  34. #nodeSelector:
  35. # app.touchrs: touchrs
  36. # affinity:
  37. # podAntiAffinity:
  38. # preferredDuringSchedulingIgnoredDuringExecution:
  39. # - weight: 100
  40. # podAffinityTerm:
  41. # labelSelector:
  42. # matchExpressions:
  43. # - key: app
  44. # operator: In
  45. # values:
  46. # - realtime-yuewen-v2
  47. # topologyKey: kubernetes.io/hostname
  48. containers:
  49. - name: realtime-yuewen-v2
  50. image: hub.evbj.easou.com/pro/realtime-yuewen-v2:r196126
  51. imagePullPolicy: IfNotPresent
  52. env:
  53. - name: MY_NODE_NAME
  54. valueFrom:
  55. fieldRef:
  56. fieldPath: spec.nodeName
  57. - name: MY_POD_IP
  58. valueFrom:
  59. fieldRef:
  60. fieldPath: status.podIP
  61. - name: MY_POD_NAME
  62. valueFrom:
  63. fieldRef:
  64. fieldPath: metadata.name
  65. - name: MY_POD_NAMESPACE
  66. valueFrom:
  67. fieldRef:
  68. fieldPath: metadata.namespace
  69. - name: JAVA_OPTS
  70. value: "-server -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=product"
  71. ports:
  72. - containerPort: 8080
  73. name: port
  74. - containerPort: 8001
  75. name: "jvm-debug"
  76. volumeMounts:
  77. - name: volume
  78. mountPath: /data
  79. lifecycle:
  80. preStop:
  81. exec:
  82. command: ["/bin/sh","-c","curl -H 'loginName:admin' -H 'password:ea1so2ua3dm4in5' -X POST 127.0.0.1:8080/actuator/shutdown"]
  83. # livenessProbe:
  84. # httpGet:
  85. # path: /actuator/health
  86. # port: 8080
  87. # httpHeaders:
  88. # - name: loginName
  89. # value: admin
  90. # - name: password
  91. # value: ea1so2ua3dm4in5
  92. # initialDelaySeconds: 10 #60s后启动第一次探测
  93. # periodSeconds: 10 # 每隔10s启动一次探测
  94. # timeoutSeconds: 3 # 超时时间3s
  95. # successThreshold: 1 # 成功1次即表示容器健康
  96. # failureThreshold: 2 # 连续5次失败,则判定容器不健康,默认3次
  97. readinessProbe:
  98. tcpSocket:
  99. port: 8080
  100. initialDelaySeconds: 40
  101. periodSeconds: 15
  102. - image: hub.evbj.easou.com/dev/flume:1.7.0-20230811
  103. imagePullPolicy: IfNotPresent
  104. name: flume
  105. volumeMounts:
  106. - name: volume #日志同时挂载在nginx和filebeat中
  107. mountPath: /data
  108. # - name: flume-config
  109. # mountPath: /app/soft/flume-1.7.0/conf/flume.conf
  110. # subPath: flume.conf
  111. volumes:
  112. - name: flume-config
  113. configMap:
  114. name: flume-config-realtime-yuewen-v2
  115. items:
  116. - key: flume.conf
  117. path: flume.conf
  118. volumeClaimTemplates:
  119. - metadata:
  120. name: volume
  121. spec:
  122. accessModes: [ "ReadWriteOnce" ]
  123. storageClassName: rbd
  124. resources:
  125. requests:
  126. storage: 100Gi
  127. ---
  128. apiVersion: v1
  129. kind: Service
  130. metadata:
  131. name: realtime-yuewen-v2-svc
  132. namespace: pro
  133. labels:
  134. app: realtime-yuewen-v2-svc
  135. spec:
  136. type: NodePort
  137. ports:
  138. - port: 80
  139. targetPort: 8080
  140. name: "main"
  141. selector:
  142. app: realtime-yuewen-v2
  143. ---
  144. apiVersion: v1
  145. kind: ConfigMap
  146. metadata:
  147. name: flume-config-realtime-yuewen-v2
  148. namespace: pro
  149. data:
  150. flume.conf: |
  151. a1.channels.c1.type = org.apache.flume.channel.kafka.KafkaChannel
  152. a1.channels.c1.kafka.bootstrap.servers = 10.26.27.71:8092,10.26.22.102:8092,10.26.22.120:8092,10.26.22.121:8092,10.26.22.122:8092
  153. a1.channels.c1.kafka.topic = yuewen_buydetail
  154. a1.channels.c1.kafka.consumer.group.id = flume2kafka
  155. # Define an Avro source called r1 on a1 and tell it
  156. # to bind to 0.0.0.0:41414. Connect it to channel c1.
  157. #注意这里分出2个channel出来,一个是到k1,一个到k2
  158. #如果这里只出一个channel c1的话,下面2个sink channel都为c1,则消息就会随机分到2个sink上,而不是2个sink都有一份
  159. a1.sources.r1.channels = c1
  160. a1.sources.r1.type = exec
  161. a1.sources.r1.command = tail -F /data/logs/app/access.log
  162. a1.sources.r1.restart = true
  163. a1.sources.r1.selector.optional = c1
  164. a1.sources.r1.batchSize = 100000
  165. a1.sources.r1.interceptors = i1 i2 i3
  166. a1.sources.r1.interceptors.i1.type = timestamp
  167. a1.sources.r1.interceptors.i2.type = host
  168. a1.sources.r1.interceptors.i2.useIP = false
  169. a1.sources.r1.interceptors.i3.type = regex_filter
  170. a1.sources.r1.interceptors.i3.regex = ^\\s*$
  171. a1.sources.r1.interceptors.i3.excludeEvents = true
  172. #默认是replicationg,还有multiplexer
  173. #a1.sources.r1.selector.type = replicationg
  174. # Finally, now that we've defined all of our components, tell
  175. # a1 which ones we want to activate.
  176. a1.sources = r1
  177. a1.channels = c1
  178. a1.sinks =