deploy-tmp.yaml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: offline-process-charge-callback
  6. namespace: qa
  7. labels:
  8. app: offline-process-charge-callback
  9. spec:
  10. serviceName: offline-process-charge-callback
  11. replicas: 2
  12. selector:
  13. matchLabels:
  14. app: offline-process-charge-callback
  15. template:
  16. metadata:
  17. labels:
  18. app: offline-process-charge-callback
  19. spec:
  20. terminationGracePeriodSeconds: 60
  21. initContainers:
  22. - name: init
  23. image: hub.evbj.easou.com/dev/busybox
  24. command: [ "chmod","777","-R","/data" ]
  25. imagePullPolicy: Always
  26. volumeMounts:
  27. - name: volume
  28. mountPath: /data
  29. #nodeSelector:
  30. # app.touchrs: touchrs
  31. containers:
  32. - name: offline-process-charge-callback
  33. image: hub.evbj.easou.com/qa/offline-process-charge-callback:v1.0.32
  34. imagePullPolicy: Always
  35. env:
  36. - name: JAVA_OPTS
  37. value: "-server -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8001,suspend=n -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=test"
  38. ports:
  39. - containerPort: 8080
  40. name: port
  41. - containerPort: 8001
  42. name: "jvm-debug"
  43. volumeMounts:
  44. - name: volume
  45. mountPath: /data
  46. lifecycle:
  47. preStop:
  48. exec:
  49. command: ["/bin/sh","-c","curl -u amdin:ea1so2ua3dm4in5 -X POST 127.0.0.1:8080/actuator/shutdown"]
  50. livenessProbe:
  51. httpGet:
  52. path: /actuator/health
  53. port: 8080
  54. httpHeaders:
  55. - name: Custom-Header
  56. value: Awesome
  57. - name: Custom-Header
  58. value: Awesome
  59. initialDelaySeconds: 30 #60s后启动第一次探测
  60. periodSeconds: 10 # 每隔10s启动一次探测
  61. timeoutSeconds: 3 # 超时时间3s
  62. successThreshold: 1 # 成功1次即表示容器健康
  63. failureThreshold: 5 # 连续5次失败,则判定容器不健康,默认3次
  64. readinessProbe:
  65. tcpSocket:
  66. port: 8080
  67. initialDelaySeconds: 30
  68. periodSeconds: 15
  69. volumeClaimTemplates:
  70. - metadata:
  71. name: volume
  72. spec:
  73. accessModes: [ "ReadWriteOnce" ]
  74. storageClassName: rbd
  75. resources:
  76. requests:
  77. storage: 100Gi
  78. ---
  79. apiVersion: v1
  80. kind: Service
  81. metadata:
  82. name: offline-process-charge-callback-svc
  83. namespace: qa
  84. labels:
  85. app: offline-process-charge-callback-svc
  86. spec:
  87. type: NodePort
  88. ports:
  89. - port: 80
  90. targetPort: 8080
  91. name: "main"
  92. selector:
  93. app: offline-process-charge-callback
  94. ---
  95. apiVersion: extensions/v1beta1
  96. kind: Ingress
  97. metadata:
  98. name: offline-process-charge-callback-ingress
  99. namespace: qa
  100. annotations:
  101. kubernetes.io/ingress.class: nginx
  102. spec:
  103. rules:
  104. - host: qa-offline-process-charge-callback.ieasou.cn
  105. http:
  106. paths:
  107. - path: /
  108. backend:
  109. serviceName: offline-process-charge-callback-svc
  110. servicePort: 80