When you take the CKA/CKS/CKAD exams, you need to edit, create, or delete resources in the Kubernetes cluster.
The Vim editor is used by default, which means you should be aware of how to use shortcuts.
More information about Vim can be found here.
G
# go to end of filegg
# first line of fileShift + A
# go to the end of the current row (insert mode)Shift + C
# delete everything after the cursor (insert mode)Shift + I
# go to the first letter on the current row (insert mode)/Pod
# find any instances of 'Pod' in the filee
# jump to the end of the next wordw
# jump to the start of the next word:25
# go to the 25th row in the fileShift + V
# select the current rowShift + V
Shift + G
# select everything from the current row to the end of the file100 dd
# delete 100 rowsggVG
# select everything in the file
To make your life easier, you can create aliases for the kubectl
command.
export do="--dry-run=client -o yaml"
To create a pod template, use the following command:
k run test --image nginx $do