Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
Google Cloud Platform icon
Labs

CKA Practice Exam: Part 2

Managing storage is a challenge for most organizations. Kubernetes allows you to create persistent storage so the data is not lost when a pod is moved or deleted. In this portion of the practice exam, you will demonstrate your knowledge of `PersistentVolumes` and `PersistentVolumeClaims` in order to ensure data integrity. This will simulate a question you may see on the Certified Kubernetes Administrator (CKA) exam.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 23, 2025
Duration
1h 0m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create the `PersistentVolumeClaim`.
    1. Use the following command to check if there is already a 'web' namespace:
    kubectl get ns
    kubectl get pv
    
    1. Use the following command to create a PersistentVolumeClaim work from scratch or use a Kubernetes template file. Search the documentation :
    vi data-pvc.yaml #copy and paste from docs
    
    1. Update the file data-pvc.yaml with the following details:
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: data-pvc
      namespace: web
    spec:
      storageClassName: local-storage
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 256Mi
    
    1. Use the following command to create the PVC:
    kubectl apply -f data-pvc.yaml
    
  2. Challenge

    Create a pod mounting the volume and write data to the volume.
    1. Use the following command to create the YAML for a busybox pod:
    kubectl run data-pod --image=busybox:1.28 --restart=Never -o yaml --dry-run -- /bin/sh -c 'sleep 3600' > data-pod.yaml
    
    1. Use the following command to edit the data-pod.yaml file:
    vi data-pod.yaml
    
    1. Update the data-pod.yaml file as below:
    apiVersion: v1
    kind: Pod
    metadata:
      name: data-pod
      namespace: web
    spec:
      containers:
      - args:
        - /bin/sh
        - -c
        - sleep 3600
        image: busybox:1.28
        name: data-pod
        resources: {}
        volumeMounts: 
        - name: temp-data
          mountPath: /tmp/data
      dnsPolicy: ClusterFirst
      restartPolicy: Never
      volumes: 
      - name: temp-data
        persistentVolumeClaim:
          claimName: data-pvc
    
    1. Use the following command to create the pod:
    kubectl apply -f data-pod.yaml
    
    1. Use the following command to connect to the pod:
    kubectl exec -it data-pod -n web -- sh
    
    1. Use the following commands to confirm the environmant and to copy the contents of the etc/passwd file to /tmp/data:
    # ls -la /etc/passwd
    # ls -la /tmp/data/
    # cp /etc/passwd /tmp/data/passwd
    
    1. Use the following command to list the contents of /tmp/data:
    # ls /tmp/data/
    
  3. Challenge

    Delete the pod and create a new pod and view volume data.
    1. Use the following command to delete the pod:

      kubectl delete po data-pod -n web
      
    2. Use the following command to modify the pod YAML:

      vi data-pod.yaml
      
    3. Change the following line in the data-pod.yaml file:

      name: data-pod2
      
    4. Use the following command to create a new pod:

      kubectl apply -f data-pod.yaml
      
    5. Use the following command to connect to the pod and view the contents of the volume:

      kubectl exec -it data-pod2 -n web -- sh
      
      # ls /tmp/data
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight