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-10
CKA 模拟真题 Killer.sh | Extra Question 1 | Find Pods first to be terminated
Use context: kubectl config use-context k8s-c1-H Check all available Pods in the Namespace project-c13 and find the names of those that would probably be terminated first if the nodes run out of resources (cpu or memory) to schedule all Pods. Write the Pod names into /opt/course/e1/pods-not-stable.txt . 译文检查名称空间 project-c13 中的所有可用 Pod,并找出在节点资源(CPU 或内存)耗尽时可能首先终止的 Pod 名称,以调度所有 Pod。 将 Pod 名称写入 /opt/course/e1/pods-not-stable.txt。 解答当节点上的可用cpu或内存资源达到极限时,Kubernetes将寻找那些使用的资源超过其要求的Pod。这些将是第一批终止的候...

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 11 | DaemonSet on all Nodes
Use context: kubectl config use-context k8s-c1-H Use Namespace project-tiger for the following. Create a DaemonSet named ds-important with image httpd:2.4-alpine and labels id=ds-important and uuid=18426a0b-5f59-4e10-923f-c0e078e82462 . The Pods it creates should request 10 millicore cpu and 10 mebibyte memory. The Pods of that DaemonSet should run on all nodes, also controlplanes. 译文在命名空间 project-tiger 进行如下操作。创建一个名为 ds-important 的 DaemonSet ,镜像为 httpd:2.4-alpine ,标签 id=ds-important , uuid...

2023-01-02
KA 模拟题库 | 1. 权限控制RBAC
设置配置环境kubectl config use-context k8s Context为部署流水线创建一个新的 ClusterRole 并将其绑定到范围为特定的 namespace 的特定 ServiceAccount 。 Task创建一个名为 deployment-clusterrole 且仅允许创建以下资源类型的新 ClusterRole : Deployment StatefulSet DaemonSet 在现有的 namespace app-team1 中创建一个名为 cicd-token 的新 ServiceAccount。 限于 namespace app-team1 中,将新的 ClusterRole deployment-clusterrole 绑定到新的 ServiceAccount cicd-token 参考kubectl create clusterrole -hkubectl create rolebinding -hhttps://kubernetes.io/zh-cn/docs/reference/access-authn-authz/rbac...

2023-01-10
CKA 模拟真题 Killer.sh | Question 21 | Create a Static Pod and Service
Use context: kubectl config use-context k8s-c3-CCC Create a Static Pod named my-static-pod in Namespace default on cluster3-controlplane1 . It should be of image nginx:1.16-alpine and have resource requests for 10m CPU and 20Mi memory. Then create a NodePort Service named static-pod-service which exposes that static Pod on port 80 and check if it has Endpoints and if it’s reachable through the cluster3-controlplane1 internal IP address. You can connect to the internal node IPs from your main ...

2023-01-09
CKA 模拟真题 Killer.sh | Question 10 | RBAC ServiceAccount Role RoleBinding
Use context: kubectl config use-context k8s-c1-H Create a new ServiceAccount processor in Namespace project-hamster . Create a Role and RoleBinding, both named processor as well. These should allow the new SA to only create Secrets and ConfigMaps in that Namespace. 译文在namespace project-hamster 中创建一个新的 ServiceAccount processor 。创建一个 角色 和 RoleBinding ,这两个都是命名的 processor 。这些应该允许新的 SA 只在该命名空间中创建 Secrets 和 ConfigMaps 。 解答 有4种不同的RBAC组合和3种有效的组合。 Role + RoleBinding(适用于单一命名空间,适用于单个命名空间) ClusterRo...
评论
公告
站点进行了迁移, 如需帮助, 请发邮件到 [email protected]


