gpt4 book ai didi

docker - 如何设置Kubernetes Kubelet的限制?

转载 作者:行者123 更新时间:2023-12-02 12:14:33 26 4
gpt4 key购买 nike

我正在使用具有1个主节点和2个具有4个核心cpu和256mb ram的worker的kubernetes集群。我想知道kubelet需要多少cpu和ram。

有什么方法可以设置kubelet的限制(cpu,内存)吗?我搜索了文档,但只发现了工作节点需求。

最佳答案

我认为您应该了解kubelet的作用。可以在kubelet documentation中找到。

The kubelet is the primary “node agent” that runs on each node. It can register the node with the apiserver using one of: the hostname; a flag to override the hostname; or specific logic for a cloud provider.

The kubelet works in terms of a PodSpec. A PodSpec is a YAML or JSON object that describes a pod. The kubelet takes a set of PodSpecs that are provided through various mechanisms (primarily through the apiserver) and ensures that the containers described in those PodSpecs are running and healthy. The kubelet doesn’t manage containers which were not created by Kubernetes.

Other than from an PodSpec from the apiserver, there are three ways that a container manifest can be provided to the Kubelet.

File: Path passed as a flag on the command line. Files under this path will be monitored periodically for updates. The monitoring period is 20s by default and is configurable via a flag.

HTTP endpoint: HTTP endpoint passed as a parameter on the command line. This endpoint is checked every 20 seconds (also configurable with a flag).

HTTP server: The kubelet can also listen for HTTP and respond to a simple API (underspec’d currently) to submit a new manifest.



您可以在kubelet中使用多个标志,但是它们大多是 已弃用,应通过Kubelet的--config标志指定的配置文件设置参数。这是在 Set Kubelet parameters via a config file上解释的。

您可能感兴趣的标志是:
--application-metrics-count-limit int

Max number of application metrics to store (per container) (default 100) (DEPRECATED)


--cpu-cfs-quota

Enable CPU CFS quota enforcement for containers that specify CPU limits (default true) (DEPRECATED)


--event-qps int32

If > 0, limit event creations per second to this value. If 0, unlimited. (default 5) (DEPRECATED)


--event-storage-age-limit string

Max length of time for which to store events (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is a duration. Default is applied to all non-specified event types (default "default=0") (DEPRECATED)


--event-storage-event-limit string

Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is an integer. Default is applied to all non-specified event types (default "default=0") (DEPRECATED)


--log-file-max-size uint

Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)


--pods-per-core int32

Number of Pods per core that can run on this Kubelet. The total number of Pods on this Kubelet cannot exceed max-pods, so max-pods will be used if this calculation results in a larger number of Pods allowed on the Kubelet. A value of 0 disables this limit. (DEPRECATED)


--registry-qps int32

If > 0, limit registry pull QPS to this value. If 0, unlimited. (default 5) (DEPRECATED)

关于docker - 如何设置Kubernetes Kubelet的限制?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58656768/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com