kind: Pod
apiVersion: v1
metadata:
  name: downward-env
spec:
  containers:
    - name: printer
      image: busybox
      env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: SERVICE_ACCOUNT
          valueFrom:
            fieldRef:
              fieldPath: spec.serviceAccountName
        - name: CONTAINER_CPU_REQUEST_MILLICORES
          valueFrom:
            resourceFieldRef:
              resource: requests.cpu
              divisor: 1m
        - name: CONTAINER_MEMORY_REQUEST_MIBIBYTES
          valueFrom:
            resourceFieldRef:
              resource: requests.memory
              divisor: 1Mi
        - name: CONTAINER_CPU_LIMIT_MILLICORES
          valueFrom:
            resourceFieldRef:
              resource: limits.cpu
              divisor: 1m
        - name: CONTAINER_MEMORY_LIMIT_MIBIBYTES
          valueFrom:
            resourceFieldRef:
              resource: limits.memory
              divisor: 1Mi
      command: ["/bin/sh", "-c", "--", "while :; do sleep 1d; done"]
      resources:
        requests:
          cpu: 16m
          memory: 16Mi
        limits:
          cpu: 64m
          memory: 64Mi
  restartPolicy: Never
