deploy-canary.yaml 4.1 KB

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