Skip to content
CKADApplication Environment, Configuration and SecuritySingle nodeEasy

ConfigMap and Secret as env vars and a volume

Scenario ckad-env-001 · about 7 minutes · 9 points · 9 grader checks

Create a ConfigMap and a Secret and consume them in a Pod as single env vars, envFrom and a mounted volume.

  • configmap
  • secret
  • env
  • envfrom
  • volumes

What you will practise

  • Create ConfigMaps and Secrets imperatively
  • Use valueFrom.configMapKeyRef and envFrom.secretRef
  • Mount a ConfigMap as files

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 ckad-env-001

Task

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

In namespace "config" (create it if it does not exist): 1. Create a ConfigMap "app-config" with the keys APP_MODE=production and APP_PORT=8080. 2. Create a generic Secret "app-secret" with the key DB_PASSWORD whose value is s3cr3t-pass. 3. Create a Pod "config-pod", image busybox:1.36, command "sleep 3600", that - has an environment variable MODE taken from key APP_MODE of ConfigMap "app-config", - loads every key of Secret "app-secret" as environment variables, - mounts ConfigMap "app-config" as a volume at /etc/app-config. The Pod must be Running.

Requirements and details

Certification
CKAD · Certified Kubernetes Application Developer
Domain
Application Environment, Configuration and Security
Difficulty
Easy
Cluster topology
Single node
Cluster features
None beyond the base cluster
Recommended time
7 minutes
Points
9
Grader checks
9
Kubernetes version
1.37
Minimum CLI version
0.1.0
Scenario version
1
Published

Grading runs locally: 9 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.

CKADApplication Environment, Configuration and SecurityMedium

Pod and container SecurityContext

Run a Pod as a non-root user with a read-only root filesystem, no privilege escalation and no capabilities.

Single node · ~7 min · 11 points

  • securitycontext
  • runasnonroot
  • capabilities
  • readonlyrootfilesystem
  • pod

goldenkube start ckad-env-002

CKADApplication Environment, Configuration and SecurityMedium

Requests, limits, LimitRange and ResourceQuota

Constrain a namespace with a ResourceQuota and LimitRange defaults, then deploy a workload that fits inside them.

Single node · ~8 min · 10 points

  • resources
  • requests
  • limits
  • resourcequota
  • limitrange

goldenkube start ckad-env-003

CKADApplication Environment, Configuration and SecurityMedium

ServiceAccount with least-privilege RBAC for an app

Give an application its own ServiceAccount with a namespaced Role and switch a running Deployment to it.

Single node · ~8 min · 10 points

  • serviceaccount
  • rbac
  • role
  • rolebinding
  • deployment

goldenkube start ckad-env-004

CKADApplication Environment, Configuration and SecurityEasy

Use a CustomResourceDefinition

Discover the schema of a custom resource and create and update objects of that kind with kubectl.

Single node · ~6 min · 8 points

  • crd
  • custom-resource
  • api-resources
  • kubectl-explain

goldenkube start ckad-env-005

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