Skip to main content
In this guide, we’ll walk through our CI/CD pipeline stages and demonstrate how to deploy a Dockerized application to Kubernetes clusters. You’ll learn how to:
  • Build and test your code
  • Containerize with Docker
  • Deploy to a development cluster
  • Run integration tests
  • Promote to production after manual approval

Deployment Pipeline Overview

We’ve already completed: Next, the pipeline will:
  1. Push the Docker image to a container registry
  2. Deploy to a Kubernetes development environment
  3. Execute integration tests against the dev cluster
  4. Await manual approval
  5. Promote the same deployment to the production environment

Local Development Commands

Before diving into Kubernetes, run these commands locally to verify your application:

Deploying to Kubernetes

To deploy the Docker image, prepare these Kubernetes manifests:
  • Deployment: Defines Pods and ReplicaSets in k8s/deployment.yaml
  • Service: Exposes Pods internally via k8s/service.yaml
  • Ingress: Routes external HTTP traffic using k8s/ingress.yaml
Apply them in sequence:

Integration Testing on Dev

Once the resources are live, validate the deployment:
A 200 OK response confirms that the application is operating correctly in the development cluster.
Ensure your Kubernetes context is set to the development cluster:

Manual Approval Gate

Before proceeding to production, implement a manual approval step in your CI/CD workflow. This prevents unintentional releases.
An administrator must review the integration test results and approve the release.
Skipping this step can lead to unverified changes reaching production.

Production Deployment

After approval, deploy to the production cluster using the same manifests:
  1. Switch to the production context:
  2. Apply the manifests:
  3. Run production integration tests:
Optionally, configure post-deployment alerts or monitoring checks to ensure reliability.

Next Steps

In the next lesson, we’ll cover Kubernetes fundamentals in depth and build automated workflow files for our CI/CD pipeline.

Watch Video