Table of Contents
Table of Contents
Further Reading
How mappings work
A mapping expresses a relationship between associated values, usually as key-value pairs. In YAML, a key named environment might hold two nested keys, DATABASE_URL and LOG_LEVEL, each with its own value.
Mappings define structured data in declarative systems such as Kubernetes, Helm, and CI/CD pipelines.
- Keys: unique names, such as DATABASE_URL
- Values: strings, numbers, lists, or other mappings
- Nesting: mappings can contain other mappings for structure
- Common names: also called dictionaries, hashes, or objects
Mappings vs. arrays
Configuration files use both. They store data in different shapes.
Why mappings matter in configuration and testing
Mappings give configuration files their structure. In testing, they control inputs, credentials, and settings across environments.
- Clarity: configuration files are easier to read and manage
- Parameterization: reusable templates swap in values dynamically
- Environment customization: separate mappings for dev, staging, and production
- Consistency: fewer manual errors in repeated configurations
- Secret management: map variables to sensitive values without hardcoding them
Consider a SaaS team that runs one API suite against three environments. A mapping per environment changes only the base URL and key. The tests stay identical.
Common challenges with mappings
- Indentation errors: YAML and JSON mappings break on small syntax mistakes
- Override conflicts: several mappings set the same key to different values
- Secret exposure: sensitive values stored in plain text
- Environment drift: inconsistent mappings across clusters or teams
- No validation: invalid mappings break deployments or test runs
Validate mappings with schemas, encrypt sensitive values, and keep configurations in version control.
How mappings relate to Testkube
Testkube uses mappings to define test parameters, environment variables, and secrets. Tests stay modular, reproducible, and environment-agnostic.
- Configuration mappings: test-level parameters such as URLs, tokens, or timeouts
- Secret mappings: references to Kubernetes Secrets, resolved at runtime
- Execution mappings: inputs such as environment or test type that shape each run
- Workflow mappings: relationships between test steps, dependencies, or outputs
- Result mappings: test outputs linked to reports, dashboards, or observability tools
Real-world examples
- Multi-environment tests: a QA engineer maps API_KEY and BASE_URL to run one suite in every environment
- Secure secrets: a DevOps team stores sensitive mappings as Kubernetes Secrets referenced by Testkube
- Helm values: a developer customizes Testkube behavior per environment in a values file
- Dashboards: a platform engineer maps workflow variables to Grafana dashboards



