Welcome to the Linux Foundation Forum!

LAB 4.2

Hello,
All my nodes have 2CPU/4GBRAM.

The part of profile:
resources:
limits:
cpu: "1"
memory: "4Gi"
requests:
cpu: "0.5"
memory: "500Mi"
args:
- -cpus
- "2"
- -mem-total
- "8Gi"
- -mem-alloc-size
- "100Mi"
- -mem-alloc-sleep

- "1s"

kubectl get pod
NAME READY STATUS RESTARTS AGE
hog-6fdfd775fc-qj72d 1/1 Running 0 7s
alexey@master:~/LFS258/SOLUTIONS/s_04$ kubectl logs hog-6fdfd775fc-qj72d
I0209 10:15:05.376946 1 main.go:26] Allocating "8Gi" memory, in "100Mi" chunks, with a 1s sleep between allocations
I0209 10:15:05.377023 1 main.go:39] Spawning a thread to consume CPU
I0209 10:15:05.377039 1 main.go:39] Spawning a thread to consume CPU

It seems like it's Ok.

The profile from the lab works fine (task 9 and 10) too. Probably the profile for the task 9 is wrong because it works fine.

I tried to configure a lot of templates. It works! I cannot destroy the hog.

Any idea why or example how to perform this lab?

Alexey

Comments

  • Hi @AlexeyBY,

    Exceeding resource limits does not guarantee a container's termination and/or a pod's eviction. Memory and CPU limits are treated differently. While consuming more memory that the Limit may trigger an OOMKill, consuming more CPU than the Limit will not trigger a kill of the container.

    The documentation offers more details.

    Regards,
    -Chris

Categories

Upcoming Training