Introduction to CKAD Practice Questions
The Certified Kubernetes Application Developer (CKAD) exam is a challenging yet rewarding certification for professionals seeking to showcase their skills in containerized application development using Kubernetes. To help you prepare effectively, having access to quality practice questions is essential. Below, we’ve gathered a set of practice questions from the CKAD Exam Dumps, available through PrepBolt, to give you a glimpse of the type of challenges you'll face in the actual exam. By working through these, you'll gain confidence in solving real-world Kubernetes problems and enhance your exam readiness.
Practice Questions
Question 1: Pod Creation with Redis Image
-
Task: Create a pod that runs in the
web
namespace with the following characteristics:- The pod must be named
cache
. - Use the
Ifccncf/redis
image with the3.2
tag. - Expose port
6379
.
- The pod must be named
- Solution: To create the required pod, use the following Kubernetes YAML configuration:
apiVersion: v1
kind: Pod
metadata:
name: cache
namespace: web
spec:
containers:
- name: redis
image: Ifccncf/redis:3.2
ports:
- containerPort: 6379
Use the command to apply the YAML configuration:
kubectl apply -f pod-redis.yaml
Question 2: Secret Creation and Consumption
-
Task: Create a secret named
another-secret
with the key-value pairkey1/value4
and then create an Nginx pod namednginx-secret
which consumes the secret in the form of an environment variable namedCOOL_VARIABLE
. - Solution: First, create the secret:
kubectl create secret generic another-secret --from-literal=key1=value4
Then, create the pod that consumes the secret:
apiVersion: v1
kind: Pod
metadata:
name: nginx-secret
spec:
containers:
- name: nginx
image: nginx
env:
- name: COOL_VARIABLE
valueFrom:
secretKeyRef:
name: another-secret
key: key1
Apply the configuration:
kubectl apply -f pod-nginx-secret.yaml
Question 3: Pod Resource Requests
-
Task: Create a pod named
nginx-resources
in thepod-resources
namespace, with the following resource requirements:- A minimum of
200m
CPU and1Gi
memory for the container. - The pod should use the
nginx
image.
- A minimum of
- Solution: The YAML for the pod with resource requests looks as follows:
apiVersion: v1
kind: Pod
metadata:
name: nginx-resources
namespace: pod-resources
spec:
containers:
- name: nginx
image: nginx
resources:
requests:
memory: "1Gi"
cpu: "200m"
Apply the configuration using:
kubectl apply -f pod-nginx-resources.yaml
Question 4: ConfigMap Creation and Usage
-
Task: Create a ConfigMap named
another-config
with the key-value pairkey4/value3
. Then, start a pod namednginx-configmap
, which mounts this ConfigMap under the directory/also/a/path
. - Solution: First, create the ConfigMap:
kubectl create configmap another-config --from-literal=key4=value3
Then, create the pod that mounts the ConfigMap:
apiVersion: v1
kind: Pod
metadata:
name: nginx-configmap
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: config-volume
mountPath: /also/a/path
volumes:
- name: config-volume
configMap:
name: another-config
Apply the configuration:
kubectl apply -f pod-nginx-configmap.yaml
Question 5: Service Account for Deployment
-
Task: Update the deployment
app-a
in theproduction
namespace to use therestrictedservice
service account. The service account has already been created. -
Solution:
To update the
app-a
deployment to use therestrictedservice
service account, modify the deployment YAML:
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-a
namespace: production
spec:
template:
spec:
serviceAccountName: restrictedservice
Apply the update:
kubectl apply -f deployment-app-a-update.yaml
By practicing these questions, you can enhance your understanding of Kubernetes concepts, preparing you for success in the CKAD Exam. These questions represent common scenarios you will encounter in the certification process, ensuring you are ready to tackle similar challenges in real-world applications. For further practice and detailed solutions, visit PrepBolt website for comprehensive CKAD study materials.
Top comments (0)