deploy.yaml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. ---
  2. #apiVersion: apps.kruise.io/v1beta1
  3. apiVersion: apps/v1
  4. kind: StatefulSet
  5. metadata:
  6. name: bookcptj
  7. namespace: bi
  8. labels:
  9. app: bookcptj
  10. spec:
  11. serviceName: bookcptj
  12. replicas: 2
  13. selector:
  14. matchLabels:
  15. app: bookcptj
  16. template:
  17. metadata:
  18. labels:
  19. app: bookcptj
  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/bookcp/1.0.16/bookcp_1.0.16_addressChange_T1.0.15-5921_1.0.16_20250116-151014_RBL/bookcp-1.0.16-20250116151014.zip -O /data/webapps/bookcp.zip && cd /data/webapps;unzip bookcp.zip;mv dist ROOT && md5sum /data/webapps/bookcp.zip']
  46. imagePullPolicy: IfNotPresent
  47. volumeMounts:
  48. - name: volume
  49. mountPath: /data
  50. containers:
  51. - name: bookcptj
  52. image: hub.evbj.easou.com/bi/apptj: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: bookcptj-svc
  88. namespace: bi
  89. labels:
  90. app: bookcptj-svc
  91. spec:
  92. type: NodePort
  93. ports:
  94. - port: 8080
  95. targetPort: 8080
  96. nodePort: 30030
  97. selector:
  98. app: bookcptj
  99. ---
  100. apiVersion: networking.k8s.io/v1
  101. kind: Ingress
  102. metadata:
  103. name: bookcptj-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. spec:
  110. rules:
  111. - host: bi-bookcptj.ieasou.cn
  112. http:
  113. paths:
  114. - path: /
  115. pathType: Prefix
  116. backend:
  117. service:
  118. name: bookcptj-svc
  119. port:
  120. number: 8080
  121. - host: bookcptj.appeasou.com
  122. http:
  123. paths:
  124. - path: /
  125. pathType: Prefix
  126. backend:
  127. service:
  128. name: bookcptj-svc
  129. port:
  130. number: 8080
  131. - host: bookcptj.easou.com
  132. http:
  133. paths:
  134. - path: /
  135. pathType: Prefix
  136. backend:
  137. service:
  138. name: bookcptj-svc
  139. port:
  140. number: 8080
  141. - host: bookcptj.wejuan.cn
  142. http:
  143. paths:
  144. - path: /
  145. pathType: Prefix
  146. backend:
  147. service:
  148. name: bookcptj-svc
  149. port:
  150. number: 8080
  151. ingressClassName: nginx