Steps To Learn Devops

Steps To Learn Devops

Reading time1 min
#DevOps#Cloud#Automation#CI/CD#Kubernetes#Terraform

Steps to Learn DevOps: A Practical Guide for Engineers

DevOps enables rapid, reliable software delivery by tightly integrating development and operations disciplines. Mastery isn’t about certifications or passing trend-driven interviews; it’s about understanding the end-to-end system, methodically building experience, and knowing where the sharp edges are. Here’s a pragmatic route, grounded in real workflows and toolchains, for engineers aiming to become competent in the field.


1. Internalize DevOps Principles & Culture

DevOps is cultural before it’s technical. In tightly siloed teams, code handoffs breed delays and operational chaos. The transition: collaborative, cross-functional pipelines, shared responsibility, fast feedback.

References:

  • The Phoenix Project (Kim, Behr, Spafford)
  • The DevOps Handbook (Kim et al.)

Focus on CALMS: Culture, Automation, Lean, Measurement, Sharing. Observe how feedback loops, incident postmortems, and blameless retrospectives change team dynamics. Not all companies are there yet — be ready for resistance.


2. Solidify Version Control with Git

Modern DevOps is built on robust source control. Git dominates—master it before leveraging higher tools.

Essential commands:

git clone https://github.com/yourorg/repo.git
git checkout -b feature/your-feature
git add .
git commit -m "Implement partial fix #42"
git push origin feature/your-feature

Branching Tip:
Choose a branching model that matches your release cadence. git flow is rigid; GitHub flow works for fast deployments. Collaborate via pull requests and always review diffs — don’t just approve.

Common issue:
Merge conflicts during sprint-end crunch, especially around package-lock.json or yarn.lock. Know your way around git mergetool.


3. Implement Continuous Integration (CI)

You push, the pipeline builds, tests, reports. If it breaks, you get details instantly. Critical for preventing regressions and shipping at scale.

Minimum viable pipeline:

  • Trigger on main and PRs
  • Run language-specific tests (e.g., pytest, npm test)
  • Lint code and fail builds when standards aren’t met

Example: .github/workflows/ci.yml

name: CI
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '18'
      - run: npm ci
      - run: npm test

Trade-off:
Jenkins offers flexibility; GitHub Actions lower friction for open-source work. Jenkins is indispensable on-premises, but beware plugin maintenance and brittle Groovy scripts.


4. Infrastructure as Code (IaC): Repeatable, Auditable Resources

Infrastructure via API, not console. Terraform, Ansible, and CloudFormation automate cloud provisioning. For cloud-agnostic teams, Terraform (v1.7+) is practical.

First steps:

  • Write a main.tf that deploys an EC2 instance in us-east-1
  • Track state files diligently, avoid local state for team projects
  • Store variables outside your repo: leverage environment variables or Vault for secrets
provider "aws" {
  region = "us-east-1"
}
resource "aws_instance" "web" {
  ami           = "ami-0bb6af715826253bf" # Ubuntu 22.04 LTS
  instance_type = "t3.micro"
  tags = {
    Name = "devops-demo"
  }
}

Known issue:
State file drift and manual console edits break IaC promises. Push for controlled, pipeline-driven changes.


5. Configuration Management: Consistency at Scale

Set up, harden, and patch servers quickly and repeatedly. Ansible playbooks are easier for new adopters; Chef/Puppet fit when bespoke agent-based configs are needed.

Practical start:

  • Write a playbook to install NGINX, copy in custom configs
  • Use ansible.cfg to define inventory — not hardcoded in scripts
- hosts: webservers
  become: yes
  tasks:
    - name: Install NGINX
      apt:
        name: nginx
        state: present
    - name: Deploy config
      copy:
        src: nginx.conf
        dest: /etc/nginx/nginx.conf

Integration:
Tie playbook runs into your CI/CD workflow post-provisioning.


6. CI/CD: Automate Delivery and Deployment

It’s not done until it’s running in the environment. Extend pipelines to do actual deployment (at least to staging).

Strategies:

  • Blue/green deployments: zero-downtime but requires infra overhead
  • Canary deployments for critical services

Sample Jenkins pipeline step:

stage('Deploy') {
    steps {
        sh './scripts/deploy_k8s.sh staging'
    }
}

Edge case:
Database schema migrations in CD must be reversible or practiced against blue/green. Accidental drop in auto-deploys is not hypothetical.


7. Docker: Standardized, Isolated Application Environments

Containerize everything to minimize “runs on my machine” problems.

Dockerfile for a Node.js 18 app:

FROM node:18-alpine
WORKDIR /srv/app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
CMD ["node", "index.js"]

Commands:

docker build -t my-node-app:0.1.0 .
docker run -p 8080:3000 --rm my-node-app:0.1.0

Tip:
Multistage builds (FROM node:18-alpine as build) shrink production images and avoid leaking secrets.


8. Kubernetes: Orchestrate at Scale

Running one container is trivial. Kubernetes manages rolling updates, health checks, and autoscaling for hundreds.

Try locally:

  • Minikube or Kind for local clusters
  • Start with Deployments/Services, then add ConfigMaps and Secrets

Example: Minimal deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: node-demo
spec:
  replicas: 2
  selector:
    matchLabels:
      app: node-demo
  template:
    metadata:
      labels:
        app: node-demo
    spec:
      containers:
      - name: node
        image: my-node-app:0.1.0
        ports:
        - containerPort: 3000

Non-obvious tip:
Set resource requests and limits. Without them, noisy neighbor problems degrade cluster performance.

Known gotcha:
Default kubectl expose creates ClusterIP services, not public LoadBalancers unless your cluster supports them.


9. Observability: Monitoring, Logging, Tracing

Without metrics and logs, flying blind is inevitable.

NeedMature ToolsStarting Point
MetricsPrometheus, GrafanaNode Exporter + simple dashboard
LogsELK, LokiLocal journalctl, then centralize
TracingJaeger, OpenTelemetry CollectorInstrument HTTP handlers

Alerting example (Prometheus):

groups:
  - name: node_exporter
    rules:
      - alert: HighCPU
        expr: 100 - (avg by(instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) > 90
        for: 5m
        labels:
          severity: critical
        annotations:
          summary: "Instance {{ $labels.instance }} CPU > 90%"

Side note:
Configure log rotation early (logrotate) or disks will fill—seen it happen more than once.


10. From Theory to Real Pipelines

Documentation and courses provide foundations, not fluency. Only real-world layering reveals operational dead ends or security oversights.

Project suggestion:
Automate deployment of a containerized app:

  • Git (PR triggers) →
  • CI (build/test) →
  • Terraform (infra up) →
  • Ansible (config) →
  • Docker (containerize) →
  • Kubernetes (deploy) →
  • Prometheus (monitor).

Contribute to open source:
Find infra-as-code repos with active PR reviews. Study past discussions for technical trade-offs and real patch consequences.


Checklist—Avoid the Traps

  • Automate routine steps. Manual steps rot.
  • Build, break, and rebuild. Learn recovery, not just sunny day cases.
  • Keep learning. K8s 1.28 isn’t 1.23. Review changelogs.
  • Deal with the org, not just tools. Politics matter more than bash-fu.
  • Know side-effects. Terraform destroy is dangerous; backups are critical.

DevOps is a continuous exercise in wrestling complexity and reducing toil. Master each layer with intention—skip the shortcuts, but don’t wait for perfection. When it runs in prod at 2AM, you’ll appreciate the extra diligence.


Useful? Pass it on. Everyone’s production headache started somewhere.