CKAD Exam Prep Questions & Answers
2024/2025
Comandos para tabular o vi - ANSWERSecho 'set nu ts=2 sw=2 expandtab ruler' > ~/.vimrc
echo 'set backspace=indent,eol,start' >> ~/.vimrc
source ~/.vimrc
comandos para autocompletar no k8s - ANSWERSecho 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -F __start_kubectl k' >> ~/.bashrc
source .bashrc
Passos para criar ambiente Blue/Green/Canary - ANSWERS1. Criar o deployment blue, setando os labels
2.
Create a namespace called 'mynamespace' and a pod with image nginx called nginx on this namespace -
ANSWERSkubectl create namespace mynamespace
kubectl run nginx --image=nginx --restart=Never -n mynamespace
Create the pod that was just described using YAML - ANSWERSkubectl run nginx --image=nginx --
restart=Never --dry-run=client -n mynamespace -o yaml > pod.yaml
Create a busybox pod (using kubectl command) that runs the command "env - ANSWERSkubectl run
busybox --image=busybox --command --restart=Never -- env
kubectl logs busybox
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=busybox
KUBERNETES_PORT_443_TCP_PROTO=tcp
2024/2025
Comandos para tabular o vi - ANSWERSecho 'set nu ts=2 sw=2 expandtab ruler' > ~/.vimrc
echo 'set backspace=indent,eol,start' >> ~/.vimrc
source ~/.vimrc
comandos para autocompletar no k8s - ANSWERSecho 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -F __start_kubectl k' >> ~/.bashrc
source .bashrc
Passos para criar ambiente Blue/Green/Canary - ANSWERS1. Criar o deployment blue, setando os labels
2.
Create a namespace called 'mynamespace' and a pod with image nginx called nginx on this namespace -
ANSWERSkubectl create namespace mynamespace
kubectl run nginx --image=nginx --restart=Never -n mynamespace
Create the pod that was just described using YAML - ANSWERSkubectl run nginx --image=nginx --
restart=Never --dry-run=client -n mynamespace -o yaml > pod.yaml
Create a busybox pod (using kubectl command) that runs the command "env - ANSWERSkubectl run
busybox --image=busybox --command --restart=Never -- env
kubectl logs busybox
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=busybox
KUBERNETES_PORT_443_TCP_PROTO=tcp