For the complete documentation index, see llms.txt. This page is also available as Markdown.

Kubernetes Blue Green Stage Scale Down

Clean up the old pod set after a successful blue-green swap to free cluster resources.

The Kubernetes Blue Green Stage Scale Down step removes the old pod set after a successful blue-green swap. Add it after the Swap Services Selectors step when you want to free cluster resources once you are confident the new version is stable.


Before you begin

Before you configure the step, make sure you have the following in place:

  • A Kubernetes service: Go to Kubernetes services to set up service manifests and artifact source.

  • A Kubernetes infrastructure: Go to Kubernetes infrastructure to connect a cluster and namespace.

  • A Harness delegate in target cluster: The delegate runs deployment steps in the cluster.

  • Runtime configuration: Every Kubernetes stage requires a runtime block specifying connector and namespace. Go to Kubernetes runtime configuration to understand the required fields.


Configure the step

The following parameters are available on the Kubernetes Blue Green Stage Scale Down step.

Parameter
Description
Required

Name

Display name for this step in the stage canvas. Default: Kubernetes Blue Green Stage Scale Down.

Required

Kubeconfig Path

Path to the kubeconfig file. Default: ${{infra.kube_config_path}}.

Optional

Namespace

Target namespace. Default: ${{infra.namespace}}.

Optional

Release Name

Name used to look up the release history for the old pod set. Default: ${{infra.releaseName}}.

Optional

Log Level

Verbosity of step logs. Default: info.

Optional


How the step works

The step removes the following resources for the old (inactive) pod set:

  • HorizontalPodAutoscaler and PodDisruptionBudget resources

  • Deployments, DeploymentConfigs, and StatefulSets

  • DaemonSets (scaled to zero replicas)

RESOURCES ARE DELETED, NOT SCALED TO ZERO

The Scale Down step deletes workload resources rather than setting replicas to zero. This prevents HPA from overriding a zero-replica state on subsequent deployments. HPA and PDB resources deleted during Scale Down are not recreated during rollback; they require redeployment to restore.


Advanced settings

  • Timeout duration: Maximum time the step can run before Harness terminates it.

  • On failure: Define what happens if the step fails, such as retry, mark as success, or abort.

  • Strategy: Configure a looping strategy to run this step over a list of values.

  • Conditional execution: Run this step only when a specified condition is true.


Next steps

Last updated

Was this helpful?