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

Using Prometheus with Kubernetes

This lab guides the student through basic Prometheus Queries (PromQL) and demonstrates how the Kubernetes architecture may be interrogated. The lab also introduces a simple means of stressing a cluster and demonstrates how those techniques affect the metrics being stored in the time series database.

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

Contact sales

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

    Check that your lab environment is ready.

    Log in to the master node:

    ssh cloud_user@[Public IP here]
    

    List the home directory contents:

    ls -l 
    

    Verify that stress-test.yaml is present.

  2. Challenge

    Access Prometheus from your browser.

    Access Prometheus from your browser:

    http://[Master Node public ip address]:9090
    

    You may also access the sAdvisor dashboard at the following address:

    http://[Worker Node Public IP Address]:8080
    
  3. Challenge

    Use the provided PromQL queries to interrogate your cluster.

    The following are the suggested PromQL queries you may perform.

    To measure CPU utilization:

    node_cpu_seconds_total
    
    irate(node_cpu_seconds_total{job="node"}[5m])
    
    avg(irate(node_cpu_seconds_total{job="node"}[5m])) by (instance)
    
    avg(irate(node_cpu_seconds_total{job="node",mode="idle"}[5m])) by (instance) * 100
    
    100 - avg(irate(node_cpu_seconds_total{job="node",mode="idle"}[5m])) by (instance) * 100
    

    To measure memory, use:

    (node_memory_MemTotal_bytes - (node_memory_MemFree_bytes + node_memory_Cached_bytes + node_memory_Buffers_bytes)) / node_memory_MemTotal_bytes * 100
    
  4. Challenge

    Deploy the stress test and vary its replicas to examine changes.

    In the terminal emulator session that is established to the Master Node:

    Deploy the Stress-Test Deployment:

    kubectl create -f stress-test.yaml
    

    Interrogate the number of replicas deployed:

    kubectl get deployments
    

    Interrogate the pods running:

    kubectl get pods
    
  5. Challenge

    Refresh your Prometheus graphs and scale the deployment up and down to vary metrics.

    Use refresh on your browser to see the time series metrics change over time.

    Use the following command to increase and decrease the number of replicas running in the stress-test deployment.

    kubectl scale deployment.v1.apps/stress-test --replicas=[from 1 to 50 here]
    
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