deploy-canary.yaml 3.4 KB

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