k8s问题

作者: 全村滴希望 | 来源:发表于2022-05-23 22:04 被阅读0次

    kubelet启动不起来
    ···
    [root@k8s-node1 ~]# systemctl status kubelet
    ● kubelet.service - kubelet: The Kubernetes Node Agent
    Loaded: loaded (/etc/systemd/system/kubelet.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/kubelet.service.d
    └─10-kubeadm.conf
    Active: activating (auto-restart) (Result: exit-code) since Wed 2019-01-30 10:26:33 CST; 8s ago
    Docs: https://kubernetes.io/docs/
    Process: 9648 ExecStart=/usr/bin/kubelet KUBELET_KUBECONFIG_ARGSKUBELET_CONFIG_ARGS KUBELET_KUBEADM_ARGSKUBELET_EXTRA_ARGS (code=exited, status=255)
    Main PID: 9648 (code=exited, status=255)

    Jan 30 10:26:33 k8s-node1 systemd[1]: Unit kubelet.service entered failed state.
    Jan 30 10:26:33 k8s-node1 systemd[1]: kubelet.service failed.
    ···
    通过 journalctl -xefu kubelet 看到了
    ···
    -- The start-up result is done.
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: Flag --cgroup-driver has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: I0130 10:27:34.877299 9831 server.go:407] Version: v1.13.2
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: I0130 10:27:34.877538 9831 plugins.go:103] No cloud provider specified.
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: I0130 10:27:34.892361 9831 certificate_store.go:130] Loading cert/key pair from "/var/lib/kubelet/pki/kubelet-client-current.pem".
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: I0130 10:27:34.926248 9831 server.go:666] --cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /
    Jan 30 10:27:34 k8s-node1 kubelet[9831]: F0130 10:27:34.926665 9831 server.go:261] failed to run Kubelet: Running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false. /proc/swaps contained: [Filename Type Size Used Priority /swapfile file 2097148 0 -2]
    Jan 30 10:27:34 k8s-node1 systemd[1]: kubelet.service: main process exited, code=exited, status=255/n/a
    Jan 30 10:27:34 k8s-node1 systemd[1]: Unit kubelet.service entered failed state.
    Jan 30 10:27:34 k8s-node1 systemd[1]: kubelet.service failed.
    ···

    关闭Swap
    ···
    [root@k8s-node2 ~]# 关闭Swap,机器重启后不生效
    [root@k8s-node2 ~]# swapoff -a
    [root@k8s-node2 ~]# cp -p /etc/fstab /etc/fstab.bak$(date '+%Y%m%d%H%M%S')
    [root@k8s-node2 ~]# sed -i "s//dev/mapper/centos-swap/#/dev/mapper/centos-swap/g" /etc/fstab
    [root@k8s-node2 ~]# systemctl daemon-reload
    [root@k8s-node2 ~]# systemctl restart kubelet
    ···

    相关文章

      网友评论

          本文标题:k8s问题

          本文链接:https://www.haomeiwen.com/subject/ayhapktx.html