CKA 模拟题库 | 17. 节点维护
发表于|更新于|kubernetesCKA
|总字数:126|阅读时长:1分钟|浏览量:
模拟题目
设置配置环境:
kubectl config use-context ek8s
Task
将名为 node02 的 node 设置为 不可用,并重新调度该 node 上所有运行的 pods。
参考
任务 –> 管理集群 –> 安全地清空一个节点
https://kubernetes.io/zh-cn/docs/tasks/administer-cluster/safely-drain-node/
解答
考试的时候务必记住切换集群, 注意集群名称 kubectl config use-context k8s
kubectl get nodes |
检查
kubectl get node |
文章作者: Hao
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
相关推荐

2023-01-09
CKA 模拟真题 Killer.sh | Question 13 | Multi Containers and Pod shared Volume
Task weight: 4% Use context: kubectl config use-context k8s-c1-H Create a Pod named multi-container-playground in Namespace default with three containers, named c1 , c2 and c3 . There should be a volume attached to that Pod and mounted into every container, but the volume shouldn’t be persisted or shared with other Pods. Container c1 should be of image nginx:1.17.6-alpine and have the name of the node where its Pod is running available as environment variable MY_NODE_NAME. Container c2 should...

2023-01-10
CKA 模拟真题 Killer.sh | Question 22 | Check how long certificates are valid
Task weight: 2% Use context: kubectl config use-context k8s-c2-AC Check how long the kube-apiserver server certificate is valid on cluster2-controlplane1 . Do this with openssl or cfssl. Write the exipiration date into /opt/course/22/expiration . Also run the correct kubeadm command to list the expiration dates and confirm both methods show the same date. Write the correct kubeadm command that would renew the apiserver server certificate into /opt/course/22/kubeadm-renew-certs.sh . 译文在 clust...

2023-01-09
CKA 模拟真题 Killer.sh | Question 1 | Contexts
Task weight: 1% You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl. Finally write a second command doing the same thing into /opt/course/1/context_default_no_kubectl.sh , but without the use of kubectl. 译文你可以通过 kubectl contexts 从你的主终端访问多个集群。把所有这些上下文的名字写进 /o...

2023-01-02
CKA 模拟题库 | 16. 排查集群中故障节点
模拟题目设置配置环境: kubectl config use-context wk8s Task名为 node02 的 Kubernetes worker node 处于 NotReady 状态。 调查发生这种情况的原因,并采取相应的措施将 node 恢复为 Ready 状态,确保所做的任何更改永久生效。可以使用以下命令,通过ssh连接到node02节点: ssh node02可以使用以下命令,在该节点上获取更高权限: sudo -i 参考检查服务https://kubernetes.io/zh-cn/docs/setup/production-environment/tools/kubeadm/kubelet-integration/ 解答 考试的时候务必记住切换集群, 注意集群名称 kubectl config use-context k8s 检查故障节点 kubectl get nodes 切换到故障节点 ssh node02sudo -i systemctl status kubeletsystemctl enable kubelet --now 检查...

2023-01-09
CKA 模拟真题 Killer.sh | Question 12 | Deployment on all Nodes
Use context: kubectl config use-context k8s-c1-H Use Namespace project-tiger for the following. Create a Deployment named deploy-important with label id=very-important (the Pods should also have this label) and 3 replicas. It should contain two containers, the first named container1 with image nginx:1.17.6-alpine and the second one named container2 with image kubernetes/pause . There should be only ever one Pod of that Deployment running on one worker node. We have two worker nodes: cluster1-...

2023-01-09
CKA 模拟真题 Killer.sh | Question 16 | Namespaces and Api Resources
Use context: kubectl config use-context k8s-c1-H Write the names of all namespaced Kubernetes resources (like Pod, Secret, ConfigMap…) into /opt/course/16/resources.txt . Find the project-* Namespace with the highest number of Roles defined in it and write its name and amount of Roles into /opt/course/16/crowded-namespace.txt . 译文将所有命名的 Kubernetes 资源(如 Pod、Secret、ConfigMap……)的名称写入 /opt/course/16/resources.txt 中。 查找定义角色数量最多的 *project-*** 命名空间,并将其名称和角色数量写入 /opt/course/16/crowded-namespace.txt ...
评论
公告
站点进行了迁移, 如需帮助, 请发邮件到 [email protected]


