Kubernetes Deployments Overview

Updated 2 weeks ago by Michael Cretzman

This guide covers new Harness Kubernetes Deployment Version 2 features. For Version 1 Kubernetes and Helm deployment features, see Helm Deployments.

This guide will walk you through deploying a Docker image to a Kubernetes cluster using the Harness Kubernetes Deployment Version 2 features. This deployment scenario is very popular and a walkthrough of all the steps involved will help you set up this scenario in Harness for your own microservices and apps.

  1. Deployment Summary
  2. Kubernetes Services​
  3. ​Kubernetes Environments​
  4. ​Canary Workflows and Deployments​
  5. ​Blue/Green Workflows and Deployments​
  6. ​Rolling Update Workflows and Deployments
  7. Kubernetes Workflow Commands
  8. Workflow Variable Expressions
  9. Traffic Management
  10. Versioning and Annotations
  11. Ingress Rules
  12. Troubleshooting Kubernetes
  13. Harness Kubernetes V2 Changes

To see a summary of the changes in Harness Kubernetes Deployment Version 2, see Harness Kubernetes V2 Changes.

In Harness, a workload is a Deployment, StatefulSet, or DaemonSet object deployed and managed to steady state. For Rolling Update deployments, you can deploy multiple managed workloads. For Canary and Blue/Green Workflow deployments, only one managed object may be deployed per Workflow by default. You can deploy additional objects using the Apply Step, but it is typically used for deploying Jobs controllers. See Apply Step in Kubernetes Workflow Commands.

Deployment Summary

For a general overview of how Harness works, see Harness Architecture and Application Components.

The following list describes the major steps we will cover in this guide:

  1. Install the Harness Kubernetes Delegate in your Kubernetes cluster.
  2. Add an Artifact Server. In this guide, we will use a publicly-available Docker image of NGINX.
  3. Add a Cloud Provider. This is a connection to your Kubernetes cluster, either standalone or hosted in a cloud platform like GCP.
  4. Create the Harness Application for your Kubernetes CD pipeline. The Harness Application represents a group of microservices, their deployment pipelines, and all the building blocks for those pipelines. Harness represents your microservice using a logical group of one or more entities: Services, Environments, Workflows, Pipelines, Triggers, and Infrastructure Provisioners. Applications organize all of the entities and configurations in Harness CI/CD.
  5. Create the Harness Service using the Kubernetes type.
    1. Add your Kubernetes manifests and any config variables and files.
  6. Create the Harness Environment containing the Infrastructure Definition/Service Infrastructure definition of your Kubernetes cluster, and any overrides.
  7. Create the Canary, Blue/Green, or Rollout deployment Harness Workflow.
  8. Deploy the Workflow.
  9. Advanced options not covered in this guide:
    1. Create a Harness Pipeline for your deployment, including Workflows and Approval steps. For more information, see Pipelines.
    2. Create a Harness Trigger to automatically deploy your Workflows or Pipeline according to your criteria. For more information, see Triggers.
    3. Create Harness Infrastructure Provisioners for your deployment environments. For more information, see Infrastructure Provisioners.

What Are We Going to Do?

This guide walks you through deploying a publicly available Docker image of NGINX to a Kubernetes cluster using Harness. Basically, the Harness deployment does the following:

  1. Docker - Pull a Docker image of NGINX from Docker Hub.
  2. Kubernetes - Deploy to a Kubernetes cluster. We will cover Canary, Blue/Green, and Rollout deployments.

It's that simple, at a high level. We will walk through the steps to set up Harness for these deployments in detail.

What Are We Not Going to Do?

This is a simple guide that covers the basics of deploying artifacts to Kubernetes. It does not cover the following:

  • Teach you Kubernetes - This guide assumes you know Kubernetes and have deployed artifacts to a cluster. For a quick review of the Kubernetes concepts that you need for Harness Kubernetes deployments, see Deploy an application from Kubernetes. It's an excellent summary of key concepts.
  • Harness Delegate Installation - We will cover the recommended Delegate setup, but not every method. You can install the Delegate in a pod of your Kubernetes cluster or on any machine that has network access to your Artifact Source (such as Docker Hub) and Cloud Provider. For information, see Delegate Installation and ManagementDelegate Server Requirements, and Delegate Connection Requirements.

What Harness Needs Before You Begin

The following are required to deploy to Kubernetes:

  • Docker Artifact Server - An account with a Docker Artifact Server you can connect to Harness, such as Docker Hub.
  • Kubernetes Cluster - A Kubernetes Cluster running in your Kubernetes environment, such as a Cloud Platform.
  • Harness Kubernetes Delegate - A Harness Kubernetes Delegate installed that can connect to your Artifact Server and Cloud Provider. For information, see Delegate Installation and ManagementDelegate Server Requirements, and Delegate Connection Requirements.

We will walk you through the process of setting up Harness with connections to the artifact server and cloud provider, and the Harness Kubernetes Delegate installation is summarized also.

Next Step

How did we do?