Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of pod configuration in K8S

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the example analysis of pod configuration in K8S, which is very detailed and has certain reference value. Friends who are interested must finish it!

I. introduction

There are two dimensional restrictions on running a container in Pod defined in K8s:

1. Resource requirements: that is, the node running Pod must meet the most basic requirements for running Pod in order to run Pod.

For example, Pod requires at least 2 gigabytes of memory and 1 core CPU

two。 Resource limit: that is, during the run of Pod, the possible memory usage will increase, so how much memory can be used at most, this is the resource limit.

II. Requests and Limits

Requests: even demand restrictions, also known as soft restrictions

Limits: maximum limit, also known as hard limit

Generally speaking: Limits > = Requests and requests and limits are usually configured together. If only requests is configured, but not limits, it is likely that Pod will eat all resources.

Third, resources in K8s

CPU

We know that the CPU of 2 cores and 2 threads can be recognized by the system as four logical CPU, and the allocation limit of CPU in K8s is limited to the fragmentation of logical CPU. In other words, assigning a CPU to the container is actually assigning a logical CPU. Moreover, a logical CPU can be divided into molecular units, that is, a logical CPU, and it can also be divided into 1000 millicore (millicores). In short, it is a logical CPU, which continues to be logically divided into 1000 cores.

Hao core: can be simply understood as the CPU time slice to do logical division, each time slice is a Hao core. So: 500m is the 500m core, that is, 0.5 logic CPU.

Memory

Usually these units are converted on the basis of 1000.

Ki, Mi,Gi,Ti, Pi, Ei: these are usually converted to 1024.

IV. Other matters needing attention

When requests is not set, the default is the same as limits.

When limits is not set, the default value is related to the cluster configuration.

You can use requests to set the minimum resources required by each container

Limits is used to limit the resources occupied by the runtime container and to limit the maximum CPU and memory utilization of the container.

When the memory requested by the container exceeds the limits, it will be terminated and restarted according to the restart policy.

The above is all the contents of the article "sample Analysis of pod configuration in K8S". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report