Challenge - 5 Problems
Kubectl Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Check kubectl version output
What is the output of the command
kubectl version --client --short immediately after a successful kubectl installation?Kubernetes
kubectl version --client --shortAttempts:
2 left
💡 Hint
The command shows the client version in a short format.
✗ Incorrect
The command
kubectl version --client --short outputs the client version in a short, readable format like 'Client Version: v1.27.0'. Other options indicate errors or incomplete version info.❓ Configuration
intermediate1:30remaining
Correct kubeconfig file location
After installing kubectl, where should the default kubeconfig file be placed for kubectl to automatically use it?
Attempts:
2 left
💡 Hint
kubectl looks for the config file in a hidden directory inside your home folder.
✗ Incorrect
By default, kubectl looks for the kubeconfig file at
~/.kube/config. Other locations require explicit environment variable settings.❓ Troubleshoot
advanced2:00remaining
Diagnose kubectl connection error
You run
kubectl get pods and get the error: The connection to the server localhost:8080 was refused. What is the most likely cause?Attempts:
2 left
💡 Hint
This error usually means kubectl tries to connect to localhost because it has no cluster info.
✗ Incorrect
If kubectl cannot find a valid kubeconfig or context, it defaults to localhost:8080 which usually has no server running, causing this error.
🔀 Workflow
advanced1:30remaining
Set a specific context for kubectl
Which command correctly sets the current context to
production-cluster in kubectl?Attempts:
2 left
💡 Hint
The command uses 'config' and 'use-context' keywords.
✗ Incorrect
The correct command to switch context is
kubectl config use-context <context-name>. Other options are invalid commands.✅ Best Practice
expert2:30remaining
Secure kubectl configuration best practice
What is the best practice to securely manage kubectl access credentials on a shared workstation?
Attempts:
2 left
💡 Hint
Think about file permissions and environment isolation.
✗ Incorrect
Storing kubeconfig files with restricted permissions and specifying them via environment variables limits exposure and prevents accidental credential leaks.