Skip to main content
Version: 4.0.x

Configuring Environments with V2 Pipelines

The V2 deployment approach centers on environment files that describe how a Self-Managed Commerce environment should be configured.

Configuring a Commerce Environment​

Use the new v2-configure-commerce-environment job to create a new Commerce environment or to update an existing Commerce environment. The job takes YAML configuration files as input, and uses those to know how to configure your Self-Managed Commerce environment.

Over time, you update the environment's configuration by updating the YAML configuration files with the desired changes, then running v2-configure-commerce-environment to apply the changes.

For a long-lived environment, commit the files under:

environments/<kubernetesNickname>/

The directory name <kubernetesNickname> is the same as the Kubernetes namespace for the environment. The directory will contain multiple files that collectively describe the various components of the Commerce environment:

  • commerce-values.yaml - Self-Managed Commerce stack configuration. For more information, see commerce-values.yaml.
  • activemq-values.yaml - ActiveMQ configuration. For more information, see activemq-values.yaml.
  • At most one database file: mysql-container.yaml, aurora-mysql-80.yaml, postgres-rds.yaml, or existing-database.yaml. You can omit the database file if the Commerce environment is already deployed in the kubernetesNickname namespace and is using the desired database. For more information, see Database Files.

A typical environment folder looks like so:

environments/<kubernetesNickname>/ # The folder for the environment
commerce-values.yaml # Commerce stack
activemq-values.yaml # JMS broker
<database file> # at most one file
Source of truth

When a YAML file is committed under environments/<kubernetesNickname>/, the v2-configure-commerce-environment job treats the file as the source of truth for that component's configuration. Manual changes in the AWS console, Kubernetes, or elsewhere may be reverted the next time you run the job for that environment.

When you are managing multiple Commerce environments using the new approach, your CloudOps for Kubernetes Git project will include files that describe all of your environments. For example:

environments/
dev1/
commerce-values.yaml
activemq-values.yaml
mysql-container.yaml
qa1/
commerce-values.yaml
activemq-values.yaml
existing-database.yaml
staging/
commerce-values.yaml
activemq-values.yaml
postgres-rds.yaml
prod-auth/
commerce-values.yaml
activemq-values.yaml
postgres-rds.yaml
prod-live/
commerce-values.yaml
activemq-values.yaml
postgres-rds.yaml

For a complete field-by-field reference of the YAML file formats, see Environment Files Reference.

tip

Use the v2-generate-env-files-for-existing-environment job to generate YAML files that capture the configuration of your existing Commerce environments. For more information, see Generate Environment Files for an Existing Environment.

When to Run the v2-configure-commerce-environment Job​

Run the v2-configure-commerce-environment job in the following cases:

  • To create a new Commerce environment.
  • To apply CloudOps for Kubernetes features or fixes to an existing Commerce environment. For example, if Elastic Path has shipped a fix or feature in a CloudOps for Kubernetes release.
  • To apply desired configuration changes to an existing Commerce environment. For example, if you need to apply an IP allow list that has been updated in one of the YAML configuration files.
note

The v2-configure-commerce-environment job is not intended to be used for regular code deployments. Each time the v2-configure-commerce-environment job runs it performs Terraform operations on all components, which is unnecessary and time consuming for a code deployment.

tip

Run the v2-deploy-commerce-images job to deploy new Commerce images to an existing Commerce environment. This job can optionally re-tag the images before deploying, or optionally run data-population update-db if data-pop is required.

Ways to Provide Environment Files​

The v2-configure-commerce-environment job supports four ways to supply the environment files.

fromGit​

Use component YAML files committed in the CloudOps for Kubernetes repository.

When job parameter envFileSource is fromGit, specify kubernetesNickname. The job looks for recognized component files in:

environments/<kubernetesNickname>/

This mode is the recommended approach for long-lived environments because the environment definition can be checked in, reviewed, updated over time, and reused safely on later runs.

fromTemplate​

Render component YAML files from Jinja2 templates stored in the CloudOps for Kubernetes repository. This mode is useful for temporary or CI-driven environments.

When job parameter envFileSource is fromTemplate, specify templateName and imageTag. The job renders all *.yaml.j2 files from:

environments/<templateName>/

By default, v2-commerce-branch-validation uses:

environments/branch-validation-template/
tip

You can create and check in your own template files to the CloudOps for Kubernetes Git project, then specify that template folder name when running the v2-configure-commerce-environment job.

inline​

When job parameter envFileSource is inline, paste the YAML content directly into the Jenkins job. In this mode, select the JMS, database, and Commerce stack component types, then edit the pre-populated YAML text areas.

This mode is useful for one-off runs and testing. Inline runs archive the generated YAML files as build artifacts under inline-env-<kubernetesNickname>/, so the configuration can be reviewed, reused, or committed later.

fromPreviousBuild​

Reuse YAML files archived by a previous inline run of v2-configure-commerce-environment.

When job parameter envFileSource is fromPreviousBuild, specify the same kubernetesNickname and the previousBuildNumber from the earlier v2-configure-commerce-environment inline build. This can be useful when you want to re-run the same configuration without re-entering the inline YAML.

For long-term use, commit the reviewed files to environments/<kubernetesNickname>/ and switch to fromGit.

Supported Components​

The v2-configure-commerce-environment job can create or update:

  • The Self-Managed Commerce application image tag, configuration, or infrastructure.
  • The ActiveMQ deployment image tag or configuration.
  • The database layer.
  • Optionally, can run the data population tool.

Destroying a Commerce Environment​

The matching v2-destroy-commerce-environment job removes the Terraform-managed resources for the environment using the same environment files. Use it to destroy the environment and all resources described in the specified YAML files.

Supported Database Options​

The V2 configure job supports the following database component files:

  • mysql-container.yaml - Containerized MySQL for short-lived and test-oriented environments.
  • aurora-mysql-80.yaml - Amazon Aurora MySQL 8.0.
  • postgres-rds.yaml - Amazon RDS for PostgreSQL.
  • existing-database.yaml - Database server or cluster managed outside this V2 job.

Select and use the database file that meets your needs. For more information about the options, see Database Files.

Supported JMS Option​

The V2 configure job currently supports ActiveMQ through activemq-values.yaml.

Omit activemq-values.yaml when you do not want the V2 job to create, change, or manage ActiveMQ for the environment.

Customizing Temporary Branch Validation Environments​

The v2-commerce-branch-validation job creates temporary environments from component templates in environments/branch-validation-template/.

Customer teams can update those templates if they want temporary environments to be configured differently. For example, they can adjust:

  • SMTP-related values.
  • Feature flags.
  • Optional services.
  • Ingress-related settings.
  • Resourcing defaults.

This is a significant improvement over the legacy branch-validation flow, where equivalent ephemeral-environment behavior was embedded in shared Groovy logic and was harder to inspect and customize.

Teams can also copy the template directory and create additional template sets for their own V2 configure jobs.

Why This Is Safer for Long-Lived Environments​

Many legacy long-lived environment workflows depended on operators filling out large sets of Jenkins parameters every time a deployment or configuration job ran.

That approach was fragile because:

  • The caller had to enter or re-enter many values correctly on every run.
  • It was easy to accidentally omit or change a parameter.
  • Inconsistent values could cause unintended Terraform changes.

With v2-configure-commerce-environment, the environment files can live in source control, which improves repeatability and makes changes easier to review before they are applied.

Under the Covers​

The V2 configure and destroy jobs call Ansible playbooks and roles that call the same Terraform modules already used by CloudOps for Kubernetes.

For example, the V2 path still uses the existing Terraform modules for:

  • ActiveMQ.
  • The Self-Managed Commerce stack.
  • MySQL container deployments.
  • Aurora MySQL 8.0 deployments.
  • PostgreSQL RDS deployments.

Cluster-level and platform-derived values such as registry address, cluster name, DNS zone, Identity and Access Management (IAM) role, and discovered service secrets are supplied by Jenkins and Ansible at deploy time. They do not belong in the customer-authored YAML files.

This means the Terraform backend, state, workspaces, and managed resources remain part of the same CloudOps for Kubernetes model.