CKA 模拟真题 Killer.sh | Preview Question 1
Use context: kubectl config use-context k8s-c2-AC
The cluster admin asked you to find out the following information about etcd running on cluster2-controlplane1:
Server private key location Server certificate expiration date Is client certificate authentication enabled Write these information into /opt/course/p1/etcd-info.txt
Finally you’re asked to save an etcd snapshot at /etc/etcd-snapshot.db on cluster2-controlplane1 and display its status.
译文
集群管理员要求你找出关于在 cluster2-controlplane1 上运行的 etcd 的以下信息。
- 服务器私钥位置
- 服务器证书的到期日
- 是否启用了客户证书认证
将这些信息写入 /opt/course/p1/etcd-info.txt 中
最后要求你在 /etc/etcd-snapshot.db 上保存 cluster2-controlplane1 的 etcd 快照,并显示其状态。
解答
kubectl config use-context k8s-c2-AC |
检查节点
k get node |
远程cluster2-controlplane1
ssh cluster2-controlplane1 |
etcd.yaml
# /etc/kubernetes/manifests/etcd.yaml |
查看证书过期时间
root@cluster2-controlplane1:~# openssl x509 -noout -text -in /etc/kubernetes/pki/etcd/server.crt | grep Validity -A2 |
/opt/course/p1/etcd-info.txt 内容
Server private key location: /etc/kubernetes/pki/etcd/server.key |
创建etcd备份
ETCDCTL_API=3 etcdctl snapshot save /etc/etcd-snapshot.db \ |
查看备份状态
root@cluster2-controlplane1:~# ETCDCTL_API=3 etcdctl snapshot status /etc/etcd-snapshot.db |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
评论



