Kubernetes (k8s) Commands - Statistics

General Stats
  • This quiz has been taken 8 times
  • The average score is 10 of 27
Answer Stats
Hint Answer % Correct
Create a namespace named dev kubectl create ns dev
100%
Describe all pods (in the current namespace) kubectl describe pods
100%
List all namespaces kubectl get namespaces
100%
List all nodes (in the current namespace) kubectl get nodes
100%
Show all pods in the current namespace kubectl get pods
100%
Show all pods in ALL namespaces kubectl get pods -A
100%
Create from a manifest file called app.yaml (hint: use apply) kubectl apply -f app.yaml
50%
Create a deployment "web" using image nginx:1.25 kubectl create deploy web --image=nginx1.25
50%
Delete from a manifest file app.yaml kubectl delete -f app.yaml
50%
Describe a pod named nginx kubectl describe pod nginx
50%
Output the YAML for pod named nginx kubectl get pod nginx -o yaml
50%
Watch pods (in current namespace) kubectl get pods -w
50%
Scale deployment "web" to 3 replicas kubectl scale deploy web --replicas=3
50%
Switch context namespace to dev kubectl config set-context --current --namespace=dev
0%
Create a configmap (literal) app-cm with key=value kubectl create cm app-cm --from-literal=key=value
0%
Create a service account kubectl create sa build-bot
0%
Create a secret db with user=admin kubectl create secret generic db --from-literal=user=admin
0%
Exec into a pod. Get a shell in pod nginx. kubectl exec -it nginx -- sh
0%
Expose a deployment called "web" as a service on port 80 as ClusterIP kubectl expose deploy web --port=80
0%
Get Events (sorted) kubectl get events --sort-by=.metadata.creationTimestamp
0%
Show wide pod details kubectl get pods -o wide
0%
View logs for a specific container. Pod is app, container is api kubectl logs app -c api
0%
View logs for pod nginx kubectl logs nginx
0%
Port Forwarding: Forward Local port 8080 to pod nginx on port 80 kubectl port-forward pod/nginx 8080:80
0%
Check rollout status of the "web" deployment kubectl rollout status deploy/web
0%
Roll back a deployment of "web" kubectl rollout undo deploy/web
0%
Update a deployment image (rolling update). Set "web" container nginx to nginx:1.26 kubectl set image deploy/web nginx=nginx:1.26
0%
No matching quizzes found
Score Distribution
Percent of People with Each Score
Percentile by Number Answered
Your Score History
You have not taken this quiz