DevOps Best Practices: From Deployment to Production Excellence
A comprehensive guide to DevOps best practices learned from deploying applications across large-scale enterprises, covering CI/CD, Docker, Kubernetes, and more.

A comprehensive guide to DevOps best practices learned from deploying applications across large-scale enterprises, covering CI/CD, Docker, Kubernetes, and more.

Over 15+ years in software engineering, one truth stands out: great code means nothing without reliable deployment. This guide shares battle-tested DevOps practices drawn from large-scale enterprise environments.
DevOps isn't just tools — it's a culture:
"DevOps is the union of people, process, and products to enable continuous delivery of value to end users." - Donovan Brown, Microsoft
# .github/workflows/deploy.yml
name: Deploy to Production
on:
push:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: |
yarn install
yarn test
yarn lint
yarn build
deploy:
needs: test
runs-on: ubuntu-latest
steps:
- name: Deploy to Kubernetes
run: kubectl apply -f k8s/
# Build stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN yarn install --frozen-lockfile
COPY . .
RUN yarn build
# Production stage
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["node", "dist/server.js"]
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-service
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
template:
spec:
containers:
- name: app
image: app-service:latest
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
# main.tf
resource "kubernetes_deployment" "app" {
metadata {
name = "app-service"
}
spec {
replicas = var.replica_count
template {
spec {
container {
name = "app"
image = var.app_image
resources {
limits = {
cpu = "500m"
memory = "512Mi"
}
}
}
}
}
}
}
// Prometheus metrics
const httpRequestDuration = new Histogram({
name: 'http_request_duration_seconds',
help: 'Duration of HTTP requests in seconds',
labelNames: ['method', 'route', 'status_code']
})
app.use((req, res, next) => {
const start = Date.now()
res.on('finish', () => {
const duration = (Date.now() - start) / 1000
httpRequestDuration
.labels(req.method, req.route.path, res.statusCode)
.observe(duration)
})
next()
})
apiVersion: v1
kind: Secret
metadata:
name: app-secrets
type: Opaque
data:
DATABASE_URL: <base64-encoded>
API_KEY: <base64-encoded>
Implementing these practices at scale yielded:
DevOps excellence requires:
Questions about DevOps or deployment challenges? Get in touch or connect on LinkedIn.

A deep dive into architecting and scaling React applications to serve 5000+ retail stores, handling millions of daily transactions while maintaining 99.9% uptime.

Insights and practical strategies for mentoring software engineers, from junior developers to senior team members, based on real experiences across multiple companies.