Convert your HSF installation to use Kubernetes
When to use this
By default, HSF runs on Harness Cloud build infrastructure. Convert your installation to use Kubernetes when any of the following apply:
- You are standardizing CI/CD execution on Kubernetes across your environment and want HSF's pipelines to run consistently with the rest of your infrastructure.
- Your organization requires build infrastructure to run inside your own network (VPC, on-prem cluster, etc.) rather than on Harness-hosted runners, for compliance or security reasons.
- Your registry is not reachable from Harness Cloud. If your private registry (for example JFrog, ECR, ACR) is only accessible from your internal Kubernetes network, pipelines that pull images, including the IaCM
harness_terraform_vmimage, fail on Harness Cloud regardless of which connector is configured at the Org or Project level. This is the most common reason customers need this conversion.
Convert to Kubernetes
- Navigate to the
Solutions Factoryproject within theHarness Platform Managementorganization of your Harness account - Open the
Infrastructuremodule and chooseWorkspaces - Find and select the
Harness Pilot Lightworkspace - Navigate to the
Variablestab and chooseOpenTofu Variables - Edit
kubernetes_connectorto provide an existing Kubernetes connector reference. Note: The connector will need to be scoped to the correct location where the connector exists. Prefix withaccount.ororg.depending on its location. - Optionally add the following variables based on your target build infrastructure
kubernetes_namespaceto modify the namespace into which the pods will be deployedkubernetes_serviceaccountto modify the service account which the pods will be assignedkubernetes_node_selectorsto modify the node selector which the pods will usekubernetes_override_image_connectorto modify the image connector used to pull built-in steps images
If you specify a custom default image connector via kubernetes_override_image_connector you will need to make sure the Harness built-in images are moved to your registry as well.
Go to Override Image Connector for more information.
Additional details around the various options and variables can be found in the pilot-light directory of the Harness Solutions Factory repository
- Navigate to pipelines
If your private registry is only reachable from your internal
Kubernetes network, running the Manage Pilot Light pipeline as-is may fail.
This happens because IaCM pulls the harness_terraform_vm image using the
account-level harnessImage connector by default, regardless of any
Org-level Docker connector you have configured for HSF images. Harness Cloud
build infrastructure will not be able to reach a registry that is only
accessible from your internal network.
Before running the pipeline in the next step, manually edit the
Manage Pilot Light pipeline to use your Kubernetes-scoped connector for the
relevant image pull step(s). This ensures the pipeline can retrieve the
images it needs during the conversion itself.
If you are pulling from a private registry rather than Docker Hub, confirm you have mirrored the current image versions listed above. Stale images in your registry are a common secondary cause of failures at this step.
- Run the pipeline
Manage Pilot Lightto apply the changes.
STOP: Changing the Kubernetes connector in this workspace only modifies it for the core resources and does not change the underlying connection for the engine pipelines. After the pipeline Manage Pilot Light executes, continue these steps
- Navigate to the
Solutions Factoryproject within theHarness Platform Managementorganization of your Harness account - Open the
Infrastructuremodule and chooseWorkspaces - Find and select the
Harness Solutions Factoryworkspace - Navigate to the
Variablestab and chooseOpenTofu Variables - Edit
kubernetes_connectorto provide an existing Kubernetes connector reference. Note: The connector will need to be scoped to the correct location where the connector exists. Prefix withaccount.ororg.depending on its location. - Optionally, edit
kubernetes_namespaceto modify the namespace into which the pods will be deployed.
Additional details around the various options and variables can be found in the solutions-factory directory of the Harness Solutions Factory repository
- Navigate to pipelines
- Run the pipeline
Deploy Solutions Factoryto apply the changes.
If you are using custom internal certificates and see this error "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Missing Authority Key Identifier", you will need to go into both Solutions Factory and Pilot Light workspaces and set hsf_plugin_ssl_verify_x509_strict to false and apply.
This will still enforce certificates but not in strict mode.
Related: Configuring a Kubernetes build farm to use self-signed certificates