Get 2023 Free Linux Foundation CKA Exam Practice Materials Collection
Get Latest and 100% Accurate CKA Exam Questions
Linux Foundation Certified Kubernetes Administrator (CKA) program is an industry-recognized certification that validates the skills and expertise of professionals in managing and deploying Kubernetes clusters. Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. As Kubernetes adoption continues to grow, the demand for certified professionals with the necessary skills and knowledge to manage Kubernetes clusters has also increased.
Linux Foundation Certified Kubernetes Administrator (CKA) program is a certification exam that is designed to test an individual’s knowledge and skills when it comes to deploying, managing, and troubleshooting Kubernetes clusters. Kubernetes is a powerful tool that is used for container orchestration, and it has become increasingly popular in recent years due to the rise of containerization. The CKA program is an excellent way for professionals to showcase their expertise in Kubernetes and demonstrate their ability to work with this technology in a real-world environment.
NEW QUESTION # 36
Deploy a pod with image=redis on a node with label disktype=ssd
- A. // Get list of nodes
kubectl get nodes
//Get node with the label disktype=ssd
kubectl get no -l disktype=ssd
// Create a sample yaml file
kubectl run node-redis --generator=run-pod/v1 --image=redis --dry
run -o yaml > test-redis.yaml
// Edit test-redis.yaml file and add nodeSelector
vim test-redis.yaml
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
nodeSelector:
disktype: ssd
containers:
- name: node-redis
image: redis
imagePullPolicy: IfNotPresent
kubectl apply -f test-redis.yaml
/ // Verify
K kubectl get po -o wide - B. // Get list of nodes
kubectl get nodes
//Get node with the label disktype=ssd
kubectl get no -l disktype=ssd
// Create a sample yaml file
kubectl run node-redis --generator=run-pod/v1 --image=redis --dry
run -o yaml > test-redis.yaml
// Edit test-redis.yaml file and add nodeSelector
vim test-redis.yaml
apiVersion: v1
- name: node-redis
image: redis
imagePullPolicy: IfNotPresent
kubectl apply -f test-redis.yaml
/ // Verify
K kubectl get po -o wide
Answer: A
NEW QUESTION # 37
Create a nginx pod with label env=test in engineering namespace
Answer:
Explanation:
See the solution below.
Explanation
kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dry-run -o yaml > nginx-pod.yaml kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --dry-run -o yaml | kubectl create -nengineering-f - YAML File:
apiVersion: v1
kind: Pod
metadata:
name: nginx
namespace: engineering
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
restartPolicy: Never
kubectl create -f nginx-pod.yaml
NEW QUESTION # 38
Create a daemonset named "Prometheus-monitoring" using image=prom/Prometheus which runs in all the nodes in the cluster. Verify the pod running in all the nodes
- A. vim promo-ds.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: prometheus-monitoring
spec:
selector:
matchLabels:
name: prometheus
template:
metadata:
labels:
name: prometheus
spec:
tolerations:
# remove it if your masters can't run pods
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: prometheus-container
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
volumes:
- name: varlog
emptyDir: {}
- name: varlibdockercontainers
emptyDir: {}
kubectl apply -f promo-ds.yaml
NOTE: Deamonset will get scheduled to "default" namespace, to
schedule deamonset in specific namespace, then add
"namespace" field in metadata
//Verify
kubectl get ds
NAME DESIRED CURRENT READY UP-TO-DATE
AVAILABLE NODE SELECTOR AGE
prometheus-monitoring 8 8 0 6
0 <none> 7s
kubectl get no # To get list of nodes in the cluster
// There are 6 nodes in the cluster, so a pod gets scheduled to
each node in the cluster - B. vim promo-ds.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: prometheus-monitoring
spec:
selector:
matchLabels:
name: prometheus
template:
metadata:
labels:
name: prometheus
spec:
tolerations:
# remove it if your masters can't run pods
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: prometheus-container
image: prom/prometheus
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
volumes:
- name: varlog
emptyDir: {}
- name: varlibdockercontainers
emptyDir: {}
kubectl apply -f promo-ds.yaml
NOTE: Deamonset will get scheduled to "default" namespace, to
schedule deamonset in specific namespace, then add
"namespace" field in metadata
//Verify
kubectl get ds
NAME DESIRED CURRENT READY UP-TO-DATE
AVAILABLE NODE SELECTOR AGE
prometheus-monitoring 6 6 0 6
0 <none> 7s
kubectl get no # To get list of nodes in the cluster
// There are 6 nodes in the cluster, so a pod gets scheduled to
each node in the cluster
Answer: B
NEW QUESTION # 39
A Kubernetes worker node, named wk8s-node-0 is in state NotReady. Investigate why this is the case, and perform any appropriate steps to bring the node to a Ready state, ensuring that any changes are made permanent.
You can ssh to the failed node using:
[student@node-1] $ | ssh Wk8s-node-0
You can assume elevated privileges on the node with the following command:
[student@w8ks-node-0] $ | sudo -i
Answer:
Explanation:
solution


NEW QUESTION # 40
Create a deployment as follows:
* Name: nginx-app
* Using container nginx with version 1.11.10-alpine
* The deployment should contain 3 replicas
Next, deploy the application with new version 1.11.13-alpine, by performing a rolling update.
Finally, rollback that update to the previous version 1.11.10-alpine.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 41
Create a file:
/opt/KUCC00302/kucc00302.txt that lists all pods that implement service baz in namespace development.
The format of the file should be one pod name per line.
Answer:
Explanation:
solution


NEW QUESTION # 42
Remove taint added to node "worker-2"
Answer:
Explanation:
kubectl taint nodes worker-2 key:NoSchedule- // Verify You will see a message "node/worker-2 untainted" kubectl get nodes -o customcolumns=NAME:.metadata.name,TAINTS:.spec.taints --no-headers
NEW QUESTION # 43
Score: 4%
Task
Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.
Answer:
Explanation:
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon ek8s-node-1
kubectl drain ek8s-node-1 --delete-local-data --ignore-daemonsets --force
NEW QUESTION # 44
Create a file:
/opt/KUCC00302/kucc00302.txtthatlists all pods that implement servicebazin namespacedevelopment.
The format of the file should be onepod name per line.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 45
Score: 4%
Task
Scale the deployment presentation
Answer:
Explanation:
See the solution below.
Explanation
Solution:
kubectl get deployment
kubectl scale deployment.apps/presentation --replicas=6
NEW QUESTION # 46
Perform the following tasks:
* Add an init container tohungry-bear(which has beendefined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
* The init container should createan empty file named/workdir/calm.txt
* If/workdir/calm.txtis notdetected, the pod should exit
* Once the spec file has beenupdatedwith the init containerdefinition, the pod should becreated
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 47
Create a Pod nginx and specify both CPU, memory requests and limits together and verify.
- A. kubectl run nginx-request --image=nginx --restart=Always --dryrun -o yaml > nginx-request.yml
// add the resources section and create
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
resources:
requests:
memory: "100Mi"
cpu: "0.4"
limits:
memory: "200Mi"
cpu: "7"
restartPolicy: Always
k kubectl apply -f nginx-request.yaml
// Verify
Kubectl top po - B. kubectl run nginx-request --image=nginx --restart=Always --dryrun -o yaml > nginx-request.yml
// add the resources section and create
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx-request
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
memory: "100Mi"
cpu: "0.5"
limits:
memory: "200Mi"
cpu: "1"
restartPolicy: Always
k kubectl apply -f nginx-request.yaml
// Verify
Kubectl top po
Answer: B
NEW QUESTION # 48
List all the pods sorted by name
Answer:
Explanation:
kubectl get pods --sort-by=.metadata.name
NEW QUESTION # 49
Create a redis pod, and have it use a non-persistent storage
Note: In exam, you will have access to kubernetes.io site,
Refer : https://kubernetes.io/docs/tasks/configure-pod-container/configurevolume-storage/
- A. apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
volumeMounts:
- containerPort: 6379
volumes:
- name: redis-storage
emptyDir: {} - B. apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
volumeMounts:
- name: redis-storage
mountPath: /data/redis
ports:
- containerPort: 6379
volumes:
- name: redis-storage
emptyDir: {}
Answer: B
NEW QUESTION # 50
Get IP address of the pod - "nginx-dev"
Answer:
Explanation:
Kubect1 get po -o wide
Using JsonPath
kubect1 get pods -o=jsonpath='{range
.items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
NEW QUESTION # 51
Scale the deployment webserver to
Answer:
Explanation:
See the solution below.
Explanation
solution
NEW QUESTION # 52
List all the pods showing name and namespace with a json path expression
Answer:
Explanation:
See the solution below.
Explanation
kubectl get pods -o=jsonpath="{.items[*]['metadata.name',
'metadata.namespace']}"
NEW QUESTION # 53
Create 2 nginx image pods in which one of them is labelled with env=prod and another one labelled with env=dev and verify the same.
Answer:
Explanation:
See the solution below.
Explanation
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like "creationTimestamp: null"
"dnsPolicy: ClusterFirst"
vim nginx-prod-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
env: prod
name: nginx-prod
spec:
containers:
- image: nginx
name: nginx-prod
restartPolicy: Always
# kubectl create -f nginx-prod-pod.yaml
kubectl run --generator=run-pod/v1 --image=nginx --
labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
env: dev
name: nginx-dev
spec:
containers:
- image: nginx
name: nginx-dev
restartPolicy: Always
# kubectl create -f nginx-prod-dev.yaml
Verify :
kubectl get po --show-labels
kubectl get po -l env=prod
kubectl get po -l env=dev
NEW QUESTION # 54
Create a hostPath PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteOnce, storageClassName manual, and volume at /mnt/data and verify
- A. vim task-pv-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: ""
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
kubectl apply -f task-pv-volume.yaml
//Verify
kubectl get pv
NAME CAPACITY ACCESS
MODES RECLAIM POLICY STATUS CLAIM
STORAGECLASS REASON AGE
task-pv-volume 5Gi RWO
Retain Available
3s - B. vim task-pv-volume.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: ""
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
kubectl apply -f task-pv-volume.yaml
//Verify
kubectl get pv
NAME CAPACITY ACCESS
MODES RECLAIM POLICY STATUS CLAIM
STORAGECLASS REASON AGE
task-pv-volume 4Gi RWO
Retain Available
8s
Answer: A
NEW QUESTION # 55
Delete persistent volume and persistent volume claim
Answer:
Explanation:
kubectl delete pvc task-pv-claim kubectl delete pv task-pv-volume // Verify Kubectl get pv,pvc
NEW QUESTION # 56
Ensure a single instance of pod nginx is running on each node of the Kubernetes cluster where nginx also represents the Image name which has to be used. Do not override any taints currently in place.
Use DaemonSet to complete this task and use ds-kusc00201 as DaemonSet name.
Answer:
Explanation:
See the solution below.
Explanation
solution



NEW QUESTION # 57
......
Maximum Grades By Making ready With CKA Dumps: https://www.2pass4sure.com/Kubernetes-Administrator/CKA-actual-exam-braindumps.html
Prepare CKA Exam Questions Recently Updated Questions: https://drive.google.com/open?id=1jj8R1nJxf_CnlPSjjlZ8rh604WnQc9ZB