Hi team. I have a quick question. Setup a deployment with resource requests and . . .

maverick:
Hi team. I have a quick question.
Setup a deployment with resource requests and limits but the pod still shows the resources at the host level rather than what is provided in the pod manifest file:

➜  ~ k get deploy centos -oyaml  | egrep -A3  -iw 'requests:|limits:'
                  f:limits:
                    .: {}
                    f:cpu: {}
                    f:memory: {}
--
                  f:requests:
                    .: {}
                    f:cpu: {}
                    f:memory: {}
--
          limits:
            cpu: "2"
            memory: 2Gi
          requests:
            cpu: "1"
            memory: 1Gi
        terminationMessagePath: /dev/termination-log
➜  ~ k exec -it centos-696f5f8b86-ppl9c -- sh
sh-4.4# free -h
              total        used        free      shared  buff/cache   available
Mem:          7.6Gi       3.2Gi       320Mi       403Mi       4.1Gi       3.7Gi
Swap:            0B          0B          0B
sh-4.4# lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              16
On-line CPU(s) list: 0-15
Thread(s) per core:  1
Core(s) per socket:  2
Socket(s):           8
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          15
Model:               6
Model name:          Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz
Stepping:            1
CPU MHz:             2499.996
BogoMIPS:            4999.99
Hypervisor vendor:   KVM
Virtualization type: full
L1d cache:           32K
L1i cache:           32K
L2 cache:            4096K
L3 cache:            16384K
NUMA node0 CPU(s):   0-15
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm invpcid_single ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat md_clear spec_ctrl intel_stibp

May I know why?

unnivkn:
@maverick Is there any securityContext: defined in your pod ?

unnivkn:
https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace/

unnivkn:

maverick:
@unnivkn - No. I do not have any SecurityContext defined in the pod.

unnivkn:
ok… good to know that

unnivkn:

image.png