Skip to main content

Deploy a Helm Chart

Pick the Harness CD & GitOps plan you are using from the tabs below to get started. If you don't have a plan yet, then sign up for the Free plan.

You can use Harness CD & GitOps in the following ways.

  • Pipeline approach: In this case, the availability of a new artifact (as the output of CI) to deploy triggers a deployment pipeline that pushes the new artifact on deployment targets.

  • GitOps approach: In this case, the need to deploy a new artifact is specified in the GitOps repo first. The GitOps agent observes this change and then pulls this change onto the deployment target using a sync process

Install Kubernetes Delegate

You will first install a delegate named my-harness-delegate on the Kubernetes cluster that is the deployment target using the Install Delegate tutorial.

Create a CD Pipeline

You are now ready to create your first Harness Pipeline. You will be deploying a WildFly Helm Chart coming from a public Helm Chart Repository. The following steps will walk you through how to create a Pipeline with those resources.

  • Deployments -> Pipelines + Create new Pipeline
  • Name: helm-pipeline
  • Setup Pipeline: Inline

Inline Pipeline

Click Start and now can add a Pipeline Stage by clicking the +Add Stage icon.

Deploy Stage

Select Deploy as the Stage. Next name the stage “Deploy Wildfly” as a type Service.

Stage Name

Then click Set Up Stage.

The first step is to define the Service e.g the “what” you are deploying by clicking on + New Service

About Service

Name: my-wildfly-instance

Service Name

Once Saved, the next step is to point to Bitnami’s WildFly Helm Chart. In the Service Definition section, select Native Helm as the Deployment Type. Then you can wire in the Helm Chart Repository information in the Manifest section.

About Service

Click on + Add Manifest in the Manifests Section then select Helm Chart as the Manifest Type.

Manifest Type

Click Continue and then select HTTP Helm as the Helm Chart Store. Create a new HTTP Helm Repo to connect to Bitnami’s Helm Chart Repository by clicking + New HTTP Helm Repo Connector. Follow the wizard.

Repo URL

Click Continue and can specify which Harness Delegate you would want to run the Helm operations on. If using this example, can select “Use any available Delegate”.

Manifest Delegate

Click Save and Continue which will run through a Connection Test.

Now you can enter the Helm Chart information.

  • Manifest Name: wildfly
  • Chart Name: wildfly
  • Helm Version: Version 3

Helm Details

Click Submit, and the WildFly Helm Chart will be wired to your Harness Pipeline Stage.

Wired Manifest

With the Helm Chart wired in, now you can define the “where” or the target Kubernetes cluster to deploy your Helm Chart to.

Set Your Deployment Target

With the “what” out of the way, the next two steps are the “where” and “how”. Click Continue after wiring in the Helm Chart, and you will be brought to the Infrastructure configuration.

Add Stage

The object being set up here is a Harness Environment; naming and saving the “where” you are deploying.

You can create a new Harness Environment via the wizard by clicking on + New Environment.

  • Name: my-k8s-environment
  • Environment Type: Pre-Production

New Environment

Click Save and now you are ready to wire in your Kubernetes cluster. Since your Delegate should be running in a Kubernetes cluster, you can create a reference to this cluster with a Cluster Connector.

Select “Direct Connection” Kubernetes then can fill out the Cluster Details with a New Connector.

Infra Defination

Click on Select Connector and then + New Connector

Once clicked on + New Connector, can give a name to your Kubernetes cluster.

Name: my-k8s-cluster

K8s Cluster Name

Click Continue and select “Use the credentials of a specific Harness Delegate” to connect.

Cluter Connect

Click Continue and select the Harness Delegate you installed into your Kubernetes Cluster e.g my-harness-delegate.

K8s Delegate

Click Save and Continue and a connectivity test will occur. Click Finish and you can enter a namespace that is available on the Kubernetes cluster.

  • Namespace: default

K8s Cluster Details

Click Continue and now you are ready to configure how you want your deployment to execute.

How Your Pipeline Deploys

Clicking Continue, you are now ready to configure the Execution Strategy or the “how” your Pipeline executes. For the example, a Rolling Deployment is simplest.

Deployment Strategy

Select “Rolling” then click on Use Strategy. Now you are ready to save this Pipeline and execute the Pipeline to create a deployment e.g a Helm Release.

Pre Run

Click Save and you are now ready to run your Pipeline executing the Helm Chart.

Your First Pipeline Execution with Helm

Executing your Pipeline is easy. Just click Run back in the Pipelines menu and you are on your way to a Helm Release.

Run Pipeline

Click Run Pipeline and your Pipeline will execute. In the “Install/Upgrade” section of the console output, you will see commands to visit your new Wildfly instance.

Helm Output

E.g.

kubectl get svc --namespace default release-6b428c463af2c7ed8766defc9ac7c844a02c7385-wildfly

Head to the External-IP and check out your new Helm Release.

External IP

Heading to http://34.123.210.140

Wildfly

Congratulations on your first Harness Helm Deployment [release]!