open.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: open
  5. spec:
  6. minReadySeconds: 5
  7. replicas: 1
  8. selector:
  9. matchLabels:
  10. k8s-app: open
  11. strategy:
  12. type: RollingUpdate
  13. rollingUpdate:
  14. maxSurge: 1
  15. template:
  16. metadata:
  17. labels:
  18. k8s-app: open
  19. spec:
  20. containers:
  21. - command: [ "java","-jar","/app.jar" ]
  22. env:
  23. - name: PATH
  24. value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  25. - name: TZ
  26. value: Asia/Shanghai
  27. image: { { image } }
  28. imagePullPolicy: IfNotPresent
  29. name: open
  30. resources:
  31. limits:
  32. cpu: 100m
  33. memory: 512Mi
  34. requests:
  35. cpu: 100m
  36. memory: 256Mi
  37. livenessProbe:
  38. httpGet:
  39. port: 80
  40. path: /hello
  41. initialDelaySeconds: 3
  42. periodSeconds: 30
  43. readinessProbe:
  44. httpGet:
  45. port: 80
  46. path: /hello
  47. initialDelaySeconds: 3
  48. periodSeconds: 5
  49. timeoutSeconds: 1
  50. dnsPolicy: ClusterFirst
  51. terminationGracePeriodSeconds: 30