DevOps Cheatsheet: Tools, Pipelines, and Key Concepts

This page is a quick reference for DevOps engineers. It covers the tools, pipeline stages, deployment patterns, and observability concepts you will encounter most often in a cloud-based DevOps role.


Core DevOps Tool Categories#

CategoryCommon Tools
Source controlGit, GitHub, GitLab, Bitbucket
CI/CDGitHub Actions, GitLab CI, Jenkins, CircleCI, Azure Pipelines
ContainersDocker, Kubernetes, Helm
Infrastructure as CodeTerraform, Pulumi, Ansible, CloudFormation
Monitoring & observabilityPrometheus, Grafana, Datadog, CloudWatch, New Relic
Secrets managementHashiCorp Vault, AWS Secrets Manager, GCP Secret Manager, Azure Key Vault
Artifact registryDocker Hub, AWS ECR, GCP Artifact Registry, Azure ACR

CI/CD Pipeline Stages#

A typical CI/CD pipeline moves code from a developer’s commit to a running production deployment through a defined set of stages.

StageWhat happens
SourceA commit or pull request triggers the pipeline
BuildSource code is compiled or packaged into an artifact
TestUnit tests, integration tests, linting, and static analysis run
PackageThe artifact is containerised or packaged and pushed to a registry
DeployThe artifact is deployed to a target environment (staging or production)
MonitorMetrics, logs, and alerts confirm the deployment is healthy

Each stage acts as a gate. If a stage fails, the pipeline stops and the change does not proceed.


GitHub Actions Quick Reference#

A GitHub Actions workflow is a YAML file in .github/workflows/.

name: CI Pipeline

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Set up Node
        uses: actions/setup-node@v4
        with:
          node-version: '20'
      - name: Install dependencies
        run: npm ci
      - name: Run tests
        run: npm test
        env:
          NODE_ENV: test

  deploy:
    needs: build-and-test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/main'
    steps:
      - name: Deploy
        run: ./deploy.sh

Key keywords

KeywordPurpose
onTrigger events (push, pull_request, schedule, workflow_dispatch)
jobsTop-level units of work, run in parallel by default
stepsSequential tasks within a job
usesReference a pre-built action
runExecute a shell command
envSet environment variables for a step or job
needsDeclare a dependency on another job (forces sequential order)

Pipeline Patterns#

Feature branch CI — Each feature branch gets its own pipeline run. Branches are tested in isolation before merging to the main branch. Prevents broken code from reaching production.

Trunk-based delivery — All developers push small, frequent commits directly to a single main branch. Feature flags hide incomplete work. This reduces merge conflicts and keeps the pipeline fast.

GitOps — The desired state of infrastructure and deployments is declared in a Git repository. A controller (such as Argo CD or Flux) continuously reconciles the running state to match what is in Git. The Git commit history becomes your audit log.


Shift Left#

“Shift left” means moving testing, security checks, and compliance validation earlier in the development process — toward the developer’s local machine and the pull request stage, rather than waiting for a dedicated QA or security phase at the end.

In practice this means:


Infrastructure as Code Concepts#

Declarative vs imperative

Why state matters — Terraform keeps a state file that records the current known state of your infrastructure. Without it, Terraform cannot calculate what changes are needed. Keep state files in remote backends (S3, GCS, Azure Blob) and never edit them by hand.

Drift detection — When someone makes a manual change to infrastructure outside of Terraform (e.g., in the console), the live state diverges from the declared state. Running terraform plan detects drift. GitOps tools like Argo CD continuously detect and can auto-remediate drift.


The Three Pillars of Observability#

PillarWhat it capturesExamples
MetricsNumeric measurements over timeCPU %, request rate, error count, latency
LogsTimestamped records of eventsApplication log lines, audit logs, error traces
TracesEnd-to-end journey of a single request through servicesDistributed tracing spans across microservices

RED method (for services)

USE method (for infrastructure resources)


Deployment Strategies#

StrategyDescription
Rolling updateReplace instances gradually, a few at a time; lowest resource overhead
Blue/greenRun two full environments; switch traffic instantly; easy rollback
CanaryRoute a small percentage of traffic to the new version; expand if metrics look good
Feature flagsDeploy code to all users but activate the feature only for a controlled group

On-Call Basics#

Alert fatigue — When too many alerts fire, engineers start ignoring them. Every alert should be actionable and map to a runbook. Alerts that are always ignored should be removed or demoted to warnings.

What makes a good runbook

  1. What alert triggered this runbook
  2. What the service does (brief context)
  3. Steps to diagnose the problem
  4. Steps to mitigate or resolve it
  5. Escalation path if the above steps do not work
  6. Links to dashboards, logs, and related runbooks

Post-mortems — A structured review after an incident. The goal is to understand what happened and prevent recurrence, not to assign blame. A blameless post-mortem assumes people acted with good intentions and asks “what did the system allow?” rather than “who made the mistake?”.


Common DevOps Interview Questions#

QuestionShort answer
What is the difference between CI and CD?CI = automatically build and test on every commit. CD = automatically deploy that tested build to an environment.
What is infrastructure as code?Managing infrastructure through version-controlled configuration files rather than manual console actions.
How do you store secrets in a pipeline?Use a secrets manager (Vault, AWS Secrets Manager) or the CI platform’s encrypted secrets store. Never put secrets in code or environment files committed to Git.
What is the difference between blue/green and canary?Blue/green switches all traffic at once; canary routes a small percentage first and promotes gradually.
What is drift in Terraform?When live infrastructure differs from what is declared in code, usually due to manual changes.
What are the three pillars of observability?Metrics, logs, and traces.
What does “shift left” mean?Moving testing and security checks earlier in the development process to catch issues sooner.