Get CKA Braindumps CKA Real Exam Questions Linux Foundation CKA Actual Questions and Braindumps NEW QUESTION # 26 Score: 4%TaskSchedule a pod as follows:* Name: nginx-kusc00401* Image: nginx* Node selector: disk=ssd Answer: Explanation:Solution:#yamlapiVersion: v1kind: Podmetadata:name: nginx-kusc00401spec:containers:- name: nginximage: nginximagePullPolicy: IfNotPresentnodeSelector:disk: spinning#kubectl [...]

Get CKA Braindumps & CKA Real Exam Questions [Q26-Q48]

Share

Get CKA Braindumps & CKA Real Exam Questions

Linux Foundation CKA Actual Questions and Braindumps

NEW QUESTION # 26
Score: 4%

Task
Schedule a pod as follows:
* Name: nginx-kusc00401
* Image: nginx
* Node selector: disk=ssd

Answer:

Explanation:
Solution:
#yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-kusc00401
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
nodeSelector:
disk: spinning
#
kubectl create -f node-select.yaml


NEW QUESTION # 27
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.

Answer:

Explanation:
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


NEW QUESTION # 28
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 # 29
Update the deployment with the image version 1.16.1 and verify the image and check the rollout history

Answer:

Explanation:
kubectl set image deploy/webapp nginx=nginx:1.16.1 kubectl describe deploy webapp | grep Image kubectl rollout history deploy webapp


NEW QUESTION # 30
Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to theexisting pod namedfront-end.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 31
Create a pod as follows:
Name: mongo
Using Image: mongo
In a new Kubernetes namespace named: my-website

Answer:

Explanation:
solution


NEW QUESTION # 32
On the NGFW, how can you generate and block a private key from export and thus harden your security posture and prevent rogue administrators or other bad actors from misusing keys?

  • A. 1) Select Device > Certificate Management > Certificates >Device > Certificates
    2) Import the certificate.
    3) Select Import Private Key
    4) Click Generate to generate the new certificate.
  • B. 1) Select Device > Certificate Management > Certificates Device > Certificates
    2) Generate the certificate.
    3) Select Block Private Key Export.
    4) Click Generate to generate the new certificate.
  • C. 1) Select Device > Certificates
    2) Select Certificate Profile.
    3) Generate the certificate
    4) Select Block Private Key Export.
  • D. 1) Select Device > Certificates
    2) Select Certificate Profile
    3) Generate the certificate
    4) Select Block Private Key Export

Answer: D


NEW QUESTION # 33
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
F:\Work\Data Entry Work\Data Entry\20200827\CKA\2 C.JPG


NEW QUESTION # 34
Check the history of deployment

Answer:

Explanation:
kubectl rollout history deployment webapp


NEW QUESTION # 35
List "nginx-dev" and "nginx-prod" pod and delete those pods

  • A. kubect1 get pods -o wide
    kubectl delete po "nginx-dev" kubectl delete po "nginx-prod"
  • B. kubect1 get pods -o wide
    kubectl delete po "nginx-dev" kubectl delete po "nginx-prod"

Answer: A


NEW QUESTION # 36
Add a taint to node "worker-2" with effect as "NoSchedule" and
list the node with taint effect as "NoSchedule"

  • A. // Add taint to node "worker-2"
    kubectl taint nodes worker-2 key=value:NoSchedule
    .items[*]}{.metadata.name} {.spec.taints[?(
    @.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
    {print $0}'
  • B. // Add taint to node "worker-2"
    kubectl taint nodes worker-2 key=value:NoSchedule
    // Verify
    // Using "custom-coloumns" , you can customize which coloumn to
    be printed
    kubectl get nodes -o customcolumns=NAME:.metadata.name,TAINTS:.spec.taints --no-headers
    // Using jsonpath
    kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name} {.spec.taints[?(
    @.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
    {print $0}'

Answer: B


NEW QUESTION # 37
Create a pod with image nginx called nginx and allow traffic on port 80

Answer:

Explanation:
See the solution below.
Explanation
kubectlrun nginx --image=nginx --restart=Never --port=80


NEW QUESTION # 38
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 # 39
Create a pod with init container which waits for a service called "myservice" to be created. Once init container completes, the myapp-container should start and print a message "The app is running" and sleep for 3600 seconds.

  • A. vim multi-container-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: myapp-pod
    labels:
    app: myapp
    spec:
    containers:
    - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep
    3600']
    initContainers:
    - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', "until nslookup myservice.$(cat
    /var/run/secrets/kubernetes.io/serviceaccount/namespace).s
    vc.cluster.local; do echo waiting for myservice; sleep 2;
    done"]
    // Check whether service called "myservice" exists
    kubectl get svc
    Note: Pod will not start if service called "myservice" doesn't
    exist.
    // Now, Create the pod
    kubectl apply -f multi-container-pod.yaml
  • B. vim multi-container-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: myapp-pod
    labels:
    app: myapp
    spec:
    containers:
    - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep
    3600']
    initContainers:
    - name: init-myservice
    done"]
    // Check whether service called "myservice" exists
    kubectl get svc
    Note: Pod will not start if service called "myservice" doesn't
    exist.
    // Now, Create the pod
    kubectl apply -f multi-container-pod.yaml

Answer: A


NEW QUESTION # 40
Create the nginx pod with version 1.17.4 and expose it on port 80

Answer:

Explanation:
kubectl run nginx --image=nginx:1.17.4 --restart=Never -- port=80


NEW QUESTION # 41
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 # 42
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:
solution



NEW QUESTION # 43
Create a pod with environment variables as var1=value1.Check the environment variable in pod

Answer:

Explanation:
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


NEW QUESTION # 44
Create 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

  • A. 0
  • B. Pending
  • C. 1

Answer: B


NEW QUESTION # 45
Create a redis pod, and have it use a non-persistent storage
Note: In exam, you will have access to kubernetes.io site,
Refer : https://kubernetes.io/docs/tasks/configure-pod-container/configurevolume-storage/

  • A. apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    containers:
    - name: redis
    image: redis
    volumeMounts:
    - containerPort: 6379
    volumes:
    - name: redis-storage
    emptyDir: {}
  • B. apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    containers:
    - name: redis
    image: redis
    volumeMounts:
    - name: redis-storage
    mountPath: /data/redis
    ports:
    - containerPort: 6379
    volumes:
    - name: redis-storage
    emptyDir: {}

Answer: B


NEW QUESTION # 46
Create an nginx pod and list the pod with different levels of verbosity

Answer:

Explanation:
See the solution below.
Explanation
// create a pod
kubectl run nginx --image=nginx --restart=Never --port=80
// List the pod with different verbosity
kubectl get po nginx --v=7
kubectl get po nginx --v=8
kubectl get po nginx --v=9


NEW QUESTION # 47
Create an nginx pod and list the pod with different levels of verbosity

Answer:

Explanation:
// create a pod
kubectl run nginx --image=nginx --restart=Never --port=80
// List the pod with different verbosity
kubectl get po nginx --v=7
kubectl get po nginx --v=8
kubectl get po nginx --v=9


NEW QUESTION # 48
......

CKA Dumps To Pass Linux Foundation Exam in 24 Hours - GuideTorrent: https://www.guidetorrent.com/CKA-pdf-free-download.html

Buy Latest CKA Exam Q&A PDF - One Year Free Update: https://drive.google.com/open?id=1joR4N8xrKd823o93FDtNFE2Q8TD2FylB