DevOps & Infrastructure Guide
Master modern DevOps practices, containerization, orchestration, and cloud platforms.
Quick Start
Docker Basics
dockerfile
# Dockerfile example FROM node:18-alpine WORKDIR /app COPY package*.json ./ RUN npm install COPY . . EXPOSE 3000 CMD ["node", "index.js"]
Kubernetes Deployment
yaml
# Simple K8s deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-deployment
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myapp:1.0
ports:
- containerPort: 3000
Terraform Infrastructure
hcl
# AWS EC2 with Terraform
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "web-server"
}
}
DevOps Technology Stack
Containerization
- •Docker: Images, containers, registry
- •Docker Compose: Multi-container orchestration
- •Image Security: Scanning, signing, base image selection
- •Best Practices: Minimal images, layer caching, security
Container Orchestration
- •Kubernetes: Pods, Services, Deployments, StatefulSets
- •Helm: Package management for Kubernetes
- •Service Mesh: Istio, Linkerd for networking
- •Container Security: RBAC, NetworkPolicies, Pod Security
Infrastructure as Code
hcl
# Terraform modules
module "network" {
source = "./modules/network"
vpc_cidr = "10.0.0.0/16"
public_subnets = [
"10.0.1.0/24",
"10.0.2.0/24"
]
}
- •Terraform: HCL, state management, modules
- •Ansible: Agentless configuration management
- •CloudFormation: AWS native IaC
- •Pulumi: Infrastructure as code with programming languages
Cloud Platforms
AWS
- •Compute: EC2, ECS, EKS, Lambda
- •Storage: S3, EBS, EFS
- •Database: RDS, DynamoDB, ElastiCache
- •Networking: VPC, ALB, CloudFront
- •Security: IAM, KMS, Secrets Manager
Other Platforms
- •Google Cloud Platform: Compute Engine, Cloud Run, GKE
- •Azure: VMs, App Service, AKS
- •DigitalOcean: Simpler alternative, good for learning
CI/CD Pipelines
Popular Platforms
- •GitHub Actions: Integrated with GitHub
- •GitLab CI: GitLab native CI/CD
- •Jenkins: Self-hosted, highly customizable
- •CircleCI: Cloud-based, easy setup
yaml
# GitHub Actions example
name: Deploy
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: npm test
- name: Build
run: npm run build
- name: Deploy
run: ./deploy.sh
Monitoring & Logging
Monitoring
- •Prometheus: Metrics collection
- •Grafana: Visualization and dashboards
- •Datadog: Cloud monitoring service
- •New Relic: Application performance monitoring
Logging
- •ELK Stack: Elasticsearch, Logstash, Kibana
- •Splunk: Log aggregation and analysis
- •Cloudwatch: AWS native logging
Alerting
- •PagerDuty: On-call management
- •Alertmanager: Prometheus alerting
- •Opsgenie: Alert and incident response
Linux Administration
System Management
bash
# Common commands systemctl start/stop/restart service-name journalctl -u service-name # View logs ps aux | grep process-name # Process info top/htop # System monitoring
- •User and permission management
- •Package managers (apt, yum, pacman)
- •Systemd services
- •Shell scripting and automation
- •Network configuration
DevOps Workflow
Development → Production
- •Plan: Design infrastructure
- •Code: Write application and IaC
- •Build: Containerize, create artifacts
- •Test: Unit, integration, security tests
- •Deploy: Stage and production deployment
- •Monitor: Metrics, logs, alerts
- •Optimize: Performance tuning
Deployment Strategies
- •Blue-Green: Two identical environments
- •Canary: Gradual rollout to subset
- •Rolling: Gradually replace old version
- •Feature Flags: Toggle features safely
Security Best Practices
Container Security
- •Scan images for vulnerabilities
- •Run as non-root user
- •Use minimal base images
- •Sign images
Infrastructure Security
- •Network policies and firewalls
- •Encryption in transit and at rest
- •Secrets management
- •IAM principle of least privilege
Learning Resources
Hands-On Platforms
- •Katakoda: Interactive learning environments (archived)
- •Play with Docker: Browser-based Docker practice
- •Linux Academy: DevOps courses
- •A Cloud Guru: AWS and cloud courses
Official Documentation
Practice Projects
- •Docker Multi-container App - Docker Compose setup
- •Kubernetes Deployment - Deploy app with services
- •Terraform Infrastructure - Complete AWS setup
- •CI/CD Pipeline - Build and deploy workflow
- •Monitoring Stack - Prometheus + Grafana
Next Steps
- •Learn Docker fundamentals
- •Practice Kubernetes basics
- •Choose cloud platform (AWS recommended)
- •Learn Infrastructure as Code (Terraform)
- •Set up CI/CD pipeline
- •Implement monitoring and logging
- •Master Linux administration
Roadmap.sh Reference: https://roadmap.sh/devops
Status: ✅ Production Ready | SASMP: v1.3.0 | Bonded Agent: 03-devops-cloud-specialist