Skip to main content

Getting Started with Deployments

Last updated on

This guide walks you through creating your first deployment pipeline in Harness Continuous Delivery (CD). You'll build a complete pipeline from scratch, step by step.

New to Harness CD?

Start with the CD Overview to understand key concepts, including Services, Environments, Pipelines, and Deployment Strategies.

What you'll accomplish:

  1. Create a deployment pipeline
  2. Configure a service (what to deploy)
  3. Set up an environment (where to deploy)
  4. Choose an execution strategy
  5. Run your first deployment

Prerequisites

Before you begin, ensure you have:

  • A Harness account - Sign up for free
  • Access to a Harness project - Use the Default Project or create your own

Platform-Specific Prerequisites

Select your deployment platform to see all requirements and set up connectors:

Infrastructure Requirements:

  • A Kubernetes cluster (local like K3D, or cloud-managed like GKE, EKS, AKS)
  • kubectl access to your cluster
  • Application deployed to a container registry (Docker Hub, ECR, GCR, etc.)
  • A Harness Delegate installed - Required to connect to your cluster. Follow the delegate installation guide

Quick Verification:

# Verify kubectl access
kubectl cluster-info
kubectl get nodes

Required Connectors:

  1. Kubernetes Cluster Connector - Connects Harness to your cluster

    • Go to Project SetupConnectorsNew ConnectorKubernetes Cluster
    • Choose connection method (Delegate, Service Account, etc.)
    • Follow: Create a Kubernetes connector
  2. Git Connector - For storing Kubernetes manifests

    • Go to Project SetupConnectorsNew ConnectorGitHub/GitLab/Bitbucket
    • Provide repository URL and authentication (Personal Access Token recommended)
    • Follow: Git connector setup
  3. Docker Registry Connector - For pulling container images

    • Go to Project SetupConnectorsNew ConnectorDocker Registry
    • For Docker Hub: Use https://registry.hub.docker.com/v2/
    • For ECR/GCR/ACR: Use respective registry URLs
    • Follow: Docker Registry connector

Important Notes:

  • Complete all connector setups before proceeding - You'll select these connectors in the following steps
  • Test each connector - Use the "Test Connection" button to verify connectivity
  • Save connector identifiers - You'll reference these by name when configuring services and environments

Step 1: Create Your Pipeline

Follow these steps to create your first deployment pipeline.

1. Navigate to Pipelines

  1. From your Harness project, select Pipelines from the left navigation menu.
  2. Click + Create a Pipeline.

2. Configure Pipeline Basics

  1. Provide a Name for your pipeline (e.g., "Deploy to Production")
  2. Choose Inline for Pipeline Storage (stores configuration in Harness)
  3. Click Start
info

You can also store pipelines in Git using Remote storage. Learn more in the Pipelines documentation.

Step 2: Add a Deploy Stage and Configure Deployment

Add a Deploy stage and configure your deployment based on your target platform.

  1. Select the Deploy stage type.
  1. In the "About your Stage" section:
    • Enter a Stage Name (e.g., "Deploy to Dev")
    • Select your Deployment Type

Select Your Deployment Type

This guide covers the most common deployment types. Select the one that matches your infrastructure:

  • Kubernetes - Deploy to any Kubernetes cluster
  • AWS Lambda - Serverless functions on AWS
  • Google Cloud Run - Fully managed containers on GCP
  • Azure Web Apps - PaaS web applications on Azure
  • Azure Functions - Serverless compute on Azure
  • SSH - Deploy to Linux/Windows servers
tip

Harness supports 20+ deployment types including ECS, Helm, SAM, Google Cloud Functions, Spot, Tanzu, and more. For a complete list, see What's Supported in CD.

  1. Click Set Up Stage to continue.
important

The deployment type you select here determines the configuration needed in Service, Environment, and Infrastructure sections. Make sure to follow the same deployment type throughout all configuration steps.

Step 3: Configure Your Service

The Service defines what you're deploying (application, artifacts, manifests). Select your deployment platform below:

Kubernetes Service Configuration

  1. In the Service tab, click + Add Service
  2. Provide a Name (e.g., nginx-service) and click Save

Add Kubernetes Manifest

  1. Click Add Manifest → Select K8s Manifest
  2. Configure:
    • Manifest Identifier: k8s-manifest
    • Git Connector: Select the Git connector you created in Prerequisites
    • Repository: Use https://github.com/harness-community/harnesscd-example-apps
    • Branch: master
    • File Path: guestbook/manifest.yaml

Sample Manifest:

apiVersion: apps/v1
kind: Deployment
metadata:
name: guestbook-ui
spec:
replicas: 3
selector:
matchLabels:
app: guestbook-ui
template:
metadata:
labels:
app: guestbook-ui
spec:
containers:
- name: guestbook-ui
image: <+artifact.image>
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: guestbook-ui
spec:
type: LoadBalancer
selector:
app: guestbook-ui
ports:
- protocol: TCP
port: 80
targetPort: 80

Add Container Image

  1. Click Add Primary Artifact → Select Docker Registry

  2. Configure:

    • Artifact Source Name: nginx
    • Docker Registry Connector: Select the Docker Registry connector you created in Prerequisites
    • Image Path: library/nginx
    • Tag: Select stable or use <+input> for runtime input
  3. Click Continue to proceed to Environment configuration.

info

You can also use Helm charts or Kustomize for Kubernetes deployments.


Step 4: Configure Environment and Infrastructure

Define where you're deploying (Environment) and the specific infrastructure details. Select your deployment platform:

Kubernetes Environment & Infrastructure

Create Environment

  1. Click + New Environment
  2. Configure:
    • Name: dev-environment
    • Environment Type: Pre-Production
  3. Click Save

Define Infrastructure

  1. Click + Select Infrastructure

  2. Provide Name: k8s-dev-cluster

  3. Configure connection:

    • Connector: Select the Kubernetes cluster connector you created in Prerequisites
    • Namespace: Enter target namespace (e.g., default, dev, production)
    • Release Name: release-<+INFRA_KEY> (for deployment tracking)
  4. Click Continue to proceed to Execution.

info

See Kubernetes infrastructure for advanced configuration options.

Step 5: Configure Execution Strategy

Different deployment types support different execution strategies. Select your deployment platform to see available strategies:

Kubernetes Execution Strategies

Choose how your Kubernetes deployment will be executed:

  1. In the Execution tab, Harness automatically adds a Rollout Deployment step
  1. Click on the step to choose your execution strategy:

Available Strategies for Kubernetes:

  • Rolling: Incrementally updates pods with zero downtime. Supports all Kubernetes workloads (Deployment, DaemonSet, etc.)
  • Blue Green: Deploys new version alongside old, then switches traffic instantly. Supports Deployment workloads only
  • Canary: Gradually routes traffic to new version in phases. Supports Deployment workloads only
  • Blank Canvas: Start with empty execution for custom workflows
  1. Select your strategy and click Use Strategy
info

For more details on Kubernetes deployment strategies, see What Can I Deploy in Kubernetes?


Optional: Enable Continuous Verification

Add automated health monitoring to any deployment:

  1. Toggle Enable Continuous Verification
  2. Configure your monitoring tools (APM, logging, metrics)
info

Learn about verification in the Continuous Verification documentation.

Step 6: Run Your Pipeline

After completing all configuration steps, execute your deployment:

  1. Ensure your pipeline is saved (click Save if needed)
  2. Click Run in the top right corner
  3. Provide any required runtime inputs:
    • Artifact versions or tags
    • Environment variables
    • Infrastructure parameters
  4. Click Run Pipeline to begin execution

Harness will execute your deployment and display real-time progress, logs, and status for each step.

info

For detailed information on monitoring execution, viewing logs, troubleshooting failures, and understanding deployment status, see the Pipeline Execution Walkthrough.

Next Steps

Explore More Tutorials

Now that you've completed your first deployment, dive deeper with platform-specific tutorials and sample applications:

tip

The harnesscd-example-apps repository contains complete working examples with manifests, configurations, and artifacts that you can fork and use in your own pipelines.

What's Next

Congratulations on completing your first deployment! Continue your Harness CD journey:

Harness CD self-paced training

For an interactive onboarding experience including advanced features like canary deployments, blue-green strategies, and automated rollbacks, check out Harness CD self-paced training.