πŸ”

CKA β€” questions

Page 2 of 2 Β· 23 total questions.

Topic 1 Β· Question 21

SIMULATION - Task - Schedule a pod as follows: β€’ Name: nginx-kusc00401 β€’ Image: nginx β€’ Node selector: disk=spinning

Exhibit 1 for question 21Exhibit 2 for question 21
    Reveal solution & explanation
    Suggested solution
    kubectl run nginx-kusc00401 --image=nginx --dry-run=client -o yaml > pod.yaml
    # Add under spec: nodeSelector: {disk: spinning}
    kubectl apply -f pod.yaml

    nodeSelector restricts the Pod to a node carrying the disk=spinning label.

    Topic 1 Β· Question 22

    SIMULATION - Task - Scale the deployment guestbook to 5 pods.

    Exhibit 1 for question 22Exhibit 2 for question 22
      Reveal solution & explanation
      Suggested solution
      kubectl scale deployment guestbook --replicas=5
      kubectl get deployment guestbook

      Scaling updates the guestbook deployment's desired replica count to five.

      Topic 1 Β· Question 23

      SIMULATION - Task - Create a persistent volume with name app-data, of capacity 2Gi and access mode ReadWriteOnce. The type of volume is hostPath and its location is /srv/app-data.

      Exhibit 1 for question 23Exhibit 2 for question 23
        Reveal solution & explanation
        Suggested solution
        cat <<'EOF' | kubectl apply -f -
        apiVersion: v1
        kind: PersistentVolume
        metadata: {name: app-data}
        spec:
          capacity: {storage: 2Gi}
          accessModes: [ReadWriteOnce]
          hostPath: {path: /srv/app-data}
        EOF

        The PersistentVolume provides the requested hostPath capacity with ReadWriteOnce access.

        Showing questions 21–23 of 23 Β· Page 2 of 2