CKS 1.22 模拟题
注意:文中代码块会出现很多 \-
这样的字符,实际上是 -
,是因为网站的 markdown 渲染有问题,不得不这样写
Question 1
Task weight: 1%You have access to multiple clusters from your main terminal through
kubectl
contexts. Write all context names into/opt/course/1/contexts
, one per line.From the kubeconfig extract the certificate of user
restricted@infra-prod
and write it decoded to/opt/course/1/cert
.
题目解析:
考点
- kubectl
解题
➜ kubectl config get-contexts -o name > /opt/course/1/contexts # 从 .kube/config 文件中找到 \- name: restricted@infra-prod user client-certificate-data: LS0tLS1CRUdJ... ➜ echo LS0tLS1CRUdJ... | base64 -d > /opt/course/1/cert