[英]minikube start - howto modify KubeletConfiguration passed to kubeadm?
I would like to set the value KubeletConfiguration.cpuCFSQuota = false
in the config.yaml
passed to kubeadm
when launching minikube
to turn off CPU resource checking, but I have not managed to find the options to do this through the documentation here https://minikube.sigs.k8s.io/docs/handbook/config/ .我想在启动minikube
以关闭 CPU 资源检查时在传递给kubeadm
的config.yaml
中设置值KubeletConfiguration.cpuCFSQuota = false
,但我没有设法通过此处的文档https://找到执行此操作的选项minikube.sigs.k8s.io/docs/handbook/config/ 。 The closest solution I have found is to use the option --extra-config=kubelet.cpu-cfs-quota=false
but the --cpu-cfs-quota
option for the kubelet
has been deprecated and no longer has an effect.我找到的最接近的解决方案是使用选项--extra-config=kubelet.cpu-cfs-quota=false
但kubelet
的--cpu-cfs-quota
选项已被弃用并且不再有效。
Any ideas appreciated.任何想法表示赞赏。
Environment:环境:
Thanks, Piers.谢谢,皮尔斯。
Using the --extra-config=kubelet.
使用--extra-config=kubelet.
flag alongside minikube start
is a good approach but you would also need to Set Kubelet parameters via a config file .与minikube start
一起标记是一个好方法,但您还需要通过配置文件设置 Kubelet 参数。
As you already noticed the --cpu-cfs-quota
flag:正如您已经注意到--cpu-cfs-quota
标志:
Enable CPU CFS quota enforcement for containers that specify CPU limits (DEPRECATED: This parameter should be set via the config file specified by the Kubelet's
--config
flag.为指定 CPU 限制的容器启用 CPU CFS 配额强制(已弃用:应通过 Kubelet 的--config
标志指定的配置文件设置此参数。
So you need to set that parameter by creating a kubelet
config file:因此,您需要通过创建kubelet
配置文件来设置该参数:
The configuration file must be a JSON or YAML representation of the parameters in this struct.配置文件必须是此结构中参数的 JSON 或 YAML 表示形式。 Make sure the Kubelet has read permissions on the file.确保 Kubelet 对该文件具有读取权限。
Here is an example of what this file might look like:以下是此文件的示例:
apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration evictionHard: memory.available: "200Mi"
Now you can use that config file to set cpuCFSQuota
= false
:现在您可以使用该配置文件来设置cpuCFSQuota
= false
:
// cpuCFSQuota enables CPU CFS quota enforcement for containers that
// specify CPU limits.
// Dynamic Kubelet Config (beta): If dynamically updating this field, consider that
// disabling it may reduce node stability.
// Default: true
// +optional`
CPUCFSQuota *bool `json:"cpuCFSQuota,omitempty"
and than call minikube with --extra-config=kubelet.config=/path/to/config.yaml
然后用--extra-config=kubelet.config=/path/to/config.yaml
Alternately, you can start your minikube without the --extra-config
flag and than start the Kubelet with the --config
flag set to the path of the Kubelet's config file.或者,您可以在没有--extra-config
标志的情况下启动您的 minikube,然后将--config
标志设置为 Kubelet 配置文件的路径来启动 Kubelet。 The Kubelet will then load its config from this file.然后 Kubelet 将从该文件加载其配置。
I know these are a few steps more than you expected but setting the kubelet parameters via a config file is the recommended approach because it simplifies node deployment and configuration management.我知道这些步骤比您预期的要多,但是通过配置文件设置 kubelet 参数是推荐的方法,因为它简化了节点部署和配置管理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.