deploy.yaml 2.6 KB

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