For the complete documentation index, see llms.txt. This page is also available as Markdown.

Via Terraform and Helm

Learn how to set up and configure Harness Cluster Orchestrator for AWS EKS using Terraform and Helm

What's New?

Before You Begin

For complete prerequisites, required tools, environment variables, and AWS/Kubernetes permissions, see the Installation Guide.

Quick Prerequisites Checklist

  • AWS Account with permissions to create IAM roles and policies

  • EKS Cluster running and accessible via kubectl

  • Helm 3.x or later installed on your local machine

  • Terraform 1.2.0 or later installed on your local machine

  • Harness Account with CACM module enabled

  • Kubernetes Connector configured in your Harness account

  • Environment variables set: CLUSTER_NAME, REGION, CCM_K8S_CONNECTOR_ID, TOKEN

AWS Spot Instance Service-Linked Role

Required for provisioning spot instances. Create this role in your AWS account before enabling Cluster Orchestrator:

This is an AWS account-level role, not specific to individual EKS clusters. Without this role, new nodes will fall back to on-demand instances instead of spot instances. For more information, see AWS Spot Instance Service-Linked Roles.

Implementation Steps

Step 1: Set Up Required Infrastructure with Terraform

First, we'll use Terraform to set up the required infrastructure components:

  • AWS IAM roles and policies with proper permissions

  • Resource tagging for subnets, security groups, and AMIs

  • Harness service accounts and API tokens

If you are re-running the enablement script or Terraform template Cluster Orchestrator related to Karpenter 1.7.3

As part of onboarding script or Helm upgrade, CRDs for Nodepools, EC2NodeClass, and NodeClaims will be upgraded. If using GitOps, users have to manually upgrade the CRDs:

  • Nodepool → https://raw.githubusercontent.com/aws/karpenter-provider-aws/v1.7.3/pkg/apis/crds/karpenter.sh_nodepools.yaml

  • NodeClaim → https://raw.githubusercontent.com/aws/karpenter-provider-aws/v1.7.3/pkg/apis/crds/karpenter.sh_nodeclaims.yaml

  • EC2NodeClass → https://raw.githubusercontent.com/aws/karpenter-provider-aws/v1.7.3/pkg/apis/crds/karpenter.k8s.aws_ec2nodeclasses.yaml

Click to expand the Terraform template

How to Run the Terraform Script

  1. Save the above template to a file named cluster-orchestrator.tf

  2. Update the placeholder values in the default blocks with your actual EKS cluster and Harness account information

  3. Initialize and apply the Terraform configuration:

Important Terraform Outputs

After successful execution, Terraform will generate several outputs required for the Helm installation:

Output
Description

harness_ccm_token

The Harness CACM token (sensitive value)

eks_cluster_controller_role_arn

The ARN for the EKS cluster controller role

eks_cluster_default_instance_profile

The name of the default EC2 instance profile

eks_cluster_node_role_arn

The ARN for the node IAM role

harness_cluster_orchestrator_id

The Cluster Orchestrator ID

Step 2: Configure Helm for Cluster Orchestrator Installation

1. Add the Harness CACM Cluster Orchestrator Helm Repository

2. Update the Helm Repository

Step 3: Install the Cluster Orchestrator

1. Retrieve the Terraform Output Values

To get the sensitive token value, run:

For other values, you can run:

2. Install the Helm Chart

Use the following command to install the Cluster Orchestrator, replacing the placeholders with values from your Terraform outputs:

Troubleshooting

Missing OIDC Provider

If your cluster doesn't have an OIDC provider ARN configured, you can create one with the following command:

Verifying Installation

Check if the Cluster Orchestrator pods are running correctly:

Why are instances with AL2023 AMIs not joining the cluster as nodes?

Default configuration in the harness-default ec2nodeclass is set to use the AL2 AMI family. Updating it to AL2023 enables support for AL2023 AMIs, allowing new instances to successfully join the cluster. 🛠️ Steps to fix:

  • Run the following command to edit the node class configuration:

  • In the spec section, locate the amiFamily field.

  • Replace AL2 with AL2023.

  • Save and exit the editor.

  • After making this change, newly provisioned instances using AL2023 AMIs will properly join the cluster as nodes.

Next Steps

After successful installation:

  1. Navigate to the Harness CACM module to verify the Cluster Orchestrator is connected

  2. Configure optimization policies in the Harness CACM UI

  3. Monitor your cluster for cost optimizations in the Harness dashboard

Last updated

Was this helpful?