kubelet
[root@k8s-master1 k8s]# ls /etc/kubernetes/manifests/
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
[root@k8s-master1 k8s]#
静态pod
- 创建命令
- kubectl run static-pod --image=nginx --dry-run=client -o yaml > pod.yaml
- kubelet进行管理
- 不实用容器
- pod名称标示当前节点
重启静态pod
- /etc/kubernetes/manifests/ 配置文件
- 移走并移回 就能完成重启
list-watch
- 查看调度流程
- apiServer是中转站
- etcd是最终数据存储位置
影响pod调度中的因素
yaml
apiVersion: v1
kind: Pod
metadata:
name: resources-test-pod
spec:
containers:
- image: nginx
name: web
resources:
requests:
cpu: 0.4
memory: 500Mi
limits:
cpu: 0.4
memory: 500Mi
验证
- [root@k8s-master1 6]# kubectl describe pod resources-test-pod
- 查看cpu memroy 选项
验证二
- kubectl get pod -o wide
- kubectl describe node k8s-node2
Non-terminated Pods: (17 in total)
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits Age
--------- ---- ------------ ---------- --------------- ------------- ---
default init-demo 0 (0%) 0 (0%) 0 (0%) 0 (0%) 45h
default nginx-6799fc88d8-hn88v 0 (0%) 0 (0%) 0 (0%) 0 (0%) 2d
default pod-check-d59cbdb46-9w62f 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3d
default pod-check-d59cbdb46-g8qjf 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3d
default pod-check-d59cbdb46-k7j59 0 (0%) 0 (0%) 0 (0%) 0 (0%) 3d
default pod-envars 0 (0%) 0 (0%) 0 (0%) 0 (0%) 47h
default pod-net-test 0 (0%) 0 (0%) 0 (0%) 0 (0%) 6d
default pod-volume-test 0 (0%) 0 (0%) 0 (0%) 0 (0%) 5d23h
default resources-test-pod 400m (20%) 400m (20%) 500Mi (16%) 500Mi (16%) 10m
注意
|