> 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/cd-kubernetes-category/ignore-a-manifest-file-during-deployment.md).

# Ignore a manifest file during deployment

Ignore selected Kubernetes manifests during the primary deployment and apply them with the Apply step

You might have manifest files for resources that you do not want to deploy as part of the main deployment. This topic describes how to ignore those manifests for the primary deployment and apply them separately with the Apply step, or ignore them and deploy them later.

***

## What you will learn from this topic

* How to [ignore a manifest](#ignore-a-manifest) with `# harness.io/skip-file-for-deploy`
* How to [apply an ignored resource](#apply-ignored-resource) with the Apply step and a relative **File Path**
* Which [workload limitations](#limitations) apply when you use the Apply step

***

## Before you begin

* **Kubernetes manifests in the service:** Add manifests to the stage service before you ignore or apply files. Go to [Define Kubernetes manifests](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-kubernetes-category/define-kubernetes-manifests.md) to add manifests.
* **Kubernetes deployment concepts:** Go to [Kubernetes deployments overview](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-deployments-overview.md) for strategy and workload background.
* **Supported 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 confirm which objects each step manages.

***

## Visual summary

The following image shows how you can ignore a Jobs manifest and then apply it separately with the Apply step.

![Ignore a Jobs manifest in Manifests and deploy it with an Apply step that points at jobs/job.yaml](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-2c728ff5d31bcc2510ba9f8c07a84c238189d187%2Fignore-a-manifest-file-during-deployment-17.png?alt=media)

***

## Limitations

Kubernetes objects and resources deployed by the Apply step are not versioned or rolled back automatically by Harness.

***

## Ignore a manifest

Add your manifest files to the stage **Service** section under **Manifests**. You can add manifests individually or by adding their parent folder.

![Kubernetes manifests listed under the service Manifests section](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-b0c979acd72986e38e84144fca08001409c4b7a4%2Fignore-a-manifest-file-during-deployment-18.png?alt=media)

To ignore a resource file in that directory, add the comment `# harness.io/skip-file-for-deploy` at the **top** of the file.

For example, the following ConfigMap file uses the skip comment:

![ConfigMap manifest with harness.io/skip-file-for-deploy at the top of the file](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-d4bebdc1dc274c469d7c8b180c7fe14cb178016c%2Fignore-a-manifest-file-during-deployment-19.png?alt=media)

When this pipeline runs, Harness does not apply that ConfigMap resource as part of the primary deployment.

{% hint style="warning" %}
**Comment placement**

The comment `# harness.io/skip-file-for-deploy` must be at the **top** of the file. If it is on the second line, Harness ignores the comment and deploys the resource as part of the main stage rollout.
{% endhint %}

***

## Apply ignored resource

The Apply step applies a resource from the service **Manifests** section explicitly. Provide the path and name of the file in **Apply**, and Harness deploys that resource.

Go to [Deploy manifests separately using the Apply step](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/deploy-manifests-using-apply-step.md) for Apply step settings.

For example, the following image shows a Jobs resource that uses `# harness.io/skip-file-for-deploy` so the stage does not apply it, and an **Apply** step that specifies the same Jobs resource:

![Skipped Jobs manifest paired with an Apply step File Path of jobs/job.yaml](https://3694223630-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fy1JhZ4oKIppwY7d5AhPj%2Fuploads%2Fgit-blob-2c728ff5d31bcc2510ba9f8c07a84c238189d187%2Fignore-a-manifest-file-during-deployment-17.png?alt=media)

The **File Path** setting in the Apply step must include the folder name and the file name. In the example above, the folder `jobs` is included with the file name `job.yaml`: `jobs/job.yaml`.

The path in **File Path** must be relative to the path you specified for the manifest in the service **Manifests** section.

For example, if the path in **Manifests** is `default-k8s-manifests/Manifests/Files/templates` and the Job manifest is in `default-k8s-manifests/Manifests/Files/templates/jobs/job.yaml`, enter `jobs/job.yaml` in **File Path**.

You can include multiple resource files in the Apply step **File Path** setting.

If you apply the ignore comment `# harness.io/skip-file-for-deploy` to a resource but do not use that resource in an **Apply** step, Harness never deploys the resource.

***

## Next steps

* [Kubernetes Apply step](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-k8s-ref/kubernetes-apply-step.md): Review Apply step fields and steady-state options.
* [Deploy manifests separately using the Apply step](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-executions/deploy-manifests-using-apply-step.md): Walk through Apply step configuration in a Deploy stage.
* [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): Confirm managed and unmanaged workload support by strategy.

{% @harness-feedback/feedback %}
