This page was exported from Exam for engine [ http://blog.test4engine.com ] Export date:Mon Nov 18 2:29:52 2024 / +0000 GMT ___________________________________________________ Title: Free Dec-2022 UPDATED Linux Foundation CKA Certification Exam Dumps is Online [Q36-Q59] --------------------------------------------------- Free Dec-2022 UPDATED Linux Foundation CKA Certification Exam Dumps is Online Linux Foundation Exam 2022 CKA Dumps Updated Questions QUESTION 36Create a pod with environment variables as var1=value1.Check the environment variable in pod  kubectl run nginx –image=nginx –restart=Never –env=var1=value1# thenkubectl exec -it nginx — env# orkubectl describe po nginx | grep value1  kubectl run nginx –image=nginx –restart=Never –env=var1=value1# thenkubectl exec -it nginx — env# orkubectl exec -it nginx — sh -c ‘echo $var1’# orkubectl describe po nginx | grep value1 QUESTION 37List 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. See the solution below.ExplanationsolutionQUESTION 38Get list of all pods in all namespaces and write it to file “/opt/pods-list.yaml” See the solution below.Explanationkubectl get po -all-namespaces > /opt/pods-list.yamlQUESTION 39Delete the above pod and create again from the same yaml fileand verifies there is no “test-file.txt” in the path /data/redis(Since non-persistent storage “emptyDir” is used). kubectl delete pod test-redis kubectl create -f test-redis.yaml kubectl exec -it test-redis /bin/sh cat /data/redis/file.txt // file doesn’t existQUESTION 40Create a namespace called ‘development’ and a pod with image nginx called nginx on this namespace. kubectl create namespace development kubectl run nginx –image=nginx –restart=Never -n developmentQUESTION 41Create a NetworkPolicy which denies all ingress traffic  apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: default-denyspec:podSelector: {}policyTypes:– Ingress  apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata:name: default-denyspec:podSelector: ()policyTypes:– Ingress QUESTION 42Score: 13%TaskA 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. See the solution below.ExplanationSolution:sudo -isystemctl status kubeletsystemctl start kubeletsystemctl enable kubeletQUESTION 43Monitor the logs of pod foo and:* Extract log lines corresponding unable-to-access-website* Write them to/opt/KULM00201/foo See the solution below.ExplanationsolutionQUESTION 44Create 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 containerwith nginx image which exposes on port 80. Use emptyDir Volumeand mount this volume on path /var/log for busybox and on path/usr/share/nginx/html for nginx container. Verify both containersare running.  // create an initial yaml file with thiskubectl run multi-cont-pod –image=busbox –restart=Never —dry-run -o yaml > multi-container.yaml// edit the yml as below and create itkubectl create -f multi-container.yamlvim multi-container.yamlapiVersion: v1kind: Podmetadata:labels:run: multi-cont-podname: multi-cont-podspec:volumes:– name: var-logsemptyDir: {}containers:– image: busyboxcommand: [“/bin/sh”]args: [“-c”, “while true; do echo ‘Hi I am from Maincontainer’ >> /var/log/index.html; sleep 5;done”]name: main-containervolumeMounts:– name: var-logsmountPath: /var/log– image: nginxname: sidecar-containerports:– containerPort: 80volumeMounts:– name: var-logsmountPath: /usr/share/nginx/htmlrestartPolicy: Never// Create Podkubectl apply -f multi-container.yaml//Verifykubectl get pods  // create an initial yaml file with thiskubectl run multi-cont-pod –image=busbox –restart=Never —dry-run -o yaml > multi-container.yaml// edit the yml as below and create itkubectl create -f multi-container.yamlvim multi-container.yamlapiVersion: v1kind: Podmetadata:labels:run: multi-cont-podname: multi-cont-podspec:volumes:– image: busyboxcommand: [“/bin/sh”]args: [“-c”, “while true; do echo ‘Hi I am from Maincontainer’ >> /var/log/index.html; sleep 5;done”]name: main-containervolumeMounts:– name: var-logsmountPath: /var/log– image: nginxname: sidecar-containerports:mountPath: /usr/share/nginx/htmlrestartPolicy: Never// Create Podkubectl apply -f multi-container.yaml//Verifykubectl get pods QUESTION 45Create a pod namedkucc8with asingle app container for each of thefollowing images running inside(there may be between 1 and 4images specified):nginx + redis + memcached. See the solution below.ExplanationsolutionQUESTION 46Update the deployment with the image version 1.16.1 and verify the image and check the rollout history kubectl set image deploy/webapp nginx=nginx:1.16.1 kubectl describe deploy webapp | grep Image kubectl rollout history deploy webappQUESTION 47List all the pods sorted by created timestamp kubect1 get pods–sort-by=.metadata.creationTimestampQUESTION 48Create 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.crtClient certificate: /opt/KUCM00302/etcd-client.crtClient key: Topt/KUCM00302/etcd-client.key solutionQUESTION 49Scale down the deployment to 1 replica kubectl scale deployment webapp -replicas=1 //Verify kubectl get deploy kubectl get po,rsQUESTION 50Create a hostPath PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteOnce, storageClassName manual, and volume at /mnt/data and verify  vim task-pv-volume.yamlapiVersion: v1kind: PersistentVolumemetadata:name: task-pv-volumelabels:type: localspec:storageClassName: “”capacity:storage: 5GiaccessModes:– ReadWriteOncehostPath:path: “/mnt/data”kubectl apply -f task-pv-volume.yaml//Verifykubectl get pvNAME CAPACITY ACCESSMODES RECLAIM POLICY STATUS CLAIMSTORAGECLASS REASON AGEtask-pv-volume 5Gi RWORetain Available3s  vim task-pv-volume.yamlapiVersion: v1kind: PersistentVolumemetadata:name: task-pv-volumelabels:type: localspec:storageClassName: “”capacity:storage: 5GiaccessModes:– ReadWriteOncehostPath:path: “/mnt/data”kubectl apply -f task-pv-volume.yaml//Verifykubectl get pvNAME CAPACITY ACCESSMODES RECLAIM POLICY STATUS CLAIMSTORAGECLASS REASON AGEtask-pv-volume 4Gi RWORetain Available8s QUESTION 51For 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.ContextAs 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.TaskYou 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. See the solution below.ExplanationsolutionYou 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.QUESTION 52Perform 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 See the solution below.ExplanationsolutionQUESTION 53Create a redis pod and mount “redis-config” as “redis.conf”inside redis container, name the config volume as “redis-volume”redis-config path – /opt/redis-config  1  2  Pending QUESTION 54Create and configure the servicefront-end-serviceso it’s accessiblethroughNodePortand routes to theexisting pod namedfront-end. See the solution below.ExplanationsolutionQUESTION 55Given a partially-functioning Kubernetes cluster, identify symptoms of failure on the cluster.Determine the node, the failing service, and take actions to bring up the failed service and restore the health of the cluster. Ensure that any changes are made permanently.You can ssh to the relevant I nodes (bk8s-master-0 or bk8s-node-0) using:[student@node-1] $ ssh <nodename>You can assume elevated privileges on any node in the cluster with the following command:[student@nodename] $ | sudo -i solutionQUESTION 56Score: 5%TaskMonitor the logs of pod bar and:* Extract log lines corresponding to error* Write them to /opt/KUTR00101/bar See the solution below.ExplanationSolution:kubectl logs bar | grep ‘unable-to-access-website’ > /opt/KUTR00101/bar cat /opt/KUTR00101/barQUESTION 57Create a pod that having 3 containers in it? (Multi-Container) image=nginx, image=redis, image=consulName nginx container as “nginx-container”Name redis container as “redis-container”Name consul container as “consul-container”Create a pod manifest file for a container and append containersection for rest of the imageskubectl run multi-container –generator=run-pod/v1 –image=nginx —dry-run -o yaml > multi-container.yaml# thenvim multi-container.yamlapiVersion: v1kind: Podmetadata:labels:run: multi-containername: multi-containerspec:containers:– image: nginxname: nginx-container– image: redisname: redis-container– image: consulname: consul-containerrestartPolicy: AlwaysQUESTION 58Create a Kubernetes secret as follows:Name: super-secretpassword: bobCreate a pod named pod-secrets-via-file, using the redis Image, which mounts a secret named super-secret at /secrets.Create a second pod named pod-secrets-via-env, using the redis Image, which exports password as CONFIDENTIAL solutionQUESTION 59Create and configure the service front-end-service so it’s accessible through NodePort and routes to the existing pod named front-end. solution Loading … Linux Foundation Certified CKA  Dumps Questions Valid CKA Materials: https://www.test4engine.com/CKA_exam-latest-braindumps.html --------------------------------------------------- Images: https://blog.test4engine.com/wp-content/plugins/watu/loading.gif https://blog.test4engine.com/wp-content/plugins/watu/loading.gif --------------------------------------------------- --------------------------------------------------- Post date: 2022-12-23 12:02:54 Post date GMT: 2022-12-23 12:02:54 Post modified date: 2022-12-23 12:02:54 Post modified date GMT: 2022-12-23 12:02:54