> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-deployments-overview.md).

# Kubernetes deployments overview

High-level view of Harness Kubernetes deployment.

This topic describes a Harness Kubernetes deployment and its high-level steps.

Go to [Kubernetes deployment tutorial](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-cd-quickstart.md) to follow a quick tutorial.

Go to [Harness key concepts](https://developer.harness.io/docs/platform/get-started/overview) to review platform basics before you start.

## What you will learn from this topic

* **Workload types:** Which Kubernetes workloads Harness manages and which it treats as unmanaged.
* **Deployment strategies:** How Canary, Blue Green, and Rolling strategies behave in Harness Kubernetes deployments.
* **Deployment steps:** The major steps involved in setting up a Harness Kubernetes deployment pipeline.

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

A Harness Kubernetes deployment requires the following:

* Kubernetes manifests and values YAML files.
* Artifact, if not hardcoded in manifests or values file. For example, a Docker image of NGINX from Docker Hub.
* Kubernetes cluster: You will need a target cluster for the Harness Delegate, your app, and your Kubernetes workloads. Your cluster should have enough RAM to host the Delegate and your apps and workloads.

### What does Harness deploy? <a href="#what-does-harness-deploy" id="what-does-harness-deploy"></a>

Harness takes the artifacts and Kubernetes manifests you provide and deploys them to the target Kubernetes cluster. You can deploy Kubernetes objects via manifests. You can provide manifests using remote sources and Helm charts.

### What is a workload in Harness? <a href="#what-is-a-workload-in-harness" id="what-is-a-workload-in-harness"></a>

Harness deployments involve different strategies and steps. These strategies and steps support different Kubernetes objects as managed and unmanaged workloads.

Go to [what can I deploy in Kubernetes?](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-k8s-ref/what-can-i-deploy-in-kubernetes.md) to review each strategy and workload support.

The following tables provide a useful summary.

### Managed workloads table

In Harness, a **managed** Kubernetes workload is a Kubernetes object deployed and managed to steady state. If steady state is not reached, the deployment is considered a failure and the Failure Strategy is executed (typically rollback).

|                |           |             |              |                           |                           |           |
| -------------- | --------- | ----------- | ------------ | ------------------------- | ------------------------- | --------- |
|                | **Apply** | **Rolling** | **Rollback** | **Blue Green**            | **Canary**                | **Scale** |
| **Deployment** | Yes       | Yes         | Yes          | Yes: 1 Deployment allowed | Yes: 1 Deployment allowed | Yes       |
| **DaemonSet**  | Yes       | Yes         | Yes          | No                        | No                        | Yes       |
| **CRDs**       | Yes       | Yes         | Yes          | No                        | No                        | No        |
| **Any Object** | Yes       | No          | No           | No                        | No                        | No        |

### Unmanaged workloads table

To deploy an object outside of the managed workloads in any strategy, you use the Harness [annotation](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-k8s-ref/kubernetes-annotations-and-labels.md) to make it unmanaged: `harness.io/direct-apply: "true"|"false"`. Set to `true` to make a manifest an unmanaged workload.

For example, Harness Canary and Blue/Green steps support a single **Deployment**, but you can deploy additional workloads as unmanaged using the `harness.io/direct-apply:true` annotation.

|                |           |             |              |                           |                           |           |
| -------------- | --------- | ----------- | ------------ | ------------------------- | ------------------------- | --------- |
|                | **Apply** | **Rolling** | **Rollback** | **Blue Green**            | **Canary**                | **Scale** |
| **Any Object** | Yes       | Yes         | No           | Yes: 1 Deployment allowed | Yes: 1 Deployment allowed | No        |

### Canary and Blue Green strategies

Harness Canary and Blue Green steps support a single **Deployment**. You must deploy exactly one **Deployment**.

### Rolling (Rollout) strategy

Rolling strategy steps support Deployment or DaemonSet as **managed** workloads, but not other workloads such as Jobs.

### Apply step

The [Apply Step](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/deploy-manifests-using-apply-step.md) can deploy any workload or object in any strategy as a managed workload. You can select whether to skip the steady state check.

### OpenShift <a href="#openshift" id="openshift"></a>

Harness supports OpenShift [DeploymentConfig](https://docs.openshift.com/container-platform/4.1/applications/deployments/what-deployments-are.html) in OpenShift clusters as a managed workload across Canary, Blue Green, and Rolling deployment strategies. Use `apiVersion: apps.openshift.io/v1` and not `apiVersion: v1`.

### What does a Harness Kubernetes deployment involve?

You can complete all necessary steps while creating your CD pipeline. You can also set up resources, such as connectors, and then select them in your pipeline.

The following list describes the major steps of a Harness Kubernetes deployment. We assume you have a [Harness project](https://developer.harness.io/docs/platform/get-started/overview#organizations-and-projects) set up.

| **Step**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | **Name**                                                                                                                 | **Description and Links**                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Install the Harness Kubernetes **Delegate** in your Kubernetes cluster.                                                  | Typically, the Kubernetes Delegate is installed in the target cluster where you will deploy your application(s).                                                                          |
| 2                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Add Harness **Connectors**.                                                                                              | Add a Harness **Connector** for your artifact repo and target cluster.                                                                                                                    |
| For example, a Docker Registry Artifact Server that connects to the Docker registry where your Docker images are located, or the public Docker Hub. You can connect to specific target cloud platforms hosting your cluster or make a platform-agnostic connection to the cluster.                                                                                                                                                                                                                                                                                                                                                         |                                                                                                                          |                                                                                                                                                                                           |
| This can be done inline while creating your Pipeline, or separately in your **Resources**.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                                                                                                                          |                                                                                                                                                                                           |
| 3                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Define the Harness **Service** using the Kubernetes Deployment Type.                                                     | Add your Docker images, Kubernetes manifests, and any config variables and files.                                                                                                         |
| Go to [Add Container Images for Kubernetes Deployments](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-kubernetes-category/add-artifacts-for-kubernetes-deployments.md).                                                                                                                                                                                                                                                                                                                                                                                                                |                                                                                                                          |                                                                                                                                                                                           |
| 6                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Define the Harness **Environment** and infrastructure definition for your target Kubernetes clusters, and any overrides. | Using the Harness Connector you set up, you can select the target Kubernetes cluster and namespace for your deployment.                                                                   |
| Go to [Define Your Kubernetes Target Infrastructure](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/define-your-kubernetes-target-infrastructure.md).                                                                                                                                                                                                                                                                                                                                                                                                                                      |                                                                                                                          |                                                                                                                                                                                           |
| 7                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Add the Canary, Blue Green, or Rollout steps to the Deploy stage.                                                        | The stage deploys the artifact(s) and Kubernetes workloads defined in the Harness Service to the cluster and namespace in the Infrastructure Definition.                                  |
| Go to [Create a Kubernetes Rolling Deployment](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/create-a-kubernetes-rolling-deployment.md), [Create a Kubernetes Canary Deployment](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/create-a-kubernetes-canary-deployment.md), or [Create a Kubernetes Blue Green Deployment](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/create-a-kubernetes-blue-green-deployment.md). |                                                                                                                          |                                                                                                                                                                                           |
| 8                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Deploy the pipeline.                                                                                                     | After you deploy a pipeline, go to [Kubernetes how-tos](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes.md) to improve your Kubernetes CD. |

## Next steps

The following topics build on what you have learned:

* [Kubernetes deployment tutorial](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-cd-quickstart.md)
* [Kubernetes how-tos](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes.md)

### FAQs <a href="#faqs" id="faqs"></a>

Go to [Kubernetes deployment FAQs](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-faqs.md) to review frequently asked questions about Kubernetes deployments in Harness.

{% @harness-feedback/feedback %}
