dapi-pod-container-vars.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: dapi-pod-container-vars
  5. spec:
  6. containers:
  7. - name: busybox
  8. image: busybox
  9. command: ["sh", "-c"]
  10. args:
  11. - while true;do
  12. echo -en '\n';
  13. printenv MY_CPU_REQUEST MY_CPU_LIMIT;
  14. printenv MY_MEM_REQUEST MY_MEM_LIMIT;
  15. sleep 3600;
  16. done;
  17. resources:
  18. requests:
  19. memory: "32Mi"
  20. cpu: "125m"
  21. limits:
  22. memory: "64Mi"
  23. cpu: "250m"
  24. env:
  25. - name: MY_CPU_REQUEST
  26. valueFrom:
  27. resourceFieldRef:
  28. resource: requests.cpu
  29. containerName: busybox
  30. - name: MY_CPU_LIMIT
  31. valueFrom:
  32. resourceFieldRef:
  33. resource: limits.cpu
  34. containerName: busybox
  35. - name: MY_MEM_REQUEST
  36. valueFrom:
  37. resourceFieldRef:
  38. resource: requests.memory
  39. containerName: busybox
  40. - name: MY_MEM_LIMIT
  41. valueFrom:
  42. resourceFieldRef:
  43. resource: limits.memory
  44. containerName: busybox