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

You're ask to find out following information about the cluster k8s-c1-H:

How many controlplane nodes are available? How many worker nodes are available? What is the Service CIDR? Which Networking (or CNI Plugin) is configured and where is its config file? Which suffix will static pods have that run on cluster1-node1? Write your answers into file /opt/course/14/cluster-info , structured like this:

# /opt/course/14/cluster-info
1: [ANSWER]
2: [ANSWER]
3: [ANSWER]
4: [ANSWER]
5: [ANSWER]

译文:

你被要求找出关于集群 k8s-c1-H 的以下信息。

  1. 有多少个控制板节点可用?
  2. 有多少个工作节点可用?
  3. 服务的CIDR是什么?
  4. 哪个网络(或CNI插件)被配置了,其配置文件在哪里?
  5. 运行在cluster1-node1上的静态pod会有哪个后缀?

把你的答案写进文件/opt/course/14/cluster-info,结构如下。

# /opt/course/14/cluster-info
1:[答案]
2: [答案]
3: [答案]
4: [答案]
5: [答案]

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

检查节点和控制节点可用数量

k get node
k desribe node | grep -i taints

查看集群CIDR 及CNI 插件位置

ssh cluster1-controlplane1
root@cluster1-controlplane1:~# cat /etc/kubernetes/manifests/kube-apiserver.yaml | grep range
root@cluster1-controlplane1:~# find /etc/cni/net.d/
root@cluster1-controlplane1:~# cat /etc/cni/net.d/10-weave.conflist

file

vim /opt/course/14/cluster-info

# /opt/course/14/cluster-info
1: 1
2: 2
3: 10.96.0.0/12
4: Weave, /etc/cni/net.d/10-weave.conflist
5: -cluster1-node1

Killer.sh CKA模拟题目 汇总