Skip to main content

Create services

Services represent your microservices and other workloads. Each service contains a Service Definition that defines your deployment artifacts, manifests or specifications, configuration files, and service-specific variables.

Create a service

You can create services from:

  • Within a pipeline
  • Outside a pipeline
  • An account
  • An Organization

If you are new to Harness, review Harness key concepts and create your first CD pipeline.

To create a service from inside of a pipeline, select the Services tab of a new CD stage, then select New Service.

Once the service and its service definition are saved, you can select it in any pipeline.

When you select the service in a pipeline, you can select Edit Service to edit its Service Definition.

When you create the new service you define its Service Definition. For example, a Kubernetes Service Definition with a Kubernetes manifest and Docker artifact.

Runtime inputs and expressions in services

If you use runtime inputs for settings in a service, you will need to provide values for these inputs when you run the pipeline using the service.

If you use expressions in a service, Harness must be able to resolve these expressions when users run the pipeline using the service.

Let's look at an example.

  1. In a Harness Deploy stage, in Service, select Runtime input for the service.

  2. When you run the pipeline, you can select the service to use.

Now you can provide values for any runtime inputs in the service. Let's go into more detail in the next section.

note

For more information on runtime inputs and expressions, go to Fixed Values, Runtime Inputs, and Expressions.

Selecting settings when the service is an expression

If you are using a runtime input for the service in a stage, and the service you are going to select has runtime inputs for some of its own settings, you can select inputs for these settings when you select the service in Run Pipeline.

Let's look at an example.

Here is a service with an artifact that has runtime inputs for its artifact Tag and Digest settings.

picture 0

Next, when you run a pipeline that has the Service setting as a runtime input, you select the service that has runtime inputs for its artifact Tag and Digest settings.

As you can see, you can now select the artifact Tag and Digest settings.

picture 1

Next steps