Skip to content
CNPEPlatform Architecture and InfrastructureSingle nodeMedium

Cost management: OpenCost custom pricing, right-sizing and an HPA

Scenario cnpe-arc-002 · about 15 minutes · 11 points · 7 grader checks

OpenCost runs with list prices and the catalog service reserves far more than it uses. Load the on-prem price sheet into OpenCost, right-size the workload and let an HPA scale it.

  • opencost
  • cost-management
  • right-sizing
  • hpa
  • helm
  • platform-architecture

What you will practise

  • Configure OpenCost custom (on-prem) pricing through its Helm release
  • Right-size requests and limits
  • Scale on CPU utilisation with an autoscaling/v2 HPA

Start this lab

With the CLI installed and signed in, this command provisions a single node cluster on your Mac, applies the scenario setup and prints the task below.

goldenkube start cnpe-arc-002

Task

The task text exactly as the CLI shows it. Solve it on the cluster, then run goldenkube submit.

OpenCost is installed as the Helm release "opencost" in namespace "opencost" from the chart /opt/goldenkube/platform/opencost/opencost-2.5.33.tgz. The Deployment "catalog" in namespace "shop" reserves far more than it uses. 1. Upgrade the OpenCost release (same name, same namespace, keep its current values) so that it uses custom on-prem pricing from the ConfigMap "custom-pricing-model": 0.031 per vCPU-hour and 0.004 per GiB-hour of RAM. OpenCost must be running with that configuration. 2. Right-size the "podinfo" container of "catalog": requests 100m CPU and 128Mi memory, limits 500m CPU and 256Mi memory. 3. Create an autoscaling/v2 HorizontalPodAutoscaler "catalog" in "shop" for the Deployment with 2 to 6 replicas at 70% average CPU utilisation.

Requirements and details

Certification
CNPE · Certified Cloud Native Platform Engineer
Domain
Platform Architecture and Infrastructure
Difficulty
Medium
Cluster topology
Single node
Cluster features
None beyond the base cluster
Recommended time
15 minutes
Points
11
Grader checks
7
Kubernetes version
1.35
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 7 state checks read your cluster when you submit; the scenario passes when every check passes. Hints, the reference solution and the check definitions are available only inside the CLI, not on this page.

CNPEPlatform Architecture and InfrastructureMedium

Multi-tenancy: quotas, defaults, priority and a tenant node pool

Two teams share one cluster. Give each namespace a ResourceQuota and LimitRange, add a tenant PriorityClass and pin a tenant workload to a dedicated node pool.

Two nodes · ~15 min · 11 points

  • multi-tenancy
  • resourcequota
  • limitrange
  • priorityclass
  • node-affinity
  • platform-architecture

goldenkube start cnpe-arc-001

CNPEPlatform Architecture and InfrastructureMedium

Storage and network baseline: a Retain default class and default-deny

Tenant data must survive claim deletion and tenants must be isolated by default. Make a Retain StorageClass the only default, bind the ledger claim to it and lock the namespace down.

Single node · ~15 min · 10 points · Storage

  • storageclass
  • persistentvolumeclaim
  • reclaim-policy
  • networkpolicy
  • default-deny
  • platform-architecture

goldenkube start cnpe-arc-003

Independent community project, not affiliated with or endorsed by CNCF or The Linux Foundation. Lab results are practice feedback, not an exam score.