CKA (Certified Kubernetes Administrator) 考試一週準備心得

Blog title art

如何一週就通過 CKA 考試?雖然還是希望大家可以有充足時間好好學習並吸收,但如果你也有短時間內必須通過考試的需求,歡迎參考本文!

首先,考過 CKA 證照跟真的是否會用 k8s 沒有什麼太大的關係!當初看到報名費 (美金) 從 $395 特價變 $150 腦波弱就噴錢了。如果你也想考的話,請記務必搜尋優惠碼,不要傻傻地噴 $395。當然,最理想的狀況還是公司出錢。

Table of Contents

為什麼搞到只有一週可以準備?

繳錢只能算是註冊費,還需要預約考試時間。根據 Candidate Handbook,從註冊到到實際完成考試可以隔 12 個月:

When a candidate registers for an exam they will have 12 months to schedule and take the exam

我是 2020/11 繳費的,實際考試時間是 2021/11。為了不浪費報名費硬著頭皮預約,所以不得已只有一週可以準備。既然只有一週,就必須只鑽研考試才會考的東西!

CKA 是什麼?

簡單來說就是考你會不會用 kubernetes 的一個證照。

除了 CKA 外還有 CKAD (Certified Kubernetes Application Developer) 跟 CKS (Certified Kubernetes Security Specialist)。

難易度的話,根據 Reddit 的討論: CKAD -> CKA -> CKS (必須通過 CKA 才能考)。至於詳細的差別就請自己讀一下官方的 Handbook 了。

CKA 通過的標準也不是很嚴格,只要 66% 以上就過了,而我以 68% 超低空飛過。

背景知識

當初程度就是抄寫一些 yaml 檔案的程度,連要自己無中生有都還做不太到。至於管理上都用 k9sLens (GUI 萬歲!)。這也導致 kubectl 原生的指令都不記得了。只記得最基本的 kubectl get po, kubectl logs... 之類的。

上課: Certified Kubernetes Administrator (CKA) Practice Exam Tests | Udemy

只要這一堂課就夠了,然後請在特價的時候買,這樣大概就是 300-400 台幣就能買到一切所需!這堂課會附 KodeKloud 平台給你實際練習,基本上只要把課上完,練習做完,很難考不過。因為只有一個禮拜,我大概只上了 80% 的課程。

CKA 模擬考

考試前 CKA 有免費提供 killer.sh 的模擬考。一定要好好做完模擬考!模擬考會比實際的考試難一點,但也相去不遠。

準備好環境

KodeKloud 的另一個好處就是提供的環境跟考試差不多,每開一個新的練習都要重新準備好環境。都要重新做下面的事情。2022 年再回頭看去年的筆記覺得好陌生。

設定 .bashrc / .tmux.conf / .vimrc

.bashrc

alias watch='watch '
alias k=kubectl

.tmux.conf

set-option -g default-command

.vimrc

set tabstop=2 " (ts) width (in spaces) that a <tab> is displayed as
set expandtab " (et) expand tabs to spaces (use :retab to redo entire file)
set shiftwidth=2 " (sw) width (in spaces) used in each step of autoindent (aswell as << and >>)
set autoindent
set shell=/bin/bash

考試沒有什麼 k9s 可以用,在時間緊迫的情況下,拿到環境第一件事就是把 config 設定好。

vim cheatsheet

  • :set list – to see invisible tabs and chars
  • :retab – turns all the tabs into spaces
  • !ls – see the current directory
  • :read !base64 <file> – pasting certificates
  • visual select
    • Ctrl+V to enter visual block
    • Shift+V to enter visual line
  • >, 3> – indent

useful commands

  • wc -l: count lines

kubectl cheatsheet

  • explain stuff for template files
kubectl explain <resource> --rescursive | less
  • dry-run for yaml template
kubectl run|create redis --image=redis123 --dry-run=client -o yaml > pod.yaml
  • get shortnames
kubectl describe # to get the hint for command on the next line
kubectl api-resources # to get complete list with shorname
kubectl api-resources --namespaced=false # to get non namespaced resources
  • run → pod; create → other stuff
kubectl run <name-of-pod> --image=<image>
  • imperative commands
kubectl run nginx --image=nginx
kubectl create deploy nginx --image=nginx
kubectl expose deploy nginx

kubectl scale deploy nginx --replicas=5
kubectl create -f some.yaml
kubectl update -f some.yaml
kubectl delete -f some.yaml
  • declarative commands
kubectl apply -f some.yaml

考試當天

請準備獨立的視訊鏡頭,不要直接用筆電的。監考人員檢查環境檢查了大概半小時有吧!我就很蠢的一直舉著自己的筆電,手超酸!

另外,跟監考人員說任何話都要等個五分鐘才有回應。猜測應該是一個監考人員要監考不只一個人吧,這品質真的是有點對不起我們付的昂貴報名費。

最後,開始考試前,可以詢問能不能使用已經 kubernetes 官方文件的書籤並強調不會離開官方文件的網站。

Share
  • Copied the URL !

Comments

To comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Table of Contents