deploy-canary.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. - 223.5.5.5
  31. initContainers:
  32. - name: init
  33. image: hub.evbj.easou.com/dev/busybox
  34. command: ['sh', "-c", 'chmod 777 -R /data && mkdir -p /data/project && mkdir -p /data/log']
  35. imagePullPolicy: IfNotPresent
  36. volumeMounts:
  37. - name: volume
  38. mountPath: /data
  39. - name: init-package
  40. image: hub.evbj.easou.com/dev/busybox
  41. command: ['sh', '-c', 'rm -rf /data/project/* && wget http://10.26.22.190/release/app-web/prod-64/esbookweb/1.5.415/esbookweb_1.5.415_exceptionHandling_T1.5.413-180117_1.5.415_20220915-171302_RBL/ROOT.war -O /data/project/ROOT.war']
  42. imagePullPolicy: IfNotPresent
  43. volumeMounts:
  44. - name: volume
  45. mountPath: /data
  46. containers:
  47. - name: book-webview-canary
  48. image: hub.evbj.easou.com/dev/book-webview:v3.1base
  49. imagePullPolicy: Always
  50. ports:
  51. - containerPort: 8080
  52. name: port
  53. volumeMounts:
  54. - name: volume
  55. mountPath: /data
  56. livenessProbe:
  57. tcpSocket:
  58. port: 8080
  59. initialDelaySeconds: 45
  60. periodSeconds: 15
  61. readinessProbe:
  62. tcpSocket:
  63. port: 8080
  64. initialDelaySeconds: 45
  65. periodSeconds: 15
  66. updateStrategy:
  67. type: RollingUpdate
  68. rollingUpdate:
  69. podUpdatePolicy: InPlaceIfPossible
  70. inPlaceUpdateStrategy:
  71. gracePeriodSeconds: 10
  72. volumeClaimTemplates:
  73. - metadata:
  74. name: volume
  75. spec:
  76. accessModes: ["ReadWriteOnce"]
  77. storageClassName: ceph-block
  78. resources:
  79. requests:
  80. storage: 200Gi
  81. ---
  82. apiVersion: v1
  83. kind: Service
  84. metadata:
  85. name: book-webview-canary-svc
  86. namespace: book-webview
  87. labels:
  88. app: book-webview-canary-svc
  89. spec:
  90. type: NodePort
  91. ports:
  92. - port: 8080
  93. targetPort: 8080
  94. nodePort: 30101
  95. selector:
  96. app: book-webview-canary
  97. ---
  98. #apiVersion: networking.k8s.io/v1
  99. #kind: Ingress
  100. #metadata:
  101. # name: book-webview-ingress
  102. # namespace: book-webview
  103. #spec:
  104. #tls:
  105. # - hosts:
  106. # - dev-book-webview.ieasou.cn
  107. # secretName: ieasou.cn
  108. # rules:
  109. # - host: book-webview-book-webview.ieasou.cn
  110. # http:
  111. # paths:
  112. # - path: /
  113. # pathType: Prefix
  114. # backend:
  115. # service:
  116. # name: book-webview-svc
  117. # port:
  118. # number: 8080
  119. # ingressClassName: nginx