Add an Environment

Once you've added a service to your application, you can define environments where you service can be deployed. In an environment, you specify the following:

  • A service, such as a service with a Docker image artifact you configured.
  • A deployment type, such as Kubernetes.
  • A cloud provider, such as a Kubernetes cluster or Google Cloud Platform that you added in Add Cloud Providers.

An environment can be a Dev, QA, Production, or other environment. You can deploy one or many services to each environment.

Intended Audience

  • DevOps

Before You Begin

Add an Environment

The following procedure creates an environment for a single service.

To add an environment, do the following:

  1. Click Setup.
  2. Click an application.
  3. Click Environments.
  4. Click Add Environment. The Environment dialog appears.
  5. Enter a name and description for the environment. For example, the name DEV with the description, This is the development environment for example.com.
  6. In Environment Type, choose Production or Non-Production.
  7. Click SUBMIT. The Environment Overview appears. Here you can add the service infrastructure and overrides to the configurations of the services that use this environment.

Add a Service Infrastructure

For information about how a service infrastructure is used in a Kubernetes deployment, see Kubernetes and Harness FAQ.

The service infrastructure for an environment is where you specify a deployment infrastructure, using a Cloud Provider you added in Add Cloud Providers, a development type, such as Helm or Kubernetes, and the specific VPC infrastructure details for the deployment.

To add a service infrastructure, do the following:

  1. In an application, open an environment.
  2. In Service Infrastructure, click Add Service Infrastructure. The Service Infrastructure dialog appears.
  3. In Service, click the name of the service that will deploy to this environment.
  4. In Deployment Type, click a deployment type such as Kubernetes.
  5. In Cloud Provider, click the cloud provider where you will deploy the service.
  6. Click Next. Harness will retrieve the cluster information from the cloud provider you selected.
  7. In Cluster Name, click the name of the cluster where you want to deploy the service.
  8. In Namespace, select the name of the cluster namespace.
  9. Click SUBMIT. The infrastructure is listed under Service Infrastructure.

Override a Service Configuration

For information about how a service configuration is overwritten in a Kubernetes deployment, see Kubernetes and Harness FAQ.

You can configure your environment to override settings of the services that use the environment. For example, a service might use a specific ConfigMap YAML with specific metadata, but your environment might need to change the name and namespace of the metadata because it is deploying the service to a QA environment.

To override a service configuration, do the following:

  1. In an application, open an environment.
  2. Click Add Configuration Overrides. The Service Configuration Override dialog appears.
  3. In Service, click the name of the service you want to override. Depending on the type of service you select, the Override Type options will be different. Here is an example of the options available when a service with Docker type artifact is used.
  4. Click an Override Type option.
  5. Enter the override and click SUBMIT.

24x7 Service Guard

24x7 Service Guard applies Harness Continuous Verification unsupervised machine-learning to detect regressions and anomalies across transactions and events for the service and displays the results in the 24x7 Service Guard dashboard.

For more information, see 24x7 Service Guard.

Troubleshooting Environments

The most common error with environments occurs when an environment's connection to a workflow is changed in such a way as to render it inoperable for a deployment of that workflow. The error is displayed in the Workflows and Continuous Deployment pages:

This error can occur in the following circumstances:

  • A user changes the environment service infrastructure. For example, the user might remove a service infrastructure or change its Deployment Type or Cloud Provider so that the workflow can no longer use the environment to deploy its service(s).
  • A user changes the environment in a workflow. If you open the Workflow dialog and, in Environment, you select a different environment, then a service infrastructure must also be selected in Service Infrastructure.
  • The user clones a workflow to a different application that uses services that cannot deploy to the service infrastructure in that environment.

As a result of these changes, the workflow has no functional service infrastructure specified, and you must select a new service infrastructure for each impacted workflow/phase.

Next Steps

Add a Workflow


How did we do?