Ace CKA Certification with 68 Actual Questions [Q34-Q50]

Share

Ace CKA Certification with 68 Actual Questions

PASS Linux Foundation CKA EXAM WITH UPDATED DUMPS


Levels of Certification

The CNCF Certified Kubernetes Administrator exam conducts 4 levels of certification covering different areas of Cloud Native Computing. Charges vary by level with the highest level of certification being the only one that is required in order to obtain the CNCF Certified Kubernetes Administrator certification. Subjects to be tested for each level are listed below. Future changes to the certification levels and pricing are possible.

 

NEW QUESTION # 34
From the pod label name=cpu-utilizer, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/KUTR00102/KUTR00102.txt (which already exists).

Answer:

Explanation:
solution


NEW QUESTION # 35
Check the Image version of nginx-dev pod using jsonpath

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get po nginx-dev -o
jsonpath='{.spec.containers[].image}{"\n"}'


NEW QUESTION # 36
Delete the pod without any delay (force delete)

Answer:

Explanation:
Kubect1 delete po "POD-NAME" --grace-period=0 --force


NEW QUESTION # 37
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 # 38
List all service account and create a service account called "admin"

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

Answer: A


NEW QUESTION # 39
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 # 40
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 # 41
Score: 4%

Task
Check to see how many nodes are ready (not including nodes tainted NoSchedule ) and write the number to /opt/KUSC00402/kusc00402.txt.

Answer:

Explanation:
Solution:
kubectl describe nodes | grep ready|wc -l
kubectl describe nodes | grep -i taint | grep -i noschedule |wc -l
echo 3 > /opt/KUSC00402/kusc00402.txt
#
kubectl get node | grep -i ready |wc -l
# taints、noSchedule
kubectl describe nodes | grep -i taints | grep -i noschedule |wc -l
#
echo 2 > /opt/KUSC00402/kusc00402.txt


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

  • A. // 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=6
    kubectl get po nginx --v=9
  • B. // 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

Answer: B


NEW QUESTION # 43
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 # 44
Create a pod that echo "hello world" and then exists. Have the pod deleted automatically when it's completed

Answer:

Explanation:
kubectl run busybox --image=busybox -it --rm --restart=Never --
/bin/sh -c 'echo hello world'
kubectl get po # You shouldn't see pod with the name "busybox"


NEW QUESTION # 45
List the nginx pod with custom columns POD_NAME and POD_STATUS

Answer:

Explanation:
See the solution below.
Explanation
kubectl get po -o=custom-columns="POD_NAME:.metadata.name,
POD_STATUS:.status.containerStatuses[].state"


NEW QUESTION # 46
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
    - 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
  • 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
    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

Answer: B


NEW QUESTION # 47
Set the node namedek8s-node-1asunavailable and reschedule all thepods running on it.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 48
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



NEW QUESTION # 49
Apply the autoscaling to this deployment with minimum 10 and maximum 20 replicas and target CPU of 85% and verify hpa is created and replicas are increased to 10 from 1

Answer:

Explanation:
kubectl autoscale deploy webapp --min=10 --max=20 --cpu percent=85 kubectl get hpa kubectl get pod -l app=webapp


NEW QUESTION # 50
......

CKA Questions PDF [2023] Use Valid New dump to Clear Exam: https://dumpstorrent.dumpsking.com/CKA-testking-dumps.html