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

Creating a ClusterRole to Access a PV in Kubernetes

In this hands-on lab, you will be tasked with accessing a persistent volume from a pod in order to view the available volumes inside the Kubernetes cluster. By default, pods cannot access volumes directly, so you will also need to create a cluster role to provide authorization to the pod. Additionally, you cannot access the API server directly without authentication, so you will need to run kubectl in proxy mode to retrieve information about the volumes.

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

Contact sales

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

    View the Persistent Volume
    1. Use one command that will list the persistent volumes within the cluster.
  2. Challenge

    Create a ClusterRole and ClusterRoleBinding
    1. Use one command that will create a new ClusterRole with the verb get and list to the resource persistentvolumes.
    2. Use one command that will create a new ClusterRoleBinding to the ClusterRole, in the web namespace and using the default service account.
  3. Challenge

    Create a pod to access the PV
    1. Create the YAML file including the two containers, using the two images curlimages/curl and linuxacademycontent/kubectl-proxy.
    2. Issue a command to the curl container to sleep for 1 hour (3600 seconds).
    3. Apply the YAML to the Kubernetes cluster to run the pod.
  4. Challenge

    Request access to the PV from the pod
    1. Open a shell inside the container.
    2. From the container shell prompt, issue the curl command to request persistent volumes from the API server.
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