考了容器相关的 CKA 证书,攻略附上供大家参考

2020-05-07 16:57:58 +08:00
 d5

CKA 认证从零到一

🐳 CKA from zero to hero - 2020/05


报考理由

报考材料

考试形式

考试形式介绍

🐧以下内容部分自网络,主要来源如下,如果有漏掉的来源,烦请指正补充:

CKA 考试经验:报考和考纲

2020 年 CKA 考试最新最全指南

2020 年 5 月 CKA 应试指南

————————————————

考试界面介绍

具体界面如下:

集群的切换

在 CKA 考试中,集群的切换时通过跳板机中的参数来决定的。在具体操作时,我们只需要根据题目提示操作即可:

如何学习

奇技淫巧

参数切忌死记硬背,命令后加-h就有了。而且一定要理解每个参数的含义。例如常见的 -o,我们要知道:

#-o 参数,指定生成 yaml 或者 json 格式的描述文件

[(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...]

-o yaml 
-o json
--output=yaml
--output=json

考试界面自带的记事本非常好用,修改起来也很方便。直接从官方文档拷贝需要的 yaml 片段,在记事本里加以修改即可。也可以选择选复制到文件中,然后用 vi 编辑器修改。整个考试虽然给了 3 小时时间,但是其实大概1.5h就能够基本搞定。

例如这一道 daemonset 真题。

daemonset 简单理解就是每个节点只允许一个副本;再简单点,工地每一片区域里只允许放 1 间豪华板房。

Set configuration context $ kubectl config use-context k8s

Ensure a single instance of Pod nginx is running on each node of the kubernetes cluster where nginx also represents the image name which has to be used. Do no override any taints currently in place.

Use Daemonsets to complete this task and use ds.kusc00201 as Daemonset name. Question weight 3%

先粘贴,后用 VI 编辑:
(1)只需要打开官方 daemonset 文档,找到 yaml 片段: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
(2)复制后,在 vi 用 /g/fluentd-elasticsearch/s//nginx/g 批量替换
(3)删除 labels 段、修改 name 即可。。

又比如这道真题,需要我们生成一个 deployment 的 yaml 文件,要求生成后清理掉命令产生的对象,则我们用--dry-run这个参数即可"模拟运行"。

Set configuration context $ kubectl config use-context k8s Create a deployment spec file that will:
Launch 7 replicas of the redis image with the label: app_env_stage=dev

Deployment name: kual00201

Save a copy of this spec file to /opt/KUAL00201/deploy_spec.yaml (or .json)

When you are done, clean up (delete) any new k8s API objects that you produced during this task Question weight: 3%
# 一条搞定
kubectl run kual00201 --generator=deployment/apps.v1 --image=redis --labels=app_env_stage=dev --replicas=7 -o yaml --dry-run > /opt/KUAL00201/deploy_spec.yaml

在线练习

kodekloud 免登陆练习-传送门

1776 次点击
所在节点    程序员
8 条回复
smallc2009
2020-05-07 17:13:50 +08:00
之前有个 combo 套餐,CKA 和 CKAD 俩加一起才 120 刀,包含学习资料和考试费。
https://www.v2ex.com/t/625019#reply1
d5
2020-05-07 17:29:43 +08:00
@smallc2009 羡慕黑五的价格
feelinglucky
2020-05-07 18:32:46 +08:00
考试时间有限制吗?
wangking
2020-05-07 19:02:58 +08:00
有题库吗 ?
whileFalse
2020-05-07 19:16:00 +08:00
想问一句能用 nano 么……
whileFalse
2020-05-07 19:18:23 +08:00
今年刚开始用 Kubernetes 。感觉到了黑 5 水平也差不多可以考试了。
nieqibest
2020-05-07 20:00:16 +08:00
这种证真的有用吗?
smallc2009
2020-05-07 21:20:53 +08:00
@nieqibest 国内没啥用, 国外还有点用途。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/669347

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX