deploy.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. ---
  2. #apiVersion: apps.kruise.io/v1beta1
  3. apiVersion: apps/v1
  4. kind: StatefulSet
  5. metadata:
  6. name: cptj
  7. namespace: bi
  8. labels:
  9. app: cptj
  10. spec:
  11. serviceName: cptj
  12. replicas: 1
  13. selector:
  14. matchLabels:
  15. app: cptj
  16. template:
  17. metadata:
  18. labels:
  19. app: cptj
  20. spec:
  21. hostNetwork: true
  22. terminationGracePeriodSeconds: 30
  23. dnsPolicy: "None"
  24. dnsConfig:
  25. nameservers:
  26. - 223.5.5.5
  27. - 10.108.30.101
  28. searches:
  29. - pro.svc.cluster.local
  30. - svc.cluster.local
  31. - cluster.local
  32. options:
  33. - name: ndots
  34. value: "5"
  35. initContainers:
  36. - name: init
  37. image: hub.evbj.easou.com/dev/busybox
  38. command: ['sh', "-c", 'chmod 777 -R /data/ && mkdir -p /data/webapps']
  39. imagePullPolicy: IfNotPresent
  40. volumeMounts:
  41. - name: volume
  42. mountPath: /data
  43. - name: init-package
  44. image: hub.evbj.easou.com/dev/busybox
  45. command: ['sh', '-c', 'rm -rf /data/webapps/* && wget http://10.40.20.61/release/search-wapage/prod-64/easoubi-bookcptj/1.0.34/easoubi-bookcptj_1.0.34_repairBug_T1.0.33-5932_1.0.34_20250326-172042_RBL/ROOT.war -O /data/webapps/ROOT.war && md5sum /data/webapps/ROOT.war']
  46. imagePullPolicy: IfNotPresent
  47. volumeMounts:
  48. - name: volume
  49. mountPath: /data
  50. containers:
  51. - name: cptj
  52. image: hub.evbj.easou.com/bi/cptj:v1base
  53. imagePullPolicy: Always
  54. ports:
  55. - containerPort: 8080
  56. name: port
  57. lifecycle:
  58. preStop:
  59. exec:
  60. command: ["/bin/sh","-c","supervisorctl stop all"]
  61. volumeMounts:
  62. - name: volume
  63. mountPath: /data
  64. livenessProbe:
  65. tcpSocket:
  66. port: 8080
  67. initialDelaySeconds: 60
  68. periodSeconds: 15
  69. readinessProbe:
  70. tcpSocket:
  71. port: 8080
  72. initialDelaySeconds: 60
  73. periodSeconds: 15
  74. volumeClaimTemplates:
  75. - metadata:
  76. name: volume
  77. spec:
  78. accessModes: ["ReadWriteOnce"]
  79. storageClassName: rbd
  80. resources:
  81. requests:
  82. storage: 200Gi
  83. ---
  84. apiVersion: v1
  85. kind: Service
  86. metadata:
  87. name: cptj-svc
  88. namespace: bi
  89. labels:
  90. app: cptj-svc
  91. spec:
  92. type: NodePort
  93. ports:
  94. - port: 8080
  95. targetPort: 8080
  96. nodePort: 30020
  97. selector:
  98. app: cptj
  99. ---
  100. apiVersion: networking.k8s.io/v1
  101. kind: Ingress
  102. metadata:
  103. name: cptj-ingress
  104. namespace: bi
  105. annotations:
  106. kubernetes.io/ingress.class: nginx
  107. nginx.ingress.kubernetes.io/affinity: cookie
  108. nginx.ingress.kubernetes.io/affinity-mode: persistent
  109. nginx.ingress.kubernetes.io/rewrite-target: /$2
  110. spec:
  111. rules:
  112. - host: bi-cptj.ieasou.cn
  113. http:
  114. paths:
  115. - path: /
  116. pathType: Prefix
  117. backend:
  118. service:
  119. name: cptj-svc
  120. port:
  121. number: 8080
  122. - host: bi-bookcptj.ieasou.cn
  123. http:
  124. paths:
  125. - path: /api(/|$)(.*)
  126. pathType: Prefix
  127. backend:
  128. service:
  129. name: cptj-svc
  130. port:
  131. number: 8080
  132. - host: bookcptj.appeasou.com
  133. http:
  134. paths:
  135. - path: /api(/|$)(.*)
  136. pathType: Prefix
  137. backend:
  138. service:
  139. name: cptj-svc
  140. port:
  141. number: 8080
  142. - host: bookcptj.easou.com
  143. http:
  144. paths:
  145. - path: /api(/|$)(.*)
  146. pathType: Prefix
  147. backend:
  148. service:
  149. name: cptj-svc
  150. port:
  151. number: 8080
  152. - host: bookcptj.wejuan.cn
  153. http:
  154. paths:
  155. - path: /api(/|$)(.*)
  156. pathType: Prefix
  157. backend:
  158. service:
  159. name: cptj-svc
  160. port:
  161. number: 8080
  162. ingressClassName: nginx