deploy-tmp-template.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. ---
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: [APP]
  6. namespace: [ENV]
  7. labels:
  8. app: [APP]
  9. spec:
  10. serviceName: [APP]
  11. replicas: [REPLICA]
  12. selector:
  13. matchLabels:
  14. app: [APP]
  15. template:
  16. metadata:
  17. labels:
  18. app: [APP]
  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: [APP]
  33. image: hub.evbj.easou.com/[ENV]/[APP]:[TAG]
  34. imagePullPolicy: Always
  35. env:
  36. - name: JAVA_OPTS
  37. value: "-server [DEBUG_OPTS] -Xmx2g -Xms2g -Xss512k -Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom -Dspring.profiles.active=[PROFILE]"
  38. ports:
  39. - containerPort: 8080
  40. name: port
  41. - containerPort: 8001
  42. name: "jvm-debug"
  43. volumeMounts:
  44. - name: volume
  45. mountPath: /data
  46. livenessProbe:
  47. tcpSocket:
  48. port: 8080
  49. initialDelaySeconds: 30
  50. periodSeconds: 15
  51. readinessProbe:
  52. tcpSocket:
  53. port: 8080
  54. initialDelaySeconds: 30
  55. periodSeconds: 15
  56. volumeClaimTemplates:
  57. - metadata:
  58. name: volume
  59. spec:
  60. accessModes: [ "ReadWriteOnce" ]
  61. storageClassName: rbd
  62. resources:
  63. requests:
  64. storage: 100Gi
  65. ---
  66. apiVersion: v1
  67. kind: Service
  68. metadata:
  69. name: [APP]-svc
  70. namespace: [ENV]
  71. labels:
  72. app: [APP]-svc
  73. spec:
  74. type: NodePort
  75. ports:
  76. - port: 80
  77. targetPort: 8080
  78. name: "main"
  79. selector:
  80. app: [APP]
  81. ---
  82. apiVersion: extensions/v1beta1
  83. kind: Ingress
  84. metadata:
  85. name: [APP]-ingress
  86. namespace: [ENV]
  87. annotations:
  88. kubernetes.io/ingress.class: nginx
  89. spec:
  90. rules:
  91. - host: [APP]-[ENV].ieasou.cn
  92. http:
  93. paths:
  94. - path: /
  95. backend:
  96. serviceName: [APP]-svc
  97. servicePort: 80