Harness GitOps

Updated 1 month ago by Michael Cretzman

Harness enables a developer-centric experience for managing applications by implementing the GitOps methodology across its components. For example, you can trigger deployments in Harness using Git Pull and Push events. As a result, Harness GitOps integration allows you to use Git as the single source of truth when maintaining the state of the deployment process in Harness.

In addition to strict GitOps features, Harness lets you sync any Harness Application with a Git repo, using either a one-way or two-way sync. Anything you can do in the Harness UI, you can do it in YAML in Git. For more information, see Configuration as Code.

The following table describes the many GitOps-enabled components of Harness.

Harness Feature

GitOps Functionality

Links to Topics

Triggers with Git Webhooks

Use a Harness Trigger Git Webhook URL to execute a Harness deployment in response to a Github, BitBucket, or GitLab event.

Manual Triggers and Git Webhooks

File-based Repo Triggers

Initiate the Harness Trigger only when specific files in the repo are changed. For example, initiate the Trigger only when a Helm values.yaml file in Git is changed.

File-based Repo Triggers

Using Git Push and Pull Request Variables in Harness Applications

Git push and pull request variables are available in a Trigger, and can be passed to the Workflows (and Pipelines) executed by the Trigger. An example variable is ${pullrequest.id} for Pull request ID.

Examples:

  • Map the Git payload to create uniquely-named Harness Environments and Service Infrastructures.
  • Use the Git payload with Git events, and Harness can respond to a Git event to build the artifact and deploy it to a unique infrastructure.

Push and Pull Request Variables

Passing Variables into Workflows and Pipelines from Triggers

Helm and Kubernetes Deployments

  • Pull a Helm chart from a Git repo.
  • Specify values or a full values.yaml file in Git repo and Harness will fetch the values during runtime.
  • Override Workflow variables using values added via a Git connector.
  • Map a Git payload, such as a PR number, to a Kubernetes namespace via variables. For example, you could use the PR number to create a unique Kubernetes namespace and deploy to that namespace to evaluate the PR build.

Helm Deployments

Kubernetes Deployments


How did we do?