deploy.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. labels:
  5. app: yygh-site
  6. name: yygh-site
  7. namespace: his #一定要写名称空间
  8. spec:
  9. progressDeadlineSeconds: 600
  10. replicas: 1
  11. selector:
  12. matchLabels:
  13. app: yygh-site
  14. strategy:
  15. rollingUpdate:
  16. maxSurge: 50%
  17. maxUnavailable: 50%
  18. type: RollingUpdate
  19. template:
  20. metadata:
  21. labels:
  22. app: yygh-site
  23. spec:
  24. imagePullSecrets:
  25. - name: habor-docker-hub #提前在项目下配置访问阿里云的账号密码
  26. containers:
  27. - image: $REGISTRY/$DOCKERHUB_NAMESPACE/yygh-site:v$BUILD_NUMBER
  28. # readinessProbe:
  29. # httpGet:
  30. # path: /actuator/health
  31. # port: 8080
  32. # timeoutSeconds: 10
  33. # failureThreshold: 30
  34. # periodSeconds: 5
  35. imagePullPolicy: Always
  36. name: app
  37. ports:
  38. - containerPort: 3000
  39. protocol: TCP
  40. resources:
  41. limits:
  42. cpu: 300m
  43. memory: 600Mi
  44. terminationMessagePath: /dev/termination-log
  45. terminationMessagePolicy: File
  46. dnsPolicy: ClusterFirst
  47. restartPolicy: Always
  48. terminationGracePeriodSeconds: 30
  49. ---
  50. apiVersion: v1
  51. kind: Service
  52. metadata:
  53. labels:
  54. app: yygh-site
  55. name: yygh-site
  56. namespace: his
  57. spec:
  58. ports:
  59. - name: http
  60. port: 3000
  61. protocol: TCP
  62. targetPort: 3000
  63. nodePort: 32070
  64. selector:
  65. app: yygh-site
  66. sessionAffinity: None
  67. type: NodePort