CKA备战13-真题:检查有多少 node 节点是健康状态
题目PS:请注意本体不在有 NoSchedule 节点,答案变成 3 个Set configuration context $ kubectl config use-context k8sCheck to see how many nodes are ready (not including nodes tainted NoSchedule) and write the number to /op
·
题目
PS:请注意本体不在有 NoSchedule 节点,答案变成 3 个
Set configuration context $ kubectl config use-context k8s
Check to see how many nodes are ready (not including nodes tainted NoSchedule) and write the number to /opt/nodenum
答案
kubectl describe node |grep -i taints |grep -v -i noschedule
echo $Num > /opt/KUSC00402/kusc00402.txt
或者:
# for i in `kubectl get nodes|grep Ready|grep -v 'NAME'|awk '{print $1}'` ;
do
kubectl describe node $i |grep Taints|grep -v 'NoSchedule';
done|wc -l >/opt/nodenum
# cat /opt/nodenum
更多推荐
已为社区贡献4条内容
所有评论(0)