Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

CI/CD Pipeline Fundamentals for Kubernetes: Workflow, Tool Comparison, and Practical Starter Config

A reliable CI/CD pipeline turns code changes into repeatable, low-risk releases. This guide is for DevOps engineers and platform teams who want a practical baseline for building, testing, and deploying containerized applications, with clear gates for quality and production safety.

Originally published on 2009-03-27; fully revised and updated.

What a practical CI/CD pipeline includes

A production-ready pipeline is more than a build script. It should enforce consistent checks, produce traceable artifacts, and support safe rollouts with rollback options.

  • Source stage: trigger on pull requests and protected branches.
  • Continuous integration stage: run linting, unit tests, and optionally security checks.
  • Artifact stage: build immutable artifacts (such as container images) and push to a registry.
  • Continuous delivery stage: deploy to staging automatically, then promote to production with policy controls.
  • Post-deploy stage: verify health, monitor metrics/logs, and enable quick rollback.

Reference workflow from commit to production

This flow is a strong default for teams running containerized workloads on Kubernetes.

flowchart TD
    A[Developer pushes commit] --> B[CI runs lint and unit tests]
    B --> C{Checks pass}
    C -- no --> D[Fail pipeline and notify team]
    C -- yes --> E[Build container image]
    E --> F[Push image to registry]
    F --> G[Deploy to staging]
    G --> H[Run integration tests]
    H --> I{Approved for production}
    I -- no --> J[Stop release and investigate]
    I -- yes --> K[Deploy to production]
    K --> L[Monitor and rollback if needed]

Choose a pipeline platform that matches your operating model

Different teams optimize for different constraints: speed of setup, UI experience, plugin ecosystem, Kubernetes-native execution, or enterprise control.

ToolBest forStrengthsTrade-offs
GitHub ActionsTeams already centered on GitHub repositoriesFast onboarding, native repo integration, large action ecosystemComplex workflows can become hard to maintain without strong templates
GitLab CI/CDTeams using GitLab as a single DevOps platformIntegrated source control, CI/CD, and environment controls in one productFeature depth can increase operational complexity
JenkinsOrganizations needing extensive customization and plugin flexibilityMature ecosystem and broad integration optionsHigher maintenance burden for controllers, plugins, and upgrades
TektonKubernetes-native platform engineering workflowsCRD-based pipelines, cloud-native model, good fit for GitOps-heavy setupsSteeper learning curve for teams new to Kubernetes internals

Example baseline configuration for a containerized service

The following examples show a minimal pattern: test first, then build, then deploy to staging. Treat them as a starting point and adapt to your runner, registry, and environment controls.

Sample CI workflow file

name: app-ci-cd

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Bootstrap
        run: ./scripts/bootstrap.sh
      - name: Lint
        run: ./scripts/lint.sh
      - name: Unit tests
        run: ./scripts/test.sh

  build:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build image
        run: docker build -t registry.example.com/demo-app:${{ github.sha }} .
      - name: Push image
        run: docker push registry.example.com/demo-app:${{ github.sha }}

  deploy_staging:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to staging
        run: ./scripts/deploy.sh staging ${{ github.sha }}Code language: HTTP (http)

Sample Kubernetes deployment commands

set -euo pipefail

NAMESPACE=prod
APP=demo-app
IMAGE=registry.example.com/demo-app:${1}

kubectl -n ${NAMESPACE} set image deployment/${APP} app=${IMAGE}
kubectl -n ${NAMESPACE} rollout status deployment/${APP} --timeout=180s
kubectl -n ${NAMESPACE} get pods -l app=${APP}

# Roll back quickly if needed
kubectl -n ${NAMESPACE} rollout undo deployment/${APP}

Release gates that improve safety early

Teams often focus first on build speed, but release reliability usually improves most when quality gates are explicit and automated.

  • Require pull requests and protected branches for production paths.
  • Block artifact publication if unit tests or lint checks fail.
  • Add integration tests in staging before production promotion.
  • Use environment-specific approvals for high-impact services.
  • Capture deployment metadata (commit SHA, image tag, timestamp) for traceability.

Best practices

  • Keep pipelines small and composable; split long jobs into reusable stages.
  • Prefer immutable artifacts and promote the same image across environments.
  • Standardize rollback commands and test rollback procedures regularly.
  • Store secrets in a dedicated secret manager, not directly in pipeline files.
  • Version your pipeline definitions and review them like application code.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Toptal Alternatives: 6 Best Platforms to Hire Remote Tech Talent

Are you looking for remote developers, designers, or project managers, without Toptal’s price tags and wait times? You’re not alone. We’ve been through the search ourselves, and…

Read More

List of Best Compliance Automation Tools

What Are Compliance Automation Tools Used For? Compliance automation tools are software platforms designed to help organizations meet industry, regulatory, and security standards—with less manual effort, fewer…

Read More

Top 10 AI Compliance Audit Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI compliance audit tools are indispensable for organizations navigating the complex regulatory landscape driven by rapid AI adoption. With 78% of companies integrating AI…

Read More

Top 10 HIPAA Compliance Tools in 2026: Features, Pros, Cons & Comparison

Introduction HIPAA (Health Insurance Portability and Accountability Act) compliance is essential for healthcare organizations to ensure the security and privacy of patient data. With cyber threats becoming…

Read More

What is a GitHub App?

🧠 What is a GitHub App? A GitHub App is a first-class actor in the GitHub ecosystem. Unlike OAuth apps which act on behalf of a user,…

Read More

Team Foundation Server 2015 Installation Guide (SQL Express + Update 3)

Install Team Foundation Server 2015 using the original Microsoft download paths, with clear guidance for online, offline, and ISO-based setup. This revised guide also includes an installation workflow, command example, and practical pitfalls to avoid.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x