[Apr 01, 2023] Free Linux Foundation CKA Exam Questions & Answer [Q22-Q43]

Share

[Apr 01, 2023] Free Linux Foundation CKA Exam Questions and Answer

Verified CKA dumps Q&As Latest CKA Download

NEW QUESTION 22
Score: 7%

Task
Create a new nginx Ingress resource as follows:
* Name: ping
* Namespace: ing-internal
* Exposing service hi on path /hi using service port 5678

Answer:

Explanation:
See the solution below.
Explanation
Solution:
vi ingress.yaml
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ping
namespace: ing-internal
spec:
rules:
- http:
paths:
- path: /hi
pathType: Prefix
backend:
service:
name: hi
port:
number: 5678
#
kubectl create -f ingress.yaml

 

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

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 24
Create a NetworkPolicy which denies all ingress traffic

  • A. apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: default-deny
    spec:
    podSelector: {}
    policyTypes:
    - Ingress
  • B. apiVersion: networking.k8s.io/v1
    kind: NetworkPolicy
    metadata:
    name: default-deny
    spec:
    podSelector: ()
    policyTypes:
    - Ingress

Answer: A

 

NEW QUESTION 25
What are the differences between using a service versus using an application for Security Policy match?

  • A. There are no differences between "service" or "application." Use of an "application simplifies configuration by allowing use of a friendly application name instead of port numbers.
  • B. Use of a "service" enables the firewall to take action after enough packets allow for App-ID identification
  • C. Use of a "service" enables the firewall to take immediate action with the first observed packet based on port numbers. Use of an "application allows the firewall to take immediate action if the port being used is a member of the application standard port list
  • D. Use of a "service" enables the firewall to take immediate action with the first observed packet based on port numbers. Use of an application allows the firewall to take action after enough packets allow for App-ID identification regardless of the ports being used

Answer: C

 

NEW QUESTION 26
Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.

Answer:

Explanation:
See the solution below.
Explanation
kubectl create namespace development
kubectl run nginx --image=nginx --restart=Never -n development

 

NEW QUESTION 27
// Create a configmap
kubectl create configmap redis-config --from-file=/opt/redisconfig
// Verify
kubectl get configmap redis-config -o yaml
// first run this command to save the pod yml
kubectl run redis-pod --image=redis --restart=Always --dry-run
-o yaml > redis-pod.yml
// edit the yml to below file and create
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
env:
- name: MASTER
value: "true"
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /redis-master-data
name: data
- mountPath: /redis-master
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: example-redis-config

  • A. items:
    - key: redis-config
    path: redis.conf
    cf
    kk kubectl apply -f redis-pod.yml
    // // Verify
    K kubectl exec -it redis - cat /redis-master-data/redis.conf
  • B. items:
    - key: redis-config
    path: redis.conf
    cf
    // // Verify
    K kubectl exec -it redis - cat /redis-master-data/redis.conf

Answer: A

 

NEW QUESTION 28
Schedule a pod as follows:
* Name: nginx-kusc00101
* Image: nginx
* Node selector: disk=ssd

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 29
From the pod labelname=cpu-utilizer, find podsrunning high CPU workloads and write the name of the pod consumingmost CPU to thefile/opt/KUTR00102/KUTR00102.txt(which already exists).

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 30
Score: 7%

Task
First, create a snapshot of the existing etcd instance running at https://127.0.0.1:2379, saving the snapshot to
/srv/data/etcd-snapshot.db.

Next, restore an existing, previous snapshot located at /var/lib/backup/etcd-snapshot-previo us.db

Answer:

Explanation:
See the solution below.
Explanation
Solution:
#backup
ETCDCTL_API=3 etcdctl --endpoints="https://127.0.0.1:2379" --cacert=/opt/KUIN000601/ca.crt
--cert=/opt/KUIN000601/etcd-client.crt --key=/opt/KUIN000601/etcd-client.key snapshot save
/etc/data/etcd-snapshot.db
#restore
ETCDCTL_API=3 etcdctl --endpoints="https://127.0.0.1:2379" --cacert=/opt/KUIN000601/ca.crt
--cert=/opt/KUIN000601/etcd-client.crt --key=/opt/KUIN000601/etcd-client.key snapshot restore
/var/lib/backup/etcd-snapshot-previoys.db

 

NEW QUESTION 31
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 thestagingnamespace and the volumemust notbe persistent.

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 32
Create a secret mysecret with values user=myuser and password=mypassword

  • A. kubectl create secret generic my-secret --fromliteral=username=user --from-literal=password=mypassword
    // Verify
    kubectl get secret --all-namespaces
    kubectl get secret generic my-secret -o yaml
  • B. kubectl create secret generic my-secret --fromliteral=username=user --from-literal=password=mypassword
    // Verify
    kubectl get secret generic my-secret -o yaml

Answer: A

 

NEW QUESTION 33
Get the DNS records for the service and pods for the deployment redis and the put the value in /tmp/dnsrecordpod and /tmp/dnsrecord-service

  • A. // Get Pod Ip
    kubectl get po -o wide
    // Get Service Name
    kubectl get svc
    // Create a temporary pod and execute nslookup command
    Note: POD IP format should be a-b-c-d and not a.b.c.d
    kubectl run busybox --image=busybox:1.28 --restart=Never -
    -rm -it -- nslookup 192-168-0-69.default.pod >
    /tmp/dnsrecord-pod
    kubectl run busybox1 --image=busybox:1.26 --restart=Never
    --rm -it -- nslookup redis-service > /tmp/dnsrecordservice
    //Verify
    cat /tmp/dnsrecord-pod
    Server: 10.2.8.10
    Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod Address 1: 192.168.0.69 192-166-0-69.redis service.default.svc.cluster.local cat /tmp/dnsrecord-pod Server: 10.2.0.10 Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod Address 1: 192.168.0.69 192-168-0-69.redis service.default.svc.cluster.local
  • B. // Get Pod Ip
    kubectl get po -o wide
    // Get Service Name
    kubectl get svc
    // Create a temporary pod and execute nslookup command
    Note: POD IP format should be a-b-c-d and not a.b.c.d
    kubectl run busybox --image=busybox:1.28 --restart=Never -
    -rm -it -- nslookup 192-168-0-69.default.pod >
    /tmp/dnsrecord-pod
    kubectl run busybox1 --image=busybox:1.28 --restart=Never
    --rm -it -- nslookup redis-service > /tmp/dnsrecordservice
    //Verify
    cat /tmp/dnsrecord-pod
    Server: 10.2.0.10
    Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod Address 1: 192.168.0.69 192-168-0-69.redis service.default.svc.cluster.local cat /tmp/dnsrecord-pod Server: 10.2.0.10 Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod Address 1: 192.168.0.69 192-168-0-69.redis service.default.svc.cluster.local

Answer: B

 

NEW QUESTION 34
List all persistent volumes sorted bycapacity, saving the fullkubectloutput to
/opt/KUCC00102/volume_list. Usekubectl 's own functionality forsorting the output, and do not manipulate it any further.

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 35
Create a Kubernetes secret asfollows:
* Name: super-secret
* password: bob
Create a pod namedpod-secrets-via-file Image, which mounts a secret namedsuper-secretat
/secrets.
Create a second pod namedpod-secrets-via-env Image, which exportspasswordas CONFIDENTIAL

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 36
Score: 4%

Task
Create a pod named kucc8 with a single app container for each of the following images running inside (there may be between 1 and 4 images specified): nginx + redis + memcached .

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl run kucc8 --image=nginx --dry-run -o yaml > kucc8.yaml
# vi kucc8.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
name: kucc8
spec:
containers:
- image: nginx
name: nginx
- image: redis
name: redis
- image: memcached
name: memcached
- image: consul
name: consul
#
kubectl create -f kucc8.yaml
#12.07

 

NEW QUESTION 37
Configure the kubelet systemd- managed service, on the node labelled with name=wk8s-node-1, to launch a pod containing a single container of Image httpd named webtool automatically. Any spec files required should be placed in the /etc/kubernetes/manifests directory on the node.
You can ssh to the appropriate node using:
[student@node-1] $ ssh wk8s-node-1
You can assume elevated privileges on the node with the following command:
[student@wk8s-node-1] $ | sudo -i

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 C.JPG

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

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 E.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 F.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 G.JPG

 

NEW QUESTION 38
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 39
List all the pods sorted by name

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get pods --sort-by=.metadata.name

 

NEW QUESTION 40
Create a Pod with main container busybox and which executes this
"while true; do echo 'Hi I am from Main container' >>
/var/log/index.html; sleep 5; done" and with sidecar container
with nginx image which exposes on port 80. Use emptyDir Volume
and mount this volume on path /var/log for busybox and on path
/usr/share/nginx/html for nginx container. Verify both containers
are running.

  • A. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods
  • B. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - name: var-logs
    emptyDir: {}
    containers:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    - containerPort: 80
    volumeMounts:
    - name: var-logs
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods

Answer: B

 

NEW QUESTION 41
List all persistent volumes sorted by capacity, saving the full kubectl output to
/opt/KUCC00102/volume_list. Use kubectl 's own functionality for sorting the output, and do not manipulate it any further.

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 42
Get the pods with label env=dev and output the labels

Answer:

Explanation:
kubectl get pods -l env=dev --show-labels

 

NEW QUESTION 43
......


Linux Foundation CKA Exam Syllabus Topics:

TopicDetails
Topic 1
  • Understand deployments and how to perform rolling update and rollbacks
  • Manage a highly-available Kubernetes cluster
Topic 2
  • Provision underlying infrastructure to deploy a Kubernetes cluster
  • Manage container stdout & stderr logs
Topic 3
  • Perform a version upgrade on a Kubernetes cluster using Kubeadm
  • Understand volume mode, access modes and reclaim policies for volumes
Topic 4
  • Understand how resource limits can affect Pod scheduling
  • Use ConfigMaps and Secrets to configure applications
Topic 5
  • Choose an appropriate container network interface plugin
  • Know how to configure applications with persistent storage
Topic 6
  • Awareness of manifest management and common templating tools
  • Understand storage classes, persistent volumes
Topic 7
  • Understand connectivity between Pods
  • Troubleshoot application failure
  • Use Kubeadm to install a basic cluster
Topic 8
  • Understand ClusterIP, NodePort, LoadBalancer service types and endpoints
  • Understand persistent volume claims primitive
Topic 9
  • Understand host networking configuration on the cluster nodes
  • Evaluate cluster and node logging
Topic 10
  • Know how to use Ingress controllers and Ingress resources
  • Understand how to monitor applications
Topic 11
  • Manage role based access control (RBAC)
  • Know how to scale applications
  • Understand the primitives used to create robust

 

Use Real Dumps - 100% Free CKA Exam Dumps: https://www.itexamdownload.com/CKA-valid-questions.html

Updated 100% Cover Real CKA Exam Questions - 100% Pass Guarantee: https://drive.google.com/open?id=1PIFbcs67j6K6Dnns3wEvmrFEqi0_8wT8