码迷,mamicode.com
首页 > 其他好文 > 详细

修改kubelet启动参数

时间:2020-01-02 19:00:21      阅读:503      评论:0      收藏:0      [点我收藏+]

标签:ash   daemon   bin   ide   star   bec   from   note   Kubernete   

我是用kubeadm安装的k8s,现在通过Aqua扫描出相关配置问题,需要修改kubelet的启动参数;

默认配置文件名为:10-kubeadm.conf

#vim /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
# Note: This dropin only works with kubeadm and kubelet v1.11+
[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"
Environment="KUBE_ALLOW_PRIV=--allow-privileged=false"

# This is a file that "kubeadm init" and "kubeadm join" generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env
# This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use
# the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.
EnvironmentFile=-/etc/sysconfig/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS $KUBE_ALLOW_PRIV

 例如我添加了然后在ExecStart也需要加key:

KUBE_ALLOW_PRIV=--allow-privileged=false

加载配置文件重启kubelet

# systemctl stop kubelet
# systemctl daemon-reload
# systemctl start kubelet

  

修改kubelet启动参数

标签:ash   daemon   bin   ide   star   bec   from   note   Kubernete   

原文地址:https://www.cnblogs.com/Dev0ps/p/12133531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!