Kubernetes Deployments Overview
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.
- Deployment Summary
- Kubernetes Services
- Kubernetes Environments
- Canary Workflows and Deployments
- Blue/Green Workflows and Deployments
- Rolling Update Workflows and Deployments
- Kubernetes Workflow Commands
- Workflow Variable Expressions
- Traffic Management
- Versioning and Annotations
- Ingress Rules
- Troubleshooting Kubernetes
- Harness Kubernetes V2 Changes
To see a summary of the changes in Harness Kubernetes Deployment Version 2, see Harness Kubernetes V2 Changes.
The following list describes the major steps we will cover in this guide:
- Install the Harness Kubernetes Delegate in your Kubernetes cluster.
- Add Artifact Server. In this guide, we will use a publicly-available Docker image of NGINX.
- Add Cloud Provider. This is a connection to your Kubernetes cluster, either standalone or hosted in a cloud platform like GCP.
- 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.
- Create the Harness Service using the Kubernetes type.
- Add your Kubernetes manifests and any config variables and files.
- Create the Harness Environment containing the Service Infrastructure/Infrastructure Definition definition of your Kubernetes cluster, and any overrides.
- Create the Canary, Blue/Green, or Rollout deployment Harness Workflow.
- Deploy the Workflow.
- Advanced options not covered in this guide:
- Create a Harness Pipeline for your deployment, including Workflows and Approval steps. For more information, see Pipelines.
- Create a Harness Trigger to automatically deploy your Workflows or Pipeline according to your criteria. For more information, see Triggers.
- 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:
- Docker - Pull a Docker image of NGINX from Docker Hub.
- 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 Management, Delegate 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 Management, Delegate 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.