3 - Azure Environment
Once you've added a Service to your Application, you can define Environments where your Service can be deployed.
Create a New Harness Environment
In an Environment, you specify the following:
- A Harness Service, such as the Service with a Docker image artifact you configured.
- A Cloud Provider, such as the Kubernetes Cluster Cloud Provider that you added in Cloud Providers Setup.
An Environment can be a Dev, QA, Production, or other environment. You can deploy one or many Services to each environment.
The following procedure creates an Environment for the Service we set up earlier.
- In your Harness Application, click Environments. The Environments page appears.
- Click Add Environment. The Environment dialog appears.
- In Name, enter a name that describes the deployment environment, for example, AKS.
- In Environment Type, select Non-Production.
- Click SUBMIT. The new Environment page appears.
Add a Service Infrastructure
In Service Infrastructure, you define the AKS cluster to use for deployment.
To add a Service Infrastructure, do the following:
- In the Harness Environment, click Add Service Infrastructure. The Service Infrastructure dialog appears.
- In Service, select the Harness Service you created earlier.
- In Cloud Provider, select the Cloud Provider you added earlier. Ensure that you select the Kubernetes Cluster Cloud Provider you set up for the AKS connection and not the Azure Cloud Provider you set up for the ACR connection.
- Click Next.
- In Namespace, enter the name of the cluster namespace you want to use. As we noted in Namespace Variable, you can enter any value here and the Service will use it in its Namespace manifest to create the namespace at runtime.
- When you are done, the dialog will look something like this:
- Click SUBMIT. The new Service Infrastructure is added to the Harness Environment.
That is all you have to do to set up the deployment Environment in Harness.
Now that you have the Service and Environment set up. Now you can create the deployment Workflow in Harness.