deploy.yaml 3.2 KB

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