Skip to content
CNPEPlatform APIs and Self-Service CapabilitiesSingle nodeHard

Self-service with Crossplane: an XRD and a Composition that compose a ConfigMap

Scenario cnpe-api-002 · about 20 minutes · 10 points · 6 grader checks

Expose app configuration as a Crossplane v2 namespaced composite API: define the XRD, write a pipeline Composition with patch-and-transform, and provision the first composite.

  • crossplane
  • composition
  • xrd
  • self-service
  • platform-api
  • function-patch-and-transform

What you will practise

  • Define a namespaced CompositeResourceDefinition (Crossplane v2)
  • Write a Pipeline-mode Composition with function-patch-and-transform
  • Patch composite fields into a composed resource

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-api-002

Task

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

Crossplane v2 runs in namespace "crossplane-system" and the Function "function-patch-and-transform" is installed and healthy. Crossplane is already allowed to manage ConfigMaps. 1. Create a CompositeResourceDefinition for the namespaced composite kind "XAppConfig" (plural "xappconfigs") in group "platform.example.com", version "v1alpha1" served and referenceable, with a spec containing the required string "team" and the required string "tier" (one of dev or prod). 2. Create a Composition "appconfig-configmap" for that type, in Pipeline mode, with one step that uses "function-patch-and-transform" to compose a ConfigMap whose data keys "team" and "tier" are patched from the composite's spec.team and spec.tier. 3. Create the XAppConfig "payments" in namespace "apps" with team payments and tier prod. Its ConfigMap must exist with those values.

Requirements and details

Certification
CNPE · Certified Cloud Native Platform Engineer
Domain
Platform APIs and Self-Service Capabilities
Difficulty
Hard
Cluster topology
Single node
Cluster features
None beyond the base cluster
Recommended time
20 minutes
Points
10
Grader checks
6
Kubernetes version
1.35
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 6 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 APIs and Self-Service CapabilitiesMedium

Platform API: design a Database CRD with validation and status

Offer databases as a platform API: a namespaced CustomResourceDefinition with an enum-validated schema, a status subresource and printer columns, plus the first claim.

Single node · ~15 min · 10 points

  • crd
  • customresourcedefinition
  • openapi-schema
  • platform-api
  • self-service

goldenkube start cnpe-api-001

CNPEPlatform APIs and Self-Service CapabilitiesMedium

Operators: run Alertmanager through the Prometheus Operator

Use the Prometheus Operator as a platform automation: declare an Alertmanager and a namespaced AlertmanagerConfig, and confirm the operator reconciled them into a running, configured instance.

Single node · ~15 min · 8 points

  • operator
  • prometheus-operator
  • alertmanager
  • alertmanagerconfig
  • custom-resources
  • platform-automation

goldenkube start cnpe-api-003

CNPEPlatform APIs and Self-Service CapabilitiesMedium

Self-service namespaces: Kyverno generate rules for team onboarding

A team gets a working namespace by labelling it: a Kyverno ClusterPolicy generates the quota and the admin RoleBinding for every namespace carrying the team label and keeps them in sync.

Single node · ~15 min · 10 points

  • kyverno
  • generate
  • self-service
  • namespace-provisioning
  • policy
  • platform-api

goldenkube start cnpe-api-004

CNPEPlatform APIs and Self-Service CapabilitiesMedium

Automation framework: an Argo WorkflowTemplate that provisions environments

Offer environment provisioning as a reusable Argo WorkflowTemplate with a parameter and a resource step, then provision the blue environment through it.

Single node · ~15 min · 8 points

  • argo-workflows
  • workflowtemplate
  • automation
  • self-service
  • resource-template
  • platform-api

goldenkube start cnpe-api-005

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