Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
87 views1 page

CKA Practice Questions

The document contains practice questions and answers for the Certified Kubernetes Administrator (CKA) exam. It includes commands for creating pods, deployments, services, ConfigMaps, secrets, and managing nodes. Each question is paired with the appropriate kubectl command to perform the specified action.

Uploaded by

Anas Elarbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views1 page

CKA Practice Questions

The document contains practice questions and answers for the Certified Kubernetes Administrator (CKA) exam. It includes commands for creating pods, deployments, services, ConfigMaps, secrets, and managing nodes. Each question is paired with the appropriate kubectl command to perform the specified action.

Uploaded by

Anas Elarbi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Certified Kubernetes Administrator (CKA) Practice Questions

1. Create a pod named `nginx-pod` using the `nginx` image.

Answer: kubectl run nginx-pod --image=nginx

2. Create a deployment named `web-deploy` with 3 replicas using the `nginx:1.14.2` image.

Answer: kubectl create deployment web-deploy --image=nginx:1.14.2 --replicas=3

3. Expose the `web-deploy` deployment on port 80 using a NodePort service.

Answer: kubectl expose deployment web-deploy --type=NodePort --port=80

4. Get all pods in all namespaces.

Answer: kubectl get pods --all-namespaces

5. Create a ConfigMap named `app-config` with a key `ENV=prod`.

Answer: kubectl create configmap app-config --from-literal=ENV=prod

6. Create a secret named `db-secret` with key `password=admin123`.

Answer: kubectl create secret generic db-secret --from-literal=password=admin123

7. Display the logs for a pod named `nginx-pod`.

Answer: kubectl logs nginx-pod

8. Drain a node named `worker-node1` for maintenance.

Answer: kubectl drain worker-node1 --ignore-daemonsets

9. Create a pod `busybox` that runs the command `sleep 3600`.

Answer: kubectl run busybox --image=busybox --command -- sleep 3600

10. View the details of a deployment named `web-deploy`.

Answer: kubectl describe deployment web-deploy

You might also like