Skip to main content

Overriding services at the environment level

In DevOps, it is common to have multiple environments, such as development, testing, staging, and production. Each environment might require different configurations or settings for the same service. For example, in the development environment, a service may need to use a local database for testing, while in the production environment, it should use a high-availability database cluster.

To enable the same service to use different environment settings, DevOps teams can override service settings for each environment.

This topic explains what service settings can be overridden by environments.

Limitations

  • Runtime inputs are not supported if you are trying to override services in multi-service and multi-environment set ups.

Override types

You can override the following manifest types.

  • Values YAML
  • OpenShift Param
  • Kustomize
  • Helm Repo
  • ECS Task Definition
  • ECS Service Definition
  • ECS Scalable Target
  • ECS Scaling Policy
  • Tanzu Application Service (TAS) manifest
  • TAS vars
  • TAS AutoScalar

Notes

  • Helm Repo:
    • You can only override Helm Repo for HTTP Helm, GCS, S3, and OCI store types.
    • Unlike other overrides, you can only override the Harness connector used for Helm Repo. Consequently, when you override the Helm Repo for a service, you must select the same store type used in the service. So, if the service uses HTTP Helm as the store type, the environment override must also use HTTP Helm as the store type. If you select a different store type, Harness will throw an exception during execution.

Override methods

In an environment, you can override one or more settings for all services that use the environment and you can override settings for specific services that use the environment.

In the environment Configuration, you can also set the default manifests, config files, and variables to use whenever Harness deploys a service to this environment.

For example, a stage has a Kubernetes service with a manifest but whenever that service is deployed to the QA environment, the manifest in that environment's Configuration overwrites the namespace of with the manifest in the service with QA.

Override priority

When you are using environment configuration and service override to override service settings, it's important to understand the priority of the overrides.

The priority from top to bottom is:

  1. Environment Service Overrides.
  2. Environment Configuration.
  3. Service settings.