CKA Dumps PDF 2025 Program Your Preparation EXAM SUCCESS [Q29-Q44]

Share

CKA Dumps PDF 2025 Program Your Preparation EXAM SUCCESS

Get Perfect Results with Premium CKA Dumps Updated 68 Questions

NEW QUESTION # 29
Score: 7%

Task
Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.
Create a new service named front-end-svc exposing the container port http.
Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.

Answer:

Explanation:
Solution:
kubectl get deploy front-end
kubectl edit deploy front-end -o yaml
#port specification named http
#service.yaml
apiVersion: v1
kind: Service
metadata:
name: front-end-svc
labels:
app: nginx
spec:
ports:
- port: 80
protocol: tcp
name: http
selector:
app: nginx
type: NodePort
# kubectl create -f service.yaml
# kubectl get svc
# port specification named http
kubectl expose deployment front-end --name=front-end-svc --port=80 --tarport=80 --type=NodePort


NEW QUESTION # 30
Score: 4%

Task
Check to see how many nodes are ready (not including nodes tainted NoSchedule ) and write the number to
/opt/KUSC00402/kusc00402.txt

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl describe nodes | grep ready|wc -l
kubectl describe nodes | grep -i taint | grep -i noschedule |wc -l
echo 3 > /opt/KUSC00402/kusc00402.txt
#
kubectl get node | grep -i ready |wc -l
# taintsnoSchedule
kubectl describe nodes | grep -i taints | grep -i noschedule |wc -l
#
echo 2 > /opt/KUSC00402/kusc00402.txt


NEW QUESTION # 31
Create a snapshot of the etcd instance running at https://127.0.0.1:2379, saving the snapshot to the file path
/srv/data/etcd-snapshot.db.
The following TLS certificates/key are supplied for connecting to the server with etcdctl:
* CA certificate: /opt/KUCM00302/ca.crt
* Client certificate: /opt/KUCM00302/etcd-client.crt
* Client key: Topt/KUCM00302/etcd-client.key

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 32
Apply the autoscaling to this deployment with minimum 10 and maximum 20 replicas and target CPU of 85% and verify hpa is created and replicas are increased to 10 from 1

Answer:

Explanation:
kubectl autoscale deploy webapp --min=10 --max=20 --cpu percent=85 kubectl get hpa kubectl get pod -l app=webapp


NEW QUESTION # 33
Get the pods with labels env=dev and env=prod and output the labels as well

Answer:

Explanation:
kubectl get pods -l 'env in (dev,prod)' --show-labels


NEW QUESTION # 34
Evict all existing pods from a node-1 and make the node unschedulable for new pods.

  • A. kubectl get nodes
    kubectl drain node-1 #It will evict pods running on node-1 to
    other nodes in the cluster
    // Verify
    kubectl get no
    When you cordon a node, the status shows "SchedulingDisabled"
  • B. kubectl get nodes
    kubectl drain node-1 #It will evict pods running on node-1 to
    other nodes in the cluster
    kubectl cordon node-1 # New pods cannot be scheduled to the
    node
    // Verify
    kubectl get no
    When you cordon a node, the status shows "SchedulingDisabled"

Answer: B


NEW QUESTION # 35
Create a deployment called webapp with image nginx having 5 replicas in it, put the file in /tmp directory with named webapp.yaml

  • A. //Create a file using dry run command
    kubectl create deploy --image=nginx --dry-run -o yaml >
    /tmp/webapp.yaml
    // Now, edit file webapp.yaml and update replicas=5
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: webapp
    name: webapp
    spec:
    replicas: 5
    selector:
    matchLabels:
    app: webapp
    template:
    metadata:
    labels:
    Note: Search "deployment" in kubernetes.io site , you will get
    the page
    https://kubernetes.io/docs/concepts/workloads/controllers/deplo
    yment/
    // Verify the Deployment
    kubectl get deploy webapp --show-labels
    // Output the YAML file of the deployment webapp
    kubectl get deploy webapp -o yaml
  • B. //Create a file using dry run command
    kubectl create deploy --image=nginx --dry-run -o yaml >
    /tmp/webapp.yaml
    // Now, edit file webapp.yaml and update replicas=5
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: webapp
    name: webapp
    spec:
    replicas: 5
    selector:
    matchLabels:
    app: webapp
    template:
    metadata:
    labels:
    app: webapp
    spec:
    containers:
    - image: nginx
    name: nginx
    Note: Search "deployment" in kubernetes.io site , you will get
    the page
    https://kubernetes.io/docs/concepts/workloads/controllers/deplo
    yment/
    // Verify the Deployment
    kubectl get deploy webapp --show-labels
    // Output the YAML file of the deployment webapp
    kubectl get deploy webapp -o yaml

Answer: B


NEW QUESTION # 36
Create a ETCD backup of kubernetes cluster
Note : You don't need to memorize command, refer -
https://kubernetes.io/docs/tasks/administer-cluster/configureupgrade-etcd/ during exam

  • A. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.17.0.15:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    cacert=/etc/kubernetes/pki/etcd/ca.crt --
    cert=/etc/kubernetes/pki/etcd/server.crt --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db
  • B. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.16.0.18:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db

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 pod as follows:
Name: mongo
Using Image: mongo
In a new Kubernetes namespace named: my-website

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\9 B.JPG


NEW QUESTION # 39
Check the image version in pod without the describe command

Answer:

Explanation:
kubectl get po nginx -o jsonpath='{.spec.containers[].image}{"\n"}'


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
Install a kubernetes cluster with one master and one worker using kubeadm

  • A. This is a straightforward question, you need to install kubernetes cluster using kubeadm with one master and one worker.
    Refer : https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/
  • B. This is a straightforward question, you need to install kubernetes cluster using kubeadm with one master and one worker.
    Installation is considered success once both master and worker
    nodes become available.
    Refer : https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/

Answer: B


NEW QUESTION # 42
Check to see how many worker nodes are ready (not including nodes taintedNoSchedule) and write the number to/opt/KUCC00104/kucc00104.txt.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 43
Allow traffic from all the pods in "web" namespace and from pods
with label "type=monitoring" to the pods matching label "app: db"

  • A. kubectl create namespace web
    kubectl label namespace/web app=web
    vim web-allow-all-ns-monitoring.yaml
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: web-allow-all-ns-monitoring
    namespace: default
    spec:
    podSelector:
    matchLabels:
    app: db
    ingress:
    - from:
    - namespaceSelector:
    matchLabels:
    app: web
    podSelector:
    matchLabels:
    type: monitoring
    k kubectl apply -f web-allow-all-ns-monitoring.yaml
  • B. kubectl create namespace web
    kubectl label namespace/web app=web
    vim web-allow-all-ns-monitoring.yaml
    apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: web-allow-all-ns-monitoring
    namespace: default
    spec:
    podSelector:
    podSelector:
    matchLabels:
    type: monitoring
    k kubectl apply -f web-allow-all-ns-monitoring.yaml

Answer: A


NEW QUESTION # 44
......


Linux Foundation Certified Kubernetes Administrator (CKA) program is a certification designed to test the knowledge and skills of individuals in the field of Kubernetes administration. Kubernetes is one of the most popular container orchestration platforms, and it is widely used by organizations to manage their containerized applications. The CKA program is developed and maintained by the Linux Foundation, which is a non-profit organization that promotes the use of open source technologies.

 

CKA PDF Dumps Extremely Quick Way Of Preparation: https://www.examcollectionpass.com/Linux-Foundation/CKA-practice-exam-dumps.html

Free CKA Exam Study Guide for the NEW Dumps Test Engine: https://drive.google.com/open?id=13pvwjxLHQueTnOZAIsTQfuroynmbT7Fl