Try Before You Buy

Download a free sample of any of our exam questions and answers

  • 24/7 customer support, Secure shopping site
  • Free One year updates to match real exam scenarios
  • If you failed your exam after buying our products we will refund the full amount back to you.

[Jul-2021] Practice Linux Foundation CKA exam. Online Exam Practice Tests with detailed explanations! Pass CKA with confidence! [Q37-Q55]

Share

Practice Kubernetes Administrator CKA exam. Online Exam Practice Tests with detailed explanations! Pass CKA with confidence!

CKA - Certified Kubernetes Administrator (CKA) Program Exam Practice Tests 2021 | VCE4Dumps

NEW QUESTION 37
Score: 5%

Task
Monitor the logs of pod bar and:
* Extract log lines corresponding to error
* Write them to /opt/KUTR00101/bar

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl logs bar | grep 'unable-to-access-website' > /opt/KUTR00101/bar cat /opt/KUTR00101/bar

 

NEW QUESTION 38
Create a pod as follows:
Name: non-persistent-redis
container Image: redis
Volume with name: cache-control
Mount path: /data/redis
The pod should launch in the staging be persistent.

Answer:

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

F:\Work\Data Entry Work\Data Entry\20200827\CKA\13 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\13 D.JPG

 

NEW QUESTION 39
Monitor the logs of pod foo and:
* Extract log lines corresponding to error
unable-to-access-website
* Write them to/opt/KULM00201/foo

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 40
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.

  • A. 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
  • B. 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:
    - 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=dev

Answer: A

 

NEW QUESTION 41
A bootstrap USB flash drive has been prepared using a Windows workstation to load the initial configuration of a Palo Alto Networks firewall that was previously being used in a lab. The USB flash drive was formatted using file system FAT32 and the initial configuration is stored in a file named init-cfg.txt. The firewall is currently running PAN-OS 10.0 and using a lab config. The contents of init-cgf.txt in the USB flash drive are as follows:
type=dhcp-client
Ip-address=
default-gateway=
netmask=
Ipv6-address=
Ipv6-default-gateway=
hostname=Ca-FW-DC1
panorama-server=10.5.107.20
panorama-server-2=10.5.107.21
tplname=FINANCE_TG4
dgname=finance_dg
dns-primary=10.5.6.6
dns-secondary=10.5.6.7
op-command-modes-multi-vsys.jumbo-frame
dhcp-send-hostname=yes
dhcp-send-client-id=yes
dhcp-accept-server-hostname=yes
dhcp-accept-server-domain=yes
The USB flash drive has been inserted in the firewalls' USB port, and the firewall has been restarted using command> request restart system Upon restart, the firewall fails to begin the bootstrapping process. The failure is caused because:

  • A. PAN-OS version must be 9.1 x at a minimum, but the firewall is running 10.0x
  • B. Firewall must be in factory default state or have all private data deleted for bootstrapping
  • C. The hostname is a required parameter, but it is missing in init-cfg.txt
  • D. The bootstrap xml file is a required file, but it is missing
  • E. The USB must be formatted using the exi3 file system, FAT32 is

Answer: E

 

NEW QUESTION 42
List all service account and create a service account called "admin"

  • A. kubectl get sa
    kubectl get sa --all-namespaces
    //Verify
    kubectl get sa admin -o yaml
  • B. kubectl get sa
    kubectl get sa --all-namespaces
    kubectl create sa admin
    //Verify
    kubectl get sa admin -o yaml

Answer: B

 

NEW QUESTION 43
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
    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
  • 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
    - 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

Answer: A

 

NEW QUESTION 44
Resume the rollout of the deployment

Answer:

Explanation:
kubectl rollout resume deploy webapp

 

NEW QUESTION 45
Undo/Rollback deployment to specific revision "1"

  • A. // Check Deployment History
    kubectl rollout history deployment webapp
    kubectl rollout undo deploymet webapp --to-revision=1
  • B. // Check Deployment History
    kubectl rollout history deployment webapp
    //Rollback to particular revision
    kubectl rollout undo deploymet webapp --to-revision=1

Answer: B

 

NEW QUESTION 46
For this item, you will have to ssh to the nodes ik8s-master-0 and ik8s-node-0 and complete all tasks on these nodes. Ensure that you return to the base node (hostname: node-1) when you have completed this item.
Context
As an administrator of a small development team, you have been asked to set up a Kubernetes cluster to test the viability of a new application.
Task
You must use kubeadm to perform this task. Any kubeadm invocations will require the use of the
--ignore-preflight-errors=all option.
* Configure the node ik8s-master-O as a master node. .
* Join the node ik8s-node-o to the cluster.

Answer:

Explanation:
See the solution below.
Explanation
solution
You must use the kubeadm configuration file located at /etc/kubeadm.conf when initializingyour cluster.
You may use any CNI plugin to complete this task, but if you don't have your favourite CNI plugin's manifest URL at hand, Calico is one popular option: https://docs.projectcalico.org/v3.14/manifests/calico.yaml Docker is already installed on both nodes and has been configured so that you can install the required tools.

 

NEW QUESTION 47
Fix a node that shows as non-ready

  • A. Kubectl get nodes
    // Check which node shows a not ready
    kubectl describe nodes "node-name"
    // Login to the node which shows as not ready and check the
    systemctl start kubelet / docker
    // Verify
    ps -auxxww | grep -i "process-name"
    kubectl get nodes
  • B. Kubectl get nodes
    // Check which node shows a not ready
    kubectl describe nodes "node-name"
    // Login to the node which shows as not ready and check the
    process for kubelet, docker , kube-proxy.
    // systemctl status kubelet (or) ps -aux | grep -i "processname"
    // If the process is not started, then start using
    systemctl start kubelet / docker
    // Verify
    ps -auxxww | grep -i "process-name"
    kubectl get nodes

Answer: B

 

NEW QUESTION 48
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:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 B.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 D.JPG

 

NEW QUESTION 49
Create a pod as follows:
* Name: non-persistent-redis
* container Image: redis
* Volume with name: cache-control
* Mount path: /data/redis
The pod should launch in the staging namespace and the volume must not be persistent.

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 50
Create a busybox pod that runs the command "env" and save the output to "envpod" file

Answer:

Explanation:
See the solution below.
Explanation
kubectl run busybox --image=busybox --restart=Never --rm -it -- env > envpod.yaml

 

NEW QUESTION 51
Create a deployment as follows:
* Name: nginx-random
* Exposed via a service nginx-random
* Ensure that the service & pod are accessible via their respective DNS records
* The container(s) within any pod(s) running as a part of this deployment should use the nginx Image Next, use the utility nslookup to look up the DNS records of the service & pod and write the output to
/opt/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.

Answer:

Explanation:
See the solution below.
Explanation
Solution:


 

NEW QUESTION 52
Create a redis pod and expose it on port 6379

  • A. kubectl run redis --image=redis --restart=Never --port=6379
    YAML File :
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: redis
    name: redis
    spec:
    containers:
    - image: redis
    name: redis
    ports:
    - containerPort: 6379
    Rt restartPolicy: Always
  • B. kubectl run redis --image=redis --restart=Never --port=6379
    YAML File :
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: redis
    name: redis
    spec:
    containers:
    ports:
    - containerPort: 6679
    Rt restartPolicy: Alwaysf

Answer: A

 

NEW QUESTION 53
List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error-logs"

Answer:

Explanation:
See the solution below.
Explanation
Kubectl logs frontend | grep -i "started" > /opt/error-logs

 

NEW QUESTION 54
List all the pods sorted by name

Answer:

Explanation:
kubect1 get pods --sort-by=.metadata.name

 

NEW QUESTION 55
......

Get instant access to CKA practice exam questions: https://drive.google.com/open?id=1LMFc2bMvqBFF-wEYADnNOrB6Tm00jWGX

The best CKA exam study material and preparation tool is here: https://www.vce4dumps.com/CKA-valid-torrent.html