当前位置:网站首页>Static Pod, Pod Creation Process, Container Resource Limits
Static Pod, Pod Creation Process, Container Resource Limits
2022-08-01 08:02:00 【GottdesKrieges】
静态Pod
Static containers have the following characteristics:
- Pod由特定节点上的kubelet管理;
- 不能使用控制器;
- Pod名称标识当前节点名称.
在kubeletThe configuration file to enable staticPod的参数:
vi /var/lib/kubelet/config.yaml
...
staticPodPath: /etc/kubernetes/manifests
将部署的pod.yamlplaced in this directory will bekubelet自动创建.
K8S组件中除了kubeletOutside are running in the form of container.在K8SBefore the cluster is set up,Only by the above methodkubelet创建静态Pod.
MasterThe components deployed by the node areapi-server、controller-manager、scheduler和etcd;NodeThe components deployed by the node arekube-proxy、kubelet和docker.
[[email protected] ~]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
calico-kube-controllers-5c64b68895-kthkh 1/1 Running 4 (6h16m ago) 8d
calico-node-6mxfm 1/1 Running 4 (6h16m ago) 8d
calico-node-nzn8p 1/1 Running 150 (6h16m ago) 8d
calico-node-vg6s9 1/1 Running 4 (6h16m ago) 8d
coredns-6d8c4cb4d-k9245 1/1 Running 4 (6h16m ago) 8d
coredns-6d8c4cb4d-xzl49 1/1 Running 4 (6h16m ago) 8d
etcd-k8s-master 1/1 Running 4 (6h16m ago) 8d
kube-apiserver-k8s-master 1/1 Running 4 (6h16m ago) 8d
kube-controller-manager-k8s-master 1/1 Running 4 (6h16m ago) 8d
kube-proxy-58kfs 1/1 Running 5 (6h16m ago) 8d
kube-proxy-75z28 1/1 Running 4 (6h16m ago) 8d
kube-proxy-f9522 1/1 Running 4 (6h16m ago) 8d
kube-scheduler-k8s-master 1/1 Running 4 (6h16m ago) 8d
metrics-server-798c598bb8-j69cc 1/1 Running 3 (6h16m ago) 6d19h
[[email protected] ~]# kubectl get deploy -n kube-system
NAME READY UP-TO-DATE AVAILABLE AGE
calico-kube-controllers 1/1 1 1 8d
coredns 2/2 2 2 8d
metrics-server 1/1 1 1 6d19h
可以发现,etcd-k8s-master、kube-apiserver-k8s-master、kube-controller-manager-k8s-master、kube-scheduler-k8s-master都是以masterThe name of the node ends with,And there is no corresponding controller.
实际上,masterThese four components of the node are all generated by this nodekubelet直接管理的静态Pod部署.
[[email protected] ~]# grep staticPod /var/lib/kubelet/config.yaml
staticPodPath: /etc/kubernetes/manifests
[[email protected] ~]#
[[email protected] ~]# ls /etc/kubernetes/manifests/
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
Pod创建流程
k8s基于list-watch机制的控制器架构,实现组件间交互的解耦.其他组件监控自己负责的资源,当这些资源发生变化时,kube-apiserver会通知这些组件,这个过程类似于发布与订阅.
from the moment we issue the command,一个PodThe general process that is created is as follows:
- 所有使用
kubectlCommands issued are sent toapi-server,The latter after receiving the writtenetcd中. etcdWrite successfullyapi-serverReturn to write the message of success,否则会返回错误信息.api-serverNotify the schedulerscheduler把要创建的Pod分配到合适的节点上.schedulerChoose good after the target node,打上标记,and report the results toapi-server.api-server收到scheduler反馈的Pod-Node绑定信息后,将其写入etcd.api-server通知目标node节点上的kubelet组件创建Pod.- 目标节点上的
kubelet组件调用dockeror other container engines to create containers,and report the creation result information toapi-server. api-server将收到的PodCreate result information writeetcd.
Since creating a separatePodwill not use the controller,So the above process does not involvecontroller-manager.此外,也没有创建Service,So it doesn't involvekube-proxy组件.
容器资源限制
Use the following two properties to limit what the container can useCPU和内存资源的上限:
resources.limits.cpuresources.limits.memory
Set the minimum resource requirements used by the container through the following two properties(下限),作为容器调度时资源分配的依据:
resources.requests.cpuresources.requests.memory
k8s会根据requestsvalue to find nodes with enough available resources to schedulePod.
注意事项:
- When no resource limit is configured,The container can use all the resources of the node where it is located.
- limitsGenerally lower than the node configuration20%.
- requests的值必须小于limits,一般低于limits的20%到30%.
- 只设置limits限制时,requestsBy default alsolimits的值.
- requestsis a reserved resource,The actual resources used when the container is running may be less thanrequests.
- 如果requests配置过高,will result in node allocationPod过少,will lead to idle resources.
- 如果requests配置过低,will result in node allocationPod过多,Saturation may lead to resources.
- CPUThe unit of measure for resources is millicores,1核CPU=1000m,0.5=500m.
View the allocation of resources of the current node(Allocated resources):
kubectl describe node k8s-node1
边栏推荐
- 研发过程中的文档管理与工具
- 22牛客多校1 C.Grab the Seat (几何 + 暴力)
- 微信小程序请求封装
- What do the values 1, 2, and 3 in nodetype mean?
- POJ1287联网题解
- 2022.7.31-----leetcode.1161
- pytest接口自动化测试框架 | parametrize叠加使用
- HoloView -- Tabular Datasets
- How to use Photoshop to composite star trail photos, post-processing method of night sky star trail photos
- 好的plm软件有哪些?plm软件排行榜
猜你喜欢

SAP ABAP ALV+SMARTFORS 表分页 报表打印程序

【手撕AHB-APB Bridge】~ AHB地址总线的低两位为什么不用来表示地址呢?

LeetCode 415:字符串相加

Fist game copyright-free music download, League of Legends copyright-free music, can be used for video creation, live broadcast

VSCode插件推荐(Rust环境)

Case practice --- Resnet classic convolutional neural network (Mindspore)

Chapters 6 and 7 of Huawei Deep Learning Course

力扣周赛304 6135. 图中的最长环 内向基环树

leetcode-6132:使数组中所有元素都等于零

USB Protocol (2) Terminology
随机推荐
pytest接口自动化测试框架 | 跳过测试类
C语言学习概览(三)
mysql查看cpu使用情况
codeforces每日5题(均1600)-第二十七天
C语言学习概览(二)
搜索框字符自动补全
special day to remember
VSCode 快捷键及通用插件推荐
七夕来袭——属于程序员的浪漫
C语言学习概览(一)
Golang:go静态文件处理
最新的Cesium和Three的整合方法(附完整代码)
【ASWC Arxml结构分解】-7-Explicit(显式)和Implicit(隐式) Sender-Receiver communication描述差异
Go supports OOP: use struct instead of class
pytest接口自动化测试框架 | 使用函数返回值的形式传入参数值
HPC系统简介
小程序更多的手势事件(左右滑动、放大缩小、双击、长按)
HoloView--live data
特殊的日子,值得纪念
Golang: go open web service