adm_comp.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. ---
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: adm-comp
  6. labels:
  7. app: adm-comp
  8. spec:
  9. selector:
  10. app: adm-comp
  11. ports:
  12. - port: 80
  13. targetPort: 80
  14. name: server-port
  15. ---
  16. apiVersion: apps/v1
  17. kind: Deployment
  18. metadata:
  19. name: adm-comp
  20. spec:
  21. replicas: 1
  22. selector:
  23. matchLabels:
  24. app: adm-comp
  25. template:
  26. metadata:
  27. labels:
  28. app: adm-comp
  29. spec:
  30. containers:
  31. - name: adm-comp
  32. image: labisenlin.persagy.com/library/adm_comp:latest
  33. imagePullPolicy: Always
  34. ports:
  35. - containerPort: 80
  36. name: server-port
  37. resources:
  38. limits:
  39. memory: 1Gi
  40. requests:
  41. memory: 512Mi
  42. env:
  43. - name: TZ
  44. value: Asia/Shanghai
  45. - name: SERVER_PORT
  46. value: "80"
  47. volumeMounts:
  48. - name: config
  49. mountPath: /etc/nginx/nginx.conf
  50. subPath: path/to/nginx.conf.js
  51. volumes:
  52. - name: config
  53. configMap:
  54. name: public-config
  55. defaultMode: 0777
  56. items:
  57. - key: nginx.conf
  58. path: path/to/nginx.conf.js