deploy.yaml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ---
  2. apiVersion: apps.kruise.io/v1beta1
  3. #apiVersion: apps/v1
  4. kind: StatefulSet
  5. metadata:
  6. name: global-book-api
  7. namespace: book-api
  8. labels:
  9. app: global-book-api
  10. spec:
  11. serviceName: global-book-api
  12. replicas: 2
  13. selector:
  14. matchLabels:
  15. app: global-book-api
  16. template:
  17. metadata:
  18. labels:
  19. app: global-book-api
  20. spec:
  21. hostNetwork: true
  22. #nodeSelector:
  23. # app: book-api-rs
  24. readinessGates:
  25. - conditionType: InPlaceUpdateReady
  26. terminationGracePeriodSeconds: 30
  27. dnsPolicy: "None"
  28. dnsConfig:
  29. nameservers:
  30. - 223.5.5.5
  31. - 10.26.22.50
  32. searches:
  33. - pro.svc.cluster.local
  34. - svc.cluster.local
  35. - cluster.local
  36. options:
  37. - name: ndots
  38. value: "5"
  39. initContainers:
  40. - name: init
  41. image: hub.evbj.easou.com/dev/busybox
  42. command: ['sh', "-c", 'chmod 777 -R /data && mkdir -p /data/project && mkdir -p /data/log']
  43. imagePullPolicy: IfNotPresent
  44. volumeMounts:
  45. - name: volume
  46. mountPath: /data
  47. - name: init-package
  48. image: hub.evbj.easou.com/dev/busybox
  49. command: ['sh', '-c', 'rm -rf /data/project/* && wget http://10.40.20.61/release/app-web/prod-64/novelapi/3.1.308/novelapi_3.1.308_duanJuAppDev_B3.1.307-186791_3.1.308_20230811-150904_RBL/ROOT.war -O /data/project/ROOT.war && md5sum /data/project/ROOT.war']
  50. imagePullPolicy: IfNotPresent
  51. volumeMounts:
  52. - name: volume
  53. mountPath: /data
  54. containers:
  55. - name: global-book-api
  56. image: hub.evbj.easou.com/dev/book-api:v3.1base
  57. imagePullPolicy: Always
  58. ports:
  59. - containerPort: 8080
  60. name: port
  61. lifecycle:
  62. preStop:
  63. exec:
  64. command: ["/bin/sh","-c","supervisorctl stop all"]
  65. volumeMounts:
  66. - name: volume
  67. mountPath: /data
  68. livenessProbe:
  69. tcpSocket:
  70. port: 8080
  71. initialDelaySeconds: 45
  72. periodSeconds: 15
  73. readinessProbe:
  74. tcpSocket:
  75. port: 8080
  76. initialDelaySeconds: 45
  77. periodSeconds: 15
  78. - name: book-api-nginx
  79. image: hub.evbj.easou.com/pro/book-api-nginx:v1.0.2
  80. imagePullPolicy: IfNotPresent
  81. ports:
  82. - containerPort: 80
  83. name: port
  84. lifecycle:
  85. preStop:
  86. exec:
  87. command: ["/bin/sh","-c","supervisorctl stop all"]
  88. volumeMounts:
  89. - name: volume
  90. mountPath: /data
  91. livenessProbe:
  92. tcpSocket:
  93. port: 80
  94. initialDelaySeconds: 45
  95. periodSeconds: 15
  96. readinessProbe:
  97. tcpSocket:
  98. port: 80
  99. initialDelaySeconds: 45
  100. periodSeconds: 15
  101. - name: book-api-flume
  102. image: hub.evbj.easou.com/dev/book-api-flume:v1.0.1
  103. imagePullPolicy: IfNotPresent
  104. lifecycle:
  105. preStop:
  106. exec:
  107. command: ["/bin/sh","-c","supervisorctl stop all"]
  108. volumeMounts:
  109. - name: volume
  110. mountPath: /data
  111. updateStrategy:
  112. type: RollingUpdate
  113. rollingUpdate:
  114. podUpdatePolicy: InPlaceIfPossible
  115. inPlaceUpdateStrategy:
  116. gracePeriodSeconds: 10
  117. volumeClaimTemplates:
  118. - metadata:
  119. name: volume
  120. spec:
  121. accessModes: ["ReadWriteOnce"]
  122. storageClassName: rbd
  123. resources:
  124. requests:
  125. storage: 200Gi
  126. ---
  127. apiVersion: v1
  128. kind: Service
  129. metadata:
  130. name: global-book-api-svc
  131. namespace: book-api
  132. labels:
  133. app: global-book-api-svc
  134. spec:
  135. type: NodePort
  136. ports:
  137. - port: 80
  138. targetPort: 80
  139. nodePort: 31022
  140. selector:
  141. app: global-book-api
  142. ---
  143. kind: Ingress
  144. apiVersion: networking.k8s.io/v1
  145. metadata:
  146. name: global-book-api
  147. namespace: book-api
  148. spec:
  149. tls:
  150. - hosts:
  151. - api.ieasou.cn
  152. secretName: global-book-api
  153. rules:
  154. - host: api.ieasou.cn
  155. http:
  156. paths:
  157. - path: /
  158. pathType: Prefix
  159. backend:
  160. service:
  161. name: global-book-api-svc
  162. port:
  163. number: 80
  164. ingressClassName: nginx