Deployment Pipeline

Time: 00:00
πŸ“¦
Checkout
-
βš™οΈ
Setup Buildx
-
πŸ”‘
Login GHCR
-
πŸ—οΈ
Build & Push
-
πŸš€
Verify K3s
-

Pipeline Logs

Waiting for pipeline trigger...

github-ci-cd-pipeline.yml

name: CI/CD
on:
  push:
    branches: [ main ]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v3
        
      - name: Login to GHCR
        uses: docker/login-action@v3
        with:
          registry: ghcr.io
          
      - name: Build and push
        uses: docker/build-push-action@v5
        with:
          push: true
          tags: ghcr.io/lakshaywalia666/legacyops-backend:latest
          
      - name: Deploy to K3s
        run: kubectl rollout restart deploy

Container Build

1FROM node:20-alpine
2WORKDIR /app
3COPY package*.json ./
4RUN npm ci --production
5COPY src/ ./src/
6EXPOSE 3000
7USER node
8CMD ["node", "src/server.js"]
Ready to build image...
Final Image Size
127 MB
β–Ό Optimized from 1.2 GB base
Layers
12
4 cached layers used

Deployment Architectures

🐳

Docker Compose

Single-host orchestration
Complexity: ⭐ Local Dev Simple Apps
Command:
docker compose up -d
Pros
  • Easy to write
  • Native to Docker
  • Great for local dev
Cons
  • No HA / self-healing
  • Single node bound
  • Limited scaling
compose.yml
services:
  web:
    image: app:latest
    ports:
      - "80:80"
  db:
    image: postgres:15
☸️

Kubernetes (Raw)

Multi-node orchestration
Complexity: ⭐⭐⭐⭐ Production Enterprise
Command:
kubectl apply -f k8s/
Pros
  • Self-healing
  • Auto-scaling
  • Industry standard
Cons
  • Steep learning curve
  • Verbose YAML
  • Hard to template
deployment.yaml + service.yaml + ingress.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: web
⎈

Helm Charts

Kubernetes package manager
Complexity: ⭐⭐⭐⭐⭐ Templated Distributable
Command:
helm install my-app ./chart
Pros
  • DRY config
  • Versioning/Rollbacks
  • Easy sharing
Cons
  • Go template syntax
  • Hard to debug
  • Overkill for simple
Chart.yaml + values.yaml
replicaCount: 3

image:
  repository: my-app
  tag: "1.0.0"
  pullPolicy: IfNotPresent

service:
  type: ClusterIP

Health Probe Tester

Quick fill:

Status

---

Meta

Time: 0 ms
Content-Type: -

Response Body

// Response will appear here

Recent Requests

Time Method Endpoint Status Duration