deploy.yaml 3.0 KB

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