apiVersion: v1
kind: Pod
metadata:
    name: dapi-volume-example-2
spec:
    containers:
        - name: client-ctr
          image: k8s.gcr.io/busybox:1.24
          command: ["sh", "-c"]
          args:
              - while true; do
                  echo -en '\n\n';
                  if [[ -e /etc/podinfo/cpu_limit  ]]; then
                    echo -en '\n';
                    cat /etc/podinfo/cpu_limit;
                  fi;
                  if [[ -e /etc/podinfo/cpu_request ]]; then
                    echo -en '\n';
                    cat /etc/podinfo/cpu_request;
                  fi;
                  if [[ -e /etc/podinfo/mem_limit ]]; then
                    echo -en '\n';
                    cat /etc/podinfo/mem_limit;
                  fi;
                  if [[ -e /etc/podinfo/mem_request ]]; then
                    echo -en '\n';
                    cat /etc/podinfo/mem_request;
                  fi;
                done;
          resources:
              requests:
                  memory: "32Mi"
                  cpu: "125m"
              limits:
                  memory: "64Mi"
                  cpu: "250m"
          volumeMounts:
              - name: podinfo
                mountPath: /etc/podinfo
                readOnly: false
    volumes:
        - name: podinfo
          downwardAPI:
              items:
                  - path: cpu_limit
                    resourceFieldRef:
                        containerName: client-ctr
                        resource: limits.cpu
                        divisor: 1m
                  - path: cpu_request
                    resourceFieldRef:
                        containerName: client-ctr
                        resource: requests.cpu
                        divisor: 1m
                  - path: mem_limit
                    resourceFieldRef:
                        containerName: client-ctr
                        resource: limits.memory
                        divisor: 1Mi
                  - path: mem_request
                    resourceFieldRef:
                        containerName: client-ctr
                        resource: requests.memory
                        divisor: 1Mi
