CKAD Test Help
enable autocompletion - answer source <(kubectl completion bash)
Alias kubectl and autocomplete - answer alias k=kubectl
complete -F __start_kubectl k
Alias kd to get yaml object instead of applying the changes (with autocomplete) -
answeralias kd="kubectl --dry-run=client -o yaml"
complete -F __start_kubectl kd
Alias to apply resources - answeralias ka="kubectl apply -f"
complete -F __start_kubectl ka
Alias to delete resources immediately - answeralias kD="kubectl delete --grace-
period=0 --force"
complete -F __start_kubectl kD
vim apply function - answerva() { vim $1 ka $1 }
kubectl edit function - answerke() { kDf $1 va $1 }
kubectl replace - answerkr() { kDf $1 ka $1 }
vim set numbers - answerset nu
vim set 2 spaces instead of a tab - answerset tabstop=2 shiftwidth=2 expandtab
shortcut for configmaps - answercm
shortcut for namespaces - answerns
shortcut for persistentvolumeclaims - answerpvc
shortcut for persistentvolumes - answerpv
shortcut for pods - answerpo
enable autocompletion - answer source <(kubectl completion bash)
Alias kubectl and autocomplete - answer alias k=kubectl
complete -F __start_kubectl k
Alias kd to get yaml object instead of applying the changes (with autocomplete) -
answeralias kd="kubectl --dry-run=client -o yaml"
complete -F __start_kubectl kd
Alias to apply resources - answeralias ka="kubectl apply -f"
complete -F __start_kubectl ka
Alias to delete resources immediately - answeralias kD="kubectl delete --grace-
period=0 --force"
complete -F __start_kubectl kD
vim apply function - answerva() { vim $1 ka $1 }
kubectl edit function - answerke() { kDf $1 va $1 }
kubectl replace - answerkr() { kDf $1 ka $1 }
vim set numbers - answerset nu
vim set 2 spaces instead of a tab - answerset tabstop=2 shiftwidth=2 expandtab
shortcut for configmaps - answercm
shortcut for namespaces - answerns
shortcut for persistentvolumeclaims - answerpvc
shortcut for persistentvolumes - answerpv
shortcut for pods - answerpo