Linux Foundation CKAテストエンジン練習テスト問題、試験問題集 [Q18-Q39]

Share

Linux Foundation CKAテストエンジン練習テスト問題、試験問題集

100%無料CKA日常練習試験には68問があります


Linux Foundation CKA(Certified Kubernetes Administrator)プログラム試験は、Kubernetesで作業するシステム管理者と開発者のスキルと知識をテストするために設計された認定試験です。 Kubernetesは、IT業界で急速に人気を博しているオープンソースのコンテナオーケストレーションツールです。 Kubernetesクラスターを展開および管理できる熟練した専門家に対する需要の増加により、CKA試験は、この分野でのキャリアを前進させようとしている人にとって人気のある認定となりました。

 

質問 # 18
Get the memory and CPU usage of all the pods and find out top 3 pods which have the highest usage and put them into the cpuusage.txt file

  • A. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -8
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 6 --
    numeric | head -6 > cpu-usage.txt
    // verify
    cat cpu-usage.txt
  • B. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3 > cpu-usage.txt
    // verify
    cat cpu-usage.txt

正解:B


質問 # 19
Check the image version in pod without the describe command

正解:

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


質問 # 20
Create a pod with image nginx called nginx and allow traffic on port 80

正解:

解説:
kubectl run nginx --image=nginx --restart=Never --port=80


質問 # 21
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.

正解:

解説:
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


質問 # 22
Create PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteMany, storageClassName manual, and volume at /mnt/data and Create a PersistentVolumeClaim of at least 3Gi storage and access mode ReadWriteOnce and verify

  • A. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: manual
    capacity:
    storage: 10Gi
    accessModes:
    - ReadWriteMany
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    vim task-pvc-volume.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: task-pv-claim
    spec:
    storageClassName: manual
    accessModes:
    - ReadWriteMany
    resources:
    requests:
    storage: 3Gi
    kubectl apply -f task-pvc-volume.yaml
    //Verify
    Kuk kubectl get pvc
  • B. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: manual
    capacity:
    storage: 10Gi
    accessModes:
    - ReadWriteMany
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    vim task-pvc-volume.yaml
    apiVersion: v1
    - ReadWriteMany
    resources:
    requests:
    storage: 3Gi
    kubectl apply -f task-pvc-volume.yaml
    //Verify
    Kuk kubectl get pvc

正解:A


質問 # 23
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:
    - 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
  • 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:
    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


質問 # 24
Create a deployment spec file that will:
Launch 7 replicas of the nginx Image with the label app_runtime_stage=dev deployment name: kual00201 Save a copy of this spec file to /opt/KUAL00201/spec_deployment.yaml (or /opt/KUAL00201/spec_deployment.json).
When you are done, clean up (delete) any new Kubernetes API object that you produced during this task.

正解:

解説:
solution


質問 # 25
Create a file:
/opt/KUCC00302/kucc00302.txt that lists all pods that implement service in namespace development.
The format of the file should be one pod name per line.

正解:

解説:
See the solution below.
Explanation
solution



質問 # 26
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.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
  • 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.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

正解:A


質問 # 27
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

正解:

解説:
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


質問 # 28
List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error-logs"

正解:

解説:
Kubectl logs frontend | grep -i "started" > /opt/error-logs


質問 # 29
Check the history of deployment

正解:

解説:
kubectl rollout history deployment webapp


質問 # 30
Create a pod that having 3 containers in it? (Multi-Container)

  • A. image=nginx, image=redis, image=consul
    Name 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 container
    section for rest of the images
    kubectl run multi-container --generator=run-pod/v1 --image=nginx --
    dry-run -o yaml > multi-container.yaml
    # then
    vim multi-container.yaml
    labels:
    run: multi-container
    name: multi-container
    spec:
    containers:
    - image: nginx
    name: nginx-container
    - image: redis
    name: consul-container
    restartPolicy: Always
  • B. image=nginx, image=redis, image=consul
    Name 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 container
    section for rest of the images
    kubectl run multi-container --generator=run-pod/v1 --image=nginx --
    dry-run -o yaml > multi-container.yaml
    # then
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-container
    name: multi-container
    spec:
    containers:
    - image: nginx
    name: nginx-container
    - image: redis
    name: redis-container
    - image: consul
    name: consul-container
    restartPolicy: Always

正解:B


質問 # 31
Create a pod with environment variables as var1=value1.Check the environment variable in pod

  • A. kubectl run nginx --image=nginx --restart=Never --env=var1=value1
    # then
    kubectl exec -it nginx -- env
    # or
    kubectl exec -it nginx -- sh -c 'echo $var1'
    # or
    kubectl describe po nginx | grep value1
  • B. kubectl run nginx --image=nginx --restart=Never --env=var1=value1
    # then
    kubectl exec -it nginx -- env
    # or
    kubectl describe po nginx | grep value1

正解:A


質問 # 32
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

正解:

解説:
solution



質問 # 33
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
    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
  • 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
    systemctl start kubelet / docker
    // Verify
    ps -auxxww | grep -i "process-name"
    kubectl get nodes

正解:A


質問 # 34
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.

正解:

解説:
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


質問 # 35
Create a nginx pod that will be deployed to node with the label
"gpu=true"

  • A. kubectl run nginx --image=nginx --restart=Always --dry-run -o
    yaml > nodeselector-pod.yaml
    // add the nodeSelector like below and create the pod
    kubectl apply -f nodeselector-pod.yaml
    vim nodeselector-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: nginx
    spec:
    nodeSelector:
    gpu: true
    containers:
    - image: nginx
    name: nginx
    restartPolicy: Always
    kubectl apply -f nodeselector-pod.yaml
    //Verify
    kubectl get no -show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors
  • B. kubectl run nginx --image=nginx --restart=Always --dry-run -o
    yaml > nodeselector-pod.yaml
    // add the nodeSelector like below and create the pod
    kubectl apply -f nodeselector-pod.yaml
    vim nodeselector-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: nginx
    spec:
    nodeSelector:
    gpu: true
    yaml
    //Verify
    kubectl get no -show-labels
    kubectl get po
    kubectl describe po nginx | grep Node-Selectors

正解:A


質問 # 36
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.

正解:

解説:
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.


質問 # 37
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 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

正解:

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

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

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


質問 # 38
Create a redis pod named "test-redis" and exec into that pod and create a file named "test-file.txt" with the text 'This is called the test file' in the path /data/redis and open another tab and exec again with the same pod and verifies file exist in the same path.

  • A. vim test-redis.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: test-redis
    spec:
    containers:
    - name: redis
    image: redis
    ports:
    - containerPort: 6379
    volumeMounts:
    - mountPath: /data/redis
    name: redis-storage
    volumes:
    kubectl exec -it test-redis /bin/sh
    cd /data/redis
    echo 'This is called the test file' > file.txt
    //open another tab
    kubectl exec -it test-redis /bin/sh
    cat /data/redis/file.txt
  • B. vim test-redis.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: test-redis
    spec:
    containers:
    - name: redis
    image: redis
    ports:
    - containerPort: 6379
    volumeMounts:
    - mountPath: /data/redis
    name: redis-storage
    volumes:
    - name: redis-storage
    emptyDir: {}
    kubectl apply -f redis-pod-vol.yaml
    // first terminal
    kubectl exec -it test-redis /bin/sh
    cd /data/redis
    echo 'This is called the test file' > file.txt
    //open another tab
    kubectl exec -it test-redis /bin/sh
    cat /data/redis/file.txt

正解:B


質問 # 39
......


Linux Foundation Certified Kubernetes Administrator(CKA)Program Examは、Kubernetesクラスタを管理する能力と知識を検証するプロフェッショナル認定資格です。Kubernetesは、コンテナ化されたアプリケーションの展開、スケーリング、管理を自動化するオープンソースのコンテナオーケストレーションプラットフォームです。コンテナ化された環境でのアプリケーションの展開と管理を簡素化するため、産業界で広く使用されています。CKA認定は、インフラストラクチャを管理するためにKubernetesの専門家を探している企業にとって高く求められる認定資格です。

 

有効な問題最新版を試そうCKAテスト解釈CKA有効な試験ガイド:https://jp.fast2test.com/CKA-premium-file.html

CKA試験資料Linux Foundation学習ガイド:https://drive.google.com/open?id=1M1XIQ0tgHZA8nIM5OjEF8T7R6gdm1bln


弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

我々の働いている時間: ( GMT 0:00-15:00 )
月曜日から土曜日まで

サポート: 現在連絡 

English Deutsch 繁体中文 한국어