deploy.yaml 2.8 KB

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