deploy.yaml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. terminationGracePeriodSeconds: 180
  22. initContainers:
  23. - name: init
  24. image: $JNLP_REPO/dev/busybox
  25. command: ["chmod","777","-R","$JNLP_MOUNT_PATH"]
  26. imagePullPolicy: Always
  27. volumeMounts:
  28. - name: volume
  29. mountPath: /data
  30. containers:
  31. - name: book-api
  32. image: hub.evbj.easou.com/op/v3.0.0
  33. imagePullPolicy: Always
  34. ports:
  35. - containerPort: 8080
  36. name: port
  37. volumeMounts:
  38. - name: volume
  39. mountPath: /data
  40. livenessProbe:
  41. tcpSocket:
  42. port: 8080
  43. initialDelaySeconds: 45
  44. periodSeconds: 15
  45. readinessProbe:
  46. tcpSocket:
  47. port: 8080
  48. initialDelaySeconds: 45
  49. periodSeconds: 15
  50. updateStrategy:
  51. type: RollingUpdate
  52. rollingUpdate:
  53. podUpdatePolicy: InPlaceIfPossible
  54. inPlaceUpdateStrategy:
  55. gracePeriodSeconds: 10
  56. volumeClaimTemplates:
  57. - metadata:
  58. name: volume
  59. spec:
  60. accessModes: ["ReadWriteOnce"]
  61. storageClassName: ceph-block
  62. resources:
  63. requests:
  64. storage: 200Gi
  65. ---
  66. apiVersion: v1
  67. kind: Service
  68. metadata:
  69. name: book-api-svc
  70. namespace: dev
  71. labels:
  72. app: book-api-svc
  73. spec:
  74. type: NodePort
  75. ports:
  76. - port: 8080
  77. targetPort: 8080
  78. selector:
  79. app: book-api
  80. ---
  81. apiVersion: extensions/v1beta1
  82. kind: Ingress
  83. metadata:
  84. name: book-api-ingress
  85. namespace: dev
  86. annotations:
  87. kubernetes.io/ingress.class: nginx
  88. spec:
  89. rules:
  90. - host: dev-book-api.ieasou.cn
  91. http:
  92. paths:
  93. - path: /
  94. backend:
  95. serviceName: book-svc
  96. servicePort: 8080