Last active
June 9, 2020 07:00
-
-
Save KramKroc/d0a03a40136a36c841a6c76fe6002c39 to your computer and use it in GitHub Desktop.
Playing with k8s envs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: dapi-envars-resourcefieldref-2 | |
spec: | |
containers: | |
- name: test-container-2 | |
image: k8s.gcr.io/busybox:1.24 | |
command: [ "sh", "-c"] | |
args: | |
- while true; do | |
echo -en '\n'; | |
printenv MY_CPU_REQUEST MY_CPU_LIMIT; | |
printenv MY_MEM_REQUEST MY_MEM_LIMIT; | |
sleep 10; | |
done; | |
resources: | |
requests: | |
memory: "16Mi" | |
cpu: "100m" | |
limits: | |
memory: "32Mi" | |
cpu: "125m" | |
env: | |
- name: MY_CPU_REQUEST | |
valueFrom: | |
resourceFieldRef: | |
containerName: test-container | |
resource: requests.cpu | |
- name: MY_CPU_LIMIT | |
valueFrom: | |
resourceFieldRef: | |
containerName: test-container | |
resource: limits.cpu | |
- name: MY_MEM_REQUEST | |
valueFrom: | |
resourceFieldRef: | |
containerName: test-container | |
resource: requests.memory | |
- name: MY_MEM_LIMIT | |
valueFrom: | |
resourceFieldRef: | |
containerName: test-container | |
resource: limits.memory | |
restartPolicy: Never |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment