Use Harness Cloud build infrastructure
You can use Harness-managed build infrastructure for your Harness CI pipelines.
With Harness Cloud, you can run builds in isolation on Harness-managed VMs that are preconfigured with tools, packages, and settings commonly used in CI pipelines. Harness hosts, maintains, and upgrades these machines so that you can focus on building software instead of maintaining build infrastructure.
Harness Cloud provides the following advantages:
Use Cloud credits to run builds on Harness-managed infrastructure. No need to set-up and maintain the infrastructure yourself
Starter pipelines for different programming languages.
Blazing fast builds on Linux, macOS, and Windows.
Get the latest features first. Harness may enable features for Harness Cloud before rolling them out to other build infrastructure options.
Go to Which build infrastructure is right for me for a comparison of build infrastructure options.
What you will learn from this topic
By the end of this topic, you will understand:
Platforms, VM images, and machine sizes available on Harness Cloud.
How to configure a pipeline stage to run on Harness Cloud.
The connector and secret manager requirements for Harness Cloud.
How to access privately hosted resources and apply Harness Cloud best practices.
Before you begin
Before you use Harness Cloud build infrastructure, ensure you have the following:
Harness CI project and the required connector and secret manager configuration. Go to Requirements for connectors and secrets to review access requirements.
Credits and billing
Free plans get 2000 free Harness Cloud credits each month. If you are using a paid CI plan, you can purchase build credit packages. Free plans require credit card validation to use Harness Cloud. If you do not want to provide a credit card, consider using local runner build infrastructure.
Harness can invoice in arrears for overages. Go to Subscriptions and licenses for Harness Cloud billing and build credit consumption.
Platforms and image specifications
Harness Cloud supports Linux, macOS, and Windows platforms. Each CI stage that runs on Harness Cloud is executed on a Harness-managed VM image.
The VM image defines:
The operating system (for example, Ubuntu 22.04, Ubuntu 24.04, macOS, or Windows)
A curated set of pre-installed tools maintained and updated by Harness
Go to Harness Cloud VM Images to review image components and preinstalled software.
After selecting a base VM image, you can customize the build environment at pipeline execution time by:
Locking specific tool versions
Installing additional tools that are not pre-installed
Running steps directly on the host VM or inside Docker containers
These customizations are applied on top of the selected VM image, are re-applied on each run, and do not modify the underlying image. Go to pre-installed software version management for details.
You can also use Bring Your Own Image (BYOI) to create fully custom VM images with your tools and dependencies pre-installed, eliminating the need to install them at pipeline runtime. Go to Harness Cloud BYOI and BYOI on Harness Cloud VM Images to build custom VM images.
Requirements for connectors and secrets
Harness Cloud resolves connectors and secrets through the Harness Platform, not through a delegate. This determines which authentication methods and secret managers you can use.
Connectors
Connector authentication on Harness Cloud has the following restrictions:
All connectors must connect through the Harness Platform, not a delegate.
AWS connectors cannot use IRSA or AssumeRole.
GCP and Azure connectors cannot use authentication that inherits credentials from the delegate.
Secret managers
Use Harness Cloud
You can configure your pipelines to use Harness Cloud in minutes.
Go to the pipeline where you want to use Harness Cloud build infrastructure.
Select the Build stage, and then select the Infrastructure tab.
Select Harness Cloud and the desired Platform.
Save and run your pipeline.
To enable Harness Cloud build infrastructure in your pipeline YAML, specify the platform and runtime in the stage.spec. For example:
In
runtime, you must includetype: Cloud.In
platform, specify theosandarch. Go to Platforms and image specifications for a list of supported operating systems and architectures.
Use resource classes
You can use the YAML editor to change the cloud machine size.
To select a resource class size, set the desired size as the value for the size property in the CI stage cloud infrastructure runtime configuration. For example:
Go to Harness Cloud billing and cloud credits to review all available resource classes in Harness Cloud.
Hardware acceleration
Harness supports hardware acceleration using nested virtualization on Linux/AMD Cloud machines.
By enabling this feature, Android SDK tools and emulators can run more efficiently within virtualized environments, making Android test execution faster and optimizing build time.
To enable this feature, set the nestedVirtualization property to true as shown below.
Access privately hosted resources
When running builds on Harness Cloud, you may need to access internal resources that are not publicly accessible, such as:
Internal artifact repositories
Private source code management systems (SCMs)
Internal APIs and services
On-premises databases
Harness supports multiple approaches to enable secure communication between Harness Cloud infrastructure and your private network:
Cloud Private Connectivity - Use Tailscale networking and customer subnet routers or App Connectors to reach private services from supported hosted builds and Platform connector operations. Go to Cloud Private Connectivity for account availability, supported images, prerequisites, and configuration.
IP allowlisting - Allow Harness Cloud IP ranges through your firewall
Private network connectivity - Use cloud provider solutions like AWS PrivateLink or GCP Private Service Connect (Enterprise)
IP allowlisting
Your networking or security team can allowlist the IP ranges used by Harness Cloud to permit traffic from Harness-managed build infrastructure to your private resources.
Go to Retrieve allowlisted IPs for Harness Cloud to retrieve allowlisted IPs via API.
Go to Allowlist Harness domains and IPs to review IP allowlisting in detail, or contact Harness Support.
Private network connectivity (enterprise)
For enterprise customers with strict compliance and security requirements, you can use cloud provider private networking solutions for enhanced security without exposing traffic to the public internet.
Go to Harness Cloud Network and Security to review private network connectivity, including AWS PrivateLink and GCP Private Service Connect. Go to IP allowlisting to allowlist Harness Cloud IP ranges.
Queue Intelligence
With Queue Intelligence, Harness CI can queue and run build jobs in sequence when the build infrastructure receives more jobs than it can run concurrently.
The Queue Intelligence feature introduces a queued state for individual builds. Builds progress through the following states:
pending: Build request created and waiting for a delegate. The maximum timeout for this state is 12 hours.queued: Build request queued by a delegate. The maximum timeout for this state is 12 hours. When viewing the build in the UI, this state is indicated by a Queued license limit reached message.running: The delegate runs a build for each build stage in the pipeline. The maximum timeout for this state is one hour.
Harness Cloud best practices
Use these practices when you configure and run builds on Harness Cloud:
Do not hardcode system environment variables. Use references such as
$HOMEor$USER.Do not hardcode the number of processors or threads. Use commands such as
nprocto specify threads or jobs in build and test commands.Do not use tools that run only in a specific cloud environment, such as
gcloud. Harness Cloud sources build VMs from different cloud providers. You cannot predict the cloud provider that hosts a VM during an execution. Avoid tools, such asgsutilorgcloud, that require a specific cloud provider environment.Review the requirements for connectors and secrets.
Harness Cloud machine images can change. If your pipeline requires a specific software, tool, or environment version, lock versions to prevent failures when the image changes.
Add pipeline steps to specify tool versions, lock versions, configure environments, or install additional tools.
Run
apt-get updatebefore installing additional software that might not be in the image package list.
Troubleshooting
Next steps
Set up Kubernetes cluster build infrastructure: Set up, secure, and customize Kubernetes cluster build infrastructure to run Harness CI builds
Set up VM build infrastructure: Set up VM build infrastructures on AWS, Azure, GCP, or macOS to run Harness CI builds and configure high availability
Set up local runner build infrastructure: Define a CI build infrastructure on any Linux or macOS host
Last updated
Was this helpful?
