> 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-k8s-ref/kubernetes-rollout-restart.md).

# Kubernetes Rollout Step

This topic describes the **K8s Rollout** step, which allows you to manage your **Kubernetes Rolling Deployment**. In Pipeline Studio, this step is labeled **K8sRollout**. On inspection, the step is labeled **K8s Rollout**.

Harness follows standard Kubernetes behavior during rollout. To see what behavior this replicates, go to the subcommands of [kubectl rollout](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/#see-also) in the Kubernetes documentation.

When to use the **K8s Rollout** step

* **Configuration Changes**: When there are changes in ConfigMaps, Secrets, or other configurations that your application depends on, and you need to apply these changes without changing the image.
* **Certificate Rotation**: To apply new certificates.
* **Environment Variables Update**: When there are updates to environment variables in the pod specifications.
* **General Pod Refresh**: To refresh the state of pods without making changes to the container image.

### K8s Rollout Step <a href="#k8s-rollout-step" id="k8s-rollout-step"></a>

This step provides various commands like **Restart**, **Resume**, **Status**, **Undo**, **Pause** and **History** on top of basic Kubernetes rollout command.

![](/files/yCcssU6mDNjVOr4F7XD9)

You can target a specific **Resource**, **Manifest** as well **Release name**.

![](/files/NNY3PddrMato8fvWpLZV)

### Kubernetes Rollout YAML using supported Subcommands <a href="#kubernetes-rollout-yaml-using-supported-subcommands" id="kubernetes-rollout-yaml-using-supported-subcommands"></a>

In these example yaml we are using **Manifest** you can use **Resource name** as well as **Release name**

#### Kubernetes Rollout restart Yaml <a href="#kubernetes-rollout-restart-yaml" id="kubernetes-rollout-restart-yaml"></a>

Triggers a rolling restart of the pods managed by a deployment.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_Restart_ManifestPath_RuntimInput
    identifier: K8sRollout_Restart_ManifestPath_RuntimInput
    spec:
      command: restart
      resources:
        type: ManifestPath
        spec:
          manifestPaths: <+input>
    timeout: 10m
```

#### Kubernetes Rollout Pause <a href="#kubernetes-rollout-pause" id="kubernetes-rollout-pause"></a>

Pauses the rollout of a deployment.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_Pause_ManifestPath_fixedInput
    identifier: K8sRollout_Pause_ManifestPath_fixedInput
    spec:
      command: pause
      resources:
        type: ManifestPath
        spec:
          manifestPaths:
            - deployment.yaml

```

#### Kubernetes Rollout Status <a href="#kubernetes-rollout-status" id="kubernetes-rollout-status"></a>

Shows the status of the rollout.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_Status_ManifestPath_fixedInput
    identifier: K8sRollout_Status_ManifestPath_fixedInput
    spec:
      command: status
      resources:
        type: ManifestPath
        spec:
          manifestPaths:
            - deployment.yaml

```

#### Kubernetes Rollout Resume <a href="#kubernetes-rollout-resume" id="kubernetes-rollout-resume"></a>

Resumes a paused rollout.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_Resume_ManifestPath_fixedInput
    identifier: K8sRollout_History_ManifestPath_fixedInput
    spec:
      command: Resume
      resources:
        type: ManifestPath
        spec:
          manifestPaths:
            - deployment.yaml
    timeout: 10m
```

#### Kubernetes Rollout History <a href="#kubernetes-rollout-history" id="kubernetes-rollout-history"></a>

Shows the rollout history for a deployment.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_History_ManifestPath_fixedInput
    identifier: K8sRollout_History_ManifestPath_fixedInput
    spec:
      command: history
      resources:
        type: ManifestPath
        spec:
          manifestPaths:
            - deployment.yaml
    timeout: 10m
```

#### Kubernetes Rollout Undo <a href="#kubernetes-rollout-undo" id="kubernetes-rollout-undo"></a>

Reverts the deployment to a previous revision.

```yaml
- step:
    type: K8sRollout
    name: K8sRollout_Undo_ManifestPath_fixedInput
    identifier: K8sRollout_History_ManifestPath_fixedInput
    spec:
      command: Undo
      resources:
        type: ManifestPath
        spec:
          manifestPaths:
            - deployment.yaml
    timeout: 10m
```

### Video <a href="#video" id="video"></a>

Here's a video demo of how to add a K8s Rollout step:

{% embed url="<https://www.loom.com/share/e39980150e8e48dc8755885fc89afc72>" %}

### Advanced Settings <a href="#advanced-settings" id="advanced-settings"></a>

See the following:

* [Delegate Selector](/harness-ai/use-harness-platform/delegates/delegate/manage-delegates/select-delegates-with-selectors.md)
* [Conditional Execution](/harness-ai/use-harness-platform/pipelines/step-skip-condition-settings.md)
* [Failure Strategy](/harness-ai/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps.md)
* [Looping Strategy](/harness-ai/use-harness-platform/pipelines/looping-strategies/looping-strategies-matrix-repeat-and-parallelism.md)
* [Command Flags](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/cd-kubernetes-category/k8s-command-flags.md)
* [Policy Enforcement](/harness-ai/use-harness-platform/governance/policy-as-code/harness-governance-overview.md)

### See also <a href="#see-also" id="see-also"></a>

* [Kubernetes CD Quickstart](/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)
* [Kubernetes Deployments Overview](/continuous-delivery/use-continuous-delivery/deploy-services-on-different-platforms/kubernetes/kubernetes-deployments-overview.md)
