[k8s]kubelet最佳实战

Posted 毛台

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[k8s]kubelet最佳实战相关的知识,希望对你有一定的参考价值。

简单的启动kubelet

kubelet     --api-servers=http://192.168.14.132:8080

完善的启动kubelet

kubelet     --api-servers=http://192.168.14.132:8080     --pod-infra-container-image=kubeguide/pause-amd64:3.0     --allow-privileged=true     --kubelethostname-override=192.168.14.133     --logtostderr=false     --log-dir=/root/logs/     --v=2

查看node状态

参考:
https://k8smeetup.github.io/docs/concepts/architecture/nodes/

kubectl describe node

查看cadvisor(kubelet自带)

http://192.168.14.133:4194

状态观察

参考:
https://k8smeetup.github.io/docs/concepts/architecture/nodes/

  • 50s容器由exit状态到删掉
kubectl delete -f busybox.yaml  #50s容器由exit状态到删掉
  • 5min节点好像由不可用到删除
kube-controller-manager一个参数:根据节点状态删除.
# The grace period for deleting pods on failed nodes. (default 5m0s)5分钟
--pod-eviction-timeout duration

Ready 条件处于状态 “Unknown” 或者 “False” 的时间超过了 pod-eviction-timeout(一个传递给 kube-controller-manager 的参数),node 上的所有 Pods 都会被 Node 控制器计划删除。默认的删除超时时长为5分钟。

kubelet报错但是没解决的-据说是1.7版本的bug.我是1.7.10

W1122 15:49:22.233484   71196 helpers.go:793] eviction manager: no observation found for eviction signal allocatableNodeFs.available
W1122 15:49:32.301474   71196 helpers.go:793] eviction manager: no observation found for eviction signal allocatableNodeFs.available
W1122 15:49:42.355303   71196 helpers.go:793] eviction manager: no observation found for eviction signal allocatableNodeFs.available
W1122 15:49:52.402125   71196 helpers.go:793] eviction manager: no observation found for eviction signal allocatableNodeFs.available

etcd报出问题--这个是etcd版本问题,不影响使用,我是yum install etcd搞的

[[email protected] yaml]# E1122 16:19:49.499797   57214 watcher.go:210] watch chan error: etcdserver: mvcc: required revision has been compacted
E1122 16:21:15.609115   57214 watcher.go:210] watch chan error: etcdserver: mvcc: required revision has been compacted

kubelet启动后会自动创建它的工作目录/var/lib/kubelet/

[[email protected] kubernetes]# tree /var/lib/kubelet/
/var/lib/kubelet/
├── plugins
└── pods
    ├── f56d5553-cf58-11e7-adbb-000c29154f03
    │?? ├── containers
    │?? │?? └── busybox
    │?? │??     └── 24bd58a0
    │?? ├── etc-hosts
    │?? ├── plugins
    │?? └── volumes
    ├── fffefc20-cf58-11e7-adbb-000c29154f03
    │?? ├── containers
    │?? │?? └── nginx
    │?? │??     └── 221a8328
    │?? ├── etc-hosts
    │?? ├── plugins
    │?? └── volumes
    ├── ffff1611-cf58-11e7-adbb-000c29154f03
    │?? ├── containers
    │?? │?? └── nginx
    │?? │??     └── d2d2f44d
    │?? ├── etc-hosts
    │?? ├── plugins
    │?? └── volumes
    └── ffff1ff8-cf58-11e7-adbb-000c29154f03
        ├── containers
        │?? └── nginx
        │??     └── bd101c6e
        ├── etc-hosts
        ├── plugins
        └── volumes

以上是关于[k8s]kubelet最佳实战的主要内容,如果未能解决你的问题,请参考以下文章

K8S 1.1.10 高可用环境搭建实战

k8s安装kubelet

k8s 启动kubelet时报错

[k8s]k8s的控制层kubelet+docker配合调度机制(k8架构)

浅谈K8S cni和网络方案

浅谈K8S cni和网络方案