Define Kubernetes Cluster Build Infrastructure

Updated 3 months ago by Michael Cretzman

Once you've set up a Build Infrastructure, you can add a build farm as the CI stage's Infrastructure. You can use a Kubernetes cluster as the build farm and Harness will build the codebase on the cluster, scaling pods as needed.

In this topic, we'll cover how to define the Kubernetes cluster Infrastructure in a CI stage. For a quick summary of a build, push, and test Pipeline, see CI Pipeline Quickstart.

Once you have the infrastructure set up, you can add Execution steps. See the CI Technical Reference.

In this topic:

Before You Begin

Step 1: Define the Build Farm Infrastructure

In the CI stage Infrastructure, in Select a Kubernetes Cluster, select, or create, a Kubernetes Connector. See Kubernetes Cluster Connector Settings Reference.

This Connector connects Harness to the cluster to use as the build farm.

In Namespace, enter the Kubernetes namespace to use.

You can use a Runtime Input (<+input>) or expression also. See Runtime Inputs.

The Kubernetes Cluster Connector is platform agnostic. You can use a platform Connector to connect to your cluster, such as the Google Cloud Platform (GCP) Connector, but the Kubernetes Cluster Connector is the simplest method.

Configure As Code

When configuring your Pipleine in YAML, you add the Kubernetes Cluster CI infrastructure using infrastructure of type KubernetesDirect:

- stage:
type: KubernetesDirect
connectorRef: account.mydelegate
namespace: default

Please Provide Feedback