liveBook · Manning

Parameterization

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

Parameterization is the practice of representing changeable configuration values as parameters or placeholders rather than embedding them directly in code or configuration.

Parameterization keeps changeable configuration outside application or infrastructure code. Parameters and placeholders are filled with values when a command or deployment pipeline runs, avoiding repeated edits to hardcoded files. section 8.9.2 section 7.11.3

Use parameterization when values vary between deployments or change frequently:

  • Pass environment-specific names, such as separate production and testing infrastructure, through Terraform variables. section 7.11.3
  • Keep container registry locations and microservice version numbers out of deployment configuration. section 8.9.2
  • Inject environment-variable values into Kubernetes configuration during continuous deployment with envsubst. section 8.9.2

Parameterized deployment configuration

Set CONTAINER_REGISTRY and VERSION in the pipeline environment, then run envsubst against deploy.yaml. The same configuration can receive different registry locations or versions without changing the repository’s deployment file. section 8.9.2

  var.app_name
    Enter a value: flixtube
 
  var.kubernetes_version
    Enter a value: 1.24.6

Terraform prompts for parameter values that have no defaults, including an application name and Kubernetes version. section 7.11.3

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Demonstrates environment variables, Terraform inputs, and envsubst, but stops short of broader templating strategies.
Examples
Uses Terraform app names and Kubernetes versions, plus container registry and microservice version variables injected into deploy.yaml.
What it assumes
Assumes working knowledge of Terraform, Kubernetes configuration, environment variables, and Ubuntu command-line execution.
What you can do after
Apply it via Terraform variables and envsubst to deploy parallel environments and update deployment values without editing configuration.
How it connects
Connects configuration management with environment variables, infrastructure as code, Kubernetes, Terraform, and continuous deployment.

Also explained in

Compare how 2 books explain parameterization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.