kubelet编译和输出日志
编译kubelet
yum install -y gcc
go env -w GO111MODULE="off"
cd $GOPATH/src/k8s.io/kubernetes/cmd/kubelet
go install -v
替换kubelet
systemctl stop kubelet.service
mv /usr/bin/kubelet /usr
mv $GOPATH/bin/kubelet /usr/bin
systemctl start kubelet.service
输出日志到指定文件
默认情况下,kubelet日志输出到系统日志/var/log/messages里面。
mkdir /var/log/kubelet
echo "KUBELET_EXTRA_ARGS=--fail-swap-on=false --log-dir=/var/log/kubelet --log-file=/var/log/kubelet/kubelet.log --v=5 --logtostderr=false" > /etc/sysconfig/kubelet
kill `pidof kubelet`