deploy.yml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. namespace: {PROJECT_NAMESPACE}
  5. name: {PROJECT_NAME}
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: {PROJECT_NAME}
  10. replicas: 1
  11. template:
  12. metadata:
  13. namespace: {PROJECT_NAMESPACE}
  14. labels:
  15. app: {PROJECT_NAME}
  16. spec:
  17. containers:
  18. - name: {PROJECT_NAME}
  19. image: {PROJECT_IMAGE}
  20. imagePullPolicy: Always
  21. env:
  22. - name: SPRING_PROFILES_ACTIVE
  23. value: {PROJECT_ACTIVE}
  24. ports:
  25. - containerPort: {PROJECT_PORT}
  26. readinessProbe:
  27. tcpSocket:
  28. port: {PROJECT_PORT}
  29. initialDelaySeconds: 30
  30. periodSeconds: 10
  31. successThreshold: 1
  32. timeoutSeconds: 10
  33. failureThreshold: 3
  34. livenessProbe:
  35. tcpSocket:
  36. port: {PROJECT_PORT}
  37. initialDelaySeconds: 30
  38. periodSeconds: 10
  39. successThreshold: 1
  40. timeoutSeconds: 10
  41. failureThreshold: 3
  42. volumeMounts:
  43. - name: spring-log
  44. mountPath: /user/local/logs
  45. - name: host-time
  46. mountPath: /etc/localtime
  47. volumes:
  48. - name: host-time
  49. hostPath:
  50. path: "/etc/localtime"
  51. - name: spring-log
  52. persistentVolumeClaim:
  53. claimName: log-pvc
  54. ---
  55. #service
  56. apiVersion: v1
  57. kind: Service
  58. metadata:
  59. namespace: {PROJECT_NAMESPACE}
  60. name: {PROJECT_NAME}
  61. spec:
  62. ports:
  63. - port: {PROJECT_PORT}
  64. targetPort: {PROJECT_PORT}
  65. nodePort: {PROJECT_NODEPORT}
  66. type: NodePort
  67. selector:
  68. app: {PROJECT_NAME}