Lab 4.2 - 4.3 What does setting the resource limits really change?
I have just completed chapter 4, but after doing the labs I am still confused about the actual impact on setting resource constraints. There is nothing shown about pods being evicted or node allocation or whatever this is actually for. If I set the limits or not, I will have the exact same impact when I deploy the hog application.
What is the actual impact of setting resource limits?
Answers
-
@vmayer At 4.2. you set limit in 1CPU and requested load in 2CPU as a result you can see just 100% (not 200% what is equal to 2CPU) of CPU usage via top. It means that limits work.:
limits: cpu: "1" memory: "4Gi" requests: cpu: "0.5" memory: "2500Mi" args: - -cpus - "2" - -mem-total - "950Mi" - -mem-alloc-size - "100Mi" - -mem-alloc-sleep - "1s"In Lab 4.3. you set limits via deployment manifest and via namespace, but because "Per-deployment settings override the global namespace settings" there is no limitations and we eat 950MB. But in case you remove per-deployment limitations new pod will not be able to start. E.g., do following:
kubectl delete -n low-usage-limit deployments.apps hog cp hog2.yaml hog3.yaml &&\ vim hog3.yaml
Remove following section and add
{}after resources:limits: cpu: "1" memory: "4Gi" requests: cpu: "0.5" memory: "2500Mi"Then:
kubectl create -f hog3.yaml
Monitor nodes load with
topand check the status of new pod withkubectl get pod -A. It will be killed every time it exceeds 500Mi limit set on namespace.1
Categories
- All Categories
- 179 LFX Mentorship
- 179 LFX Mentorship: Linux Kernel
- 776 Linux Foundation IT Professional Programs
- 384 Cloud Engineer IT Professional Program
- 175 Advanced Cloud Engineer IT Professional Program
- 76 DevOps IT Professional Program - Discontinued
- 7 DevOps & GitOps IT Professional Program
- 103 Cloud Native Developer IT Professional Program
- 7.7K Training Courses & Learning Paths
- 17 AI & ML Training
- 2 Blockchain & Decentralized Identity Training
- 47 Cloud & Containers Training
- 7 Cybersecurity Training
- 4 DevOps & Site-Reliability Training
- 3 Linux Kernel Development Training
- 3 Networking Training
- 2 Open Source Best Practice Training
- 6 System Administration Training
- 1 System Engineering Training
- 6 Web & Application Development Training
- 798 Hardware
- 202 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 173 Networking
- 91 Printers & Scanners
- 92 Storage
- 775 Linux Distributions
- 83 Debian
- 68 Fedora
- 24 Linux Mint
- 13 Mageia
- 24 openSUSE
- 151 Red Hat Enterprise
- 32 Slackware
- 13 SUSE Enterprise
- 356 Ubuntu
- 473 Linux System Administration
- 31 Cloud Computing
- 73 Command Line/Scripting
- Github systems admin projects
- 104 Linux Security
- 79 Network Management
- 102 System Management
- 46 Web Management
- 175 Mobile Computing
- 32 Android
- 128 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 407 Off Topic
- 128 Introductions
- 35 Study Material
- 1.1K Programming and Development
- 312 Kernel Development
- 730 Software Development
- 1K Software
- 421 Applications
- 183 Command Line
- 5 Compiling/Installing
- 71 Games
- 320 Installation
- Archived
- 183 Small Talk
- 2 LFD140 Class Forum
- 1.4K LFS258 Class Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)