Use context: kubectl config use-context k8s-c1-H

Ssh into the controlplane node with ssh cluster1-controlplane1. Check how the controlplane components kubelet, kube-apiserver, kube-scheduler, kube-controller-manager and etcd are started/installed on the controlplane node. Also find out the name of the DNS application and how it's started/installed on the controlplane node.

Write your findings into file /opt/course/8/controlplane-components.txt. The file should be structured like:

# /opt/course/8/controlplane-components.txt
kubelet: [TYPE]
kube-apiserver: [TYPE]
kube-scheduler: [TYPE]
kube-controller-manager: [TYPE]
etcd: [TYPE]
dns: [TYPE] [NAME]

Choices of [TYPE] are: not-installed, process, static-pod, pod


译文:

用ssh cluster1-controlplane1登录控制板节点。检查控制板组件kubelet、kube-apiserver、kube-scheduler、kube-controller-manager和etcd是如何在控制板节点上启动/安装的。还要找出DNS应用程序的名称以及它是如何在控制平面节点上启动/安装的。

把你的发现写进文件/opt/course/8/controlplan-components.txt。该文件的结构应该是这样的。

# /opt/course/8/controlplane-components.txt
kubelet: [TYPE]
kube-apiserver: [TYPE]
kube-scheduler: [TYPE]
kube-controller-manager: [TYPE]
etcd: [TYPE]
dns: [TYPE] [NAME]

[TYPE] 为: not-installed, process, static-pod, pod


解答:
kubectl config use-context k8s-c1-H

检查kubelet

ssh cluster1-controlplane1
root@cluster1-controlplane1:~# ps aux | grep kubelet #显示kubelet进程

我们可以通过systemd查看哪些组件是通过systemd控制的

root@cluster1-controlplane1:~# find /etc/systemd/system/ | grep kube

file

这个集群是用kubeadm设置的,所以我们在默认的清单目录中检查一下

root@cluster1-controlplane1:~# find /etc/kubernetes/manifests/

file 这意味着主要的4个控制板服务被设置为静态Pod。实际上,让我们检查一下在控制平面节点上的kube-system命名空间中运行的所有Pods,在这里我们看到了5个静态pod,后缀为-cluster1-controlplane1

kubectl -n kube-system get pod -o wide | grep controlplane1

file

检查dns

root@cluster1-controlplane1$ kubectl -n kube-system get ds,deploy

file

退出controlplane1远程, 编辑文件

# /opt/course/8/controlplane-components.txt
kubelet: process
kube-apiserver: static-pod
kube-scheduler: static-pod
kube-controller-manager: static-pod
etcd: static-pod
dns: pod coredns

file


Killer.sh CKA模拟题目 汇总