Infrastructure & Runtimes
Configure the compute resources where Harness 3.0 pipeline stages execute; Cloud, Kubernetes, Shell, and VM runtimes with platform and machine size options.
Infrastructure defines the compute resources where pipeline stages execute. Harness 3.0 supports multiple runtime types; Cloud (Harness-hosted), Kubernetes, Shell (bare-metal or VM), and VM runtimes. The runtime determines how steps are isolated, what resources are available, and how networking is configured.
interface Runtime {
// Runtime type
type: "cloud" | "kubernetes" | "shell" | "vm"
// Runtime-specific configuration
spec: RuntimeCloud | RuntimeKubernetes | RuntimeShell | RuntimeVM
}
interface Platform {
// Operating system
os: "linux" | "macos" | "windows"
// CPU architecture
arch: "amd64" | "arm64"
// OS variant (e.g., alpine, debian)
variant: string
// OS version
version: string
// Feature flags
features: string[]
}Cloud runtime
The Cloud runtime uses Harness-hosted infrastructure. No delegate or cluster configuration is required; Harness manages compute, scaling, and cleanup automatically.
Short configuration
Full configuration
Kubernetes runtime
The Kubernetes runtime executes pipeline stages as pods in your own Kubernetes cluster. This provides full control over the execution environment, network access, and resource allocation.
RESOURCE MANAGEMENT
Set resource requests and limits to ensure consistent performance and prevent noisy-neighbor issues in shared clusters. Without limits, pods may be evicted by the Kubernetes scheduler during memory pressure.
Shell runtime
The Shell runtime executes steps directly on the host machine where the Harness delegate is running. No containerization is involved. This is useful for on-premise environments, legacy systems, or workloads that require direct access to host resources.
SECURITY CONSIDERATION
Shell runtime steps execute with the same permissions as the Harness delegate process. Ensure proper access controls and isolation are in place, especially when running untrusted code or on shared hosts.
VM runtime
The VM runtime provisions a dedicated virtual machine for each stage execution. This provides full machine isolation, root access, and the ability to install arbitrary software. VMs are provisioned on demand and destroyed after the stage completes.
Platform configuration
The platform configuration specifies the operating system, CPU architecture, variant, version, and feature requirements for the runtime environment.
os
string
Operating system: linux, macos, windows
arch
string
CPU architecture: amd64, arm64
variant
string
OS variant, e.g., alpine, debian, ubuntu-22.04
version
string
Specific OS version string
features
string[]
Feature flags such as docker, gpu, nested-virtualization
Machine sizes
Machine sizes control the CPU and memory allocated to Cloud and VM runtimes.
flex
Auto
Auto
Default. Harness auto-scales based on workload. Best for most CI tasks.
small
1
2 GB
Lightweight scripts, linting, notifications.
medium
2
4 GB
Standard builds, unit tests, moderate compilation.
large
4
8 GB
Large builds, integration tests, Docker image builds.
xlarge
8
16 GB
Heavy compilation (C++, Rust), large monorepos, ML workloads.
xxlarge
16
32 GB
Enterprise-scale builds, large test suites, resource-intensive operations.
Multi-platform build example
Build the same application on multiple platforms simultaneously using matrix strategy with platform configuration.
Last updated
Was this helpful?