deploy-canary.yaml 3.1 KB

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