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。这些将是第一批终止的候选者。如果一些Pods容器没有设置资源请求/限制,那么默认情况下,这些容器将被视为使用超过请求。
参考https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod
kubectl config use-context k8s-c1-Hg |
检查没有设置资源限制的pod
k -n project-c13 describe pod | egrep "^(Name:| Requests:)" -A1 |
后面没有限制的pod有下面这些,写入到文件/opt/course/e1/pods-not-stable.txt即可
# /opt/course/e1/pods-not-stable.txt |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
评论



