Harness CD: The basics and a quick tutorial

What is Harness Continuous Delivery (CD)?

Harness Continuous Delivery (CD) is a cloud-native platform simplifying software deployment through automation and GitOps support. Harness CD aims to streamline the delivery pipeline and reduce deployment risks by supporting various deployment strategies and offering tools for environment provisioning.

Harness CD integrates with cloud providers, infrastructure provisioners, and DevOps tools. It provides capabilities like automated rollbacks, policy-driven governance, and centralized visibility.

This is part of a series of articles about Harness.io

Key features of Harness CD

Key capabilities of the Harness CD platform include:

  • GitOps support: Harness CD provides GitOps support by integrating natively with tools like Argo CD and Flux. Teams can automate the path to production by syncing applications, creating pull requests, and triggering rollbacks directly from pipelines. A centralized control plane offers visibility across clusters.
  • No-script cloud-native deployment: Harness supports progressive deployment strategies such as canary, blue/green, and rolling deployments without requiring custom scripting. Teams can target any cloud provider, including AWS, GCP, and Azure.
  • AI-assisted deployment verification: Harness uses AI to analyze logs and APM telemetry, ensuring deployment health and identifying issues early. If anomalies are detected, the platform supports automated rollbacks.
  • Infrastructure provisioning: Harness supports infrastructure provisioning using tools like Terraform, Terragrunt, and AWS CDK. Teams can create short-lived environments to save costs while maintaining flexibility for different deployment pipeline stages.
  • Pipeline automation: With visual and code-based editors, Harness enables teams to build reusable, parameterized pipelines. Advanced controls like “barriers” ensure deployment synchronization across services, while looping or matrix actions allow handling of complex workflows.
  • Guardrails and policy enforcement: Harness integrates with Open Policy Agent (OPA) to enforce flexible policies, ensuring compliance with organizational standards. Features like enterprise-grade role-based access control (RBAC), deployment freezes, and audit trails enhance security and governance.
  • Deployment insights and dashboards: Harness provides dashboards with DORA metrics for monitoring delivery performance. Teams can customize dashboards using Looker-powered tools to visualize deployment data.

Tutorial: Harness CD Pipeline Execution

This tutorial explains how a typical Harness CD pipeline executes. A Harness CD pipeline execution leverages various entities to deploy a service. In this example, the pipeline includes:

  • A Deploy stage for a Kubernetes rolling deployment.
  • A Harness service, environment, and infrastructure definition.
  • Execution steps to perform the deployment.
  • A final cleanup step to delete the deployment after execution.

1. Service Evaluation

The Harness service represents the application or microservice being deployed and includes:

  • Manifest Definition: Harness fetches the deployment manifests (e.g., Kubernetes YAML files) from a remote source like Bitbucket, GitHub, or Harness File Store. This is done using a Harness Delegate, which connects to the source via a configured connector.
  • Artifact Configuration (Optional): If artifacts are defined, Harness can reference them using expressions like <+artifacts.primary.image>. This injects image tag details into the manifest at runtime.
  • Configuration Files (Optional): Harness retrieves additional configuration files (e.g., JSON or XML) and uses them during deployment.
  • Variables (Optional): Variables can be configured within the service or overridden at the environment level. These can be referenced in values.yaml or pipeline steps to dynamically adjust settings.

Harness pipeline

Source: Harness

2. Environment and Infrastructure Definition

The environment defines where the service will be deployed, such as Production or QA. Within an environment, you can configure infrastructure definitions, which specify the target deployment platform.

For a Kubernetes deployment, the infrastructure definition includes:

  • The Kubernetes cluster connector for authentication and deployment.
  • A Release Name, used to track and synchronize deployed resources.

Harness evaluates the infrastructure definition and its connector during pipeline execution to determine where to deploy the service.

3. Kubernetes Rollout Deployment

The Rollout Deployment step executes the deployment process. Harness assigns a delegate, which performs the following tasks:

  1. Fetch Files Task:
    • Harness fetches manifests using the connector defined in the service.
    • It resolves variables, secrets, and templates (e.g., Go or Helm) in the manifest files.
    • Any referenced secrets are masked in the deployment logs.
  2. Rollout Deployment Task:
    • The delegate authenticates with the target Kubernetes cluster using the connector.
    • The kubectl apply command is executed to deploy resources.
    • Harness monitors the steady state of the deployment using kubectl describe.

Harness rollout

Source: Harness

4. Kubernetes Delete Step

As a final cleanup step, the Kubernetes Delete step removes resources created during the pipeline execution. Harness uses the delegate to access the cluster and perform the deletion, respecting RBAC permissions configured on the Kubernetes cluster.

Harness delete

Source: Harness

Harness CD Limitations

When evaluating Harness CD, you should be aware of several key limitations, as reported by users on the G2 platform:

  • Steep learning curve: Harness CD introduces new features and domain-specific language for infrastructure as code (IaC), which requires significant time and effort to learn, especially for new users.
  • Documentation gaps: The platform’s documentation can be inconsistent or incomplete, making it challenging to troubleshoot issues or understand basic usage and integrations. Improved clarity and coverage are needed.
  • Pricing model: The pricing structure may feel disconnected from modern deployment practices, potentially making it expensive for smaller teams or organizations.
  • Limited debugging support: Build logs often lag behind execution by several seconds to minutes. Additionally, debugging tools are limited, and features like restarting builds with console access can be unreliable.
  • User interface and experience: While functional, the UI/UX could be more intuitive and streamlined. Certain configurations, such as Role-Based Access Control (RBAC), can be confusing and difficult to maintain.
  • Delegate installation: The installation process for Harness Delegates could be more automation-friendly, reducing manual intervention.
  • Support delays: Support response times can sometimes be slower than expected, which may hinder issue resolution during critical deployments.
  • Reporting and insights: The platform’s reporting capabilities have limitations in terms of representation and customization, which could affect visibility into deployment performance.

Octopus Deploy: Ultimate alternative to Harness CD

If you’re looking for a deployment tool that works without the hassle, Octopus Deploy is the way to go. Octopus integrates seamlessly with your existing CI setup, whether you’re using GitHub Actions, TeamCity, Jenkins, or something else. With 500+ automation templates ready to roll, you can get deployments up and running fast without dealing with complex infrastructure to execute automation.

Whether you deploy to modern cloud platforms or have those “legacy” systems that just won’t go away, Octopus makes it smooth and reliable. Octopus keeps things simple while handling the complexity behind the scenes. Tenanted deployments allow you to deploy to multiple customers without duplicating everything, while runbooks make automating operational tasks easy.

And when things don’t go as planned, Octopus gives you safe rollback options that prevent downtime and headaches. Plus, it’s more cost-effective, with transparent pricing and a UI that’s easy to learn, so your team spends less time figuring out deployments and more time shipping great software. If you want a deployment solution that’s powerful, flexible, and built for teams that move fast, Octopus is the right choice.

Why not request a demo or start a free trial to find out more.

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Categories:

Next article
DevOps