DevOps Exam Study Guide
1. Kubernetes
Definition: Kubernetes is a container orchestration platform that automates deployment, scaling, and
operations of containers.
Goal: Run and manage containerized apps in production efficiently.
Key Concepts:
- Pod: Basic unit that runs containers.
- Deployment: Manages pod replicas and updates.
- Service: Exposes pods inside/outside cluster.
Code Example:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deploy
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
DevOps Exam Study Guide
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- port: 80
type: LoadBalancer
2. ArgoCD
Definition: ArgoCD is a GitOps tool for Kubernetes. It syncs application manifests stored in Git with what runs
in your cluster.
Goal: Automate and track deployment from Git.
Code Example:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
spec:
source:
repoURL: https://github.com/user/repo
path: k8s
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: default
DevOps Exam Study Guide
syncPolicy:
automated:
prune: true
selfHeal: true
3. CI/CD
Definition: Continuous Integration and Continuous Deployment/Delivery are DevOps practices to:
- CI: Automatically test and build code when it changes.
- CD: Automatically deploy tested code to production.
Goal: Deliver code safely, quickly, and frequently.
4. GitHub Actions
Definition: GitHub Actions is a CI/CD tool that runs workflows based on events (like a code push).
Goal: Automate tests, builds, and deployments using YAML files.
Code Example:
name: Python CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
DevOps Exam Study Guide
- run: pip install -r requirements.txt
- run: pytest
5. Terraform (EC2 Code)
Definition: Terraform is an Infrastructure as Code (IaC) tool to provision and manage infrastructure.
Goal: Automate cloud resource creation using declarative code.
Code Example:
provider "aws" {
region = "us-east-1"
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "MyEC2"
6. Ansible
Definition: Ansible automates configuration management and application deployment.
Goal: Manage multiple servers from one control machine using YAML playbooks.
Key Concepts:
- No agents needed (uses SSH).
- Modules like apt, yum, copy, service.
Code Example:
DevOps Exam Study Guide
- name: Install Apache
hosts: all
become: yes
tasks:
- name: Install apache2
apt:
name: apache2
state: present
7. GitOps
Definition: GitOps is a way to do DevOps using Git as the single source of truth.
Core Ideas:
- Git = Source of truth for infrastructure and app state.
- Pull-based delivery using tools like ArgoCD.
- Enables auditability, version control, rollback.
Goal: Safe and automated deployments with Git.
8. Observability
Definition: Observability is about understanding the internal state of a system based on output (metrics, logs,
traces).
Goal: Monitor system health and performance.
Pillars of Observability:
1. Metrics - numbers/statistics (e.g. CPU, memory).
2. Logs - timestamped text logs.
3. Traces - follow a request through services.
Common Tools:
DevOps Exam Study Guide
- Metrics: Prometheus
- Dashboards: Grafana
- Logs: ELK, Loki
- Tracing: Jaeger
Prometheus Example:
scrape_configs:
- job_name: 'my-app'
static_configs:
- targets: ['localhost:9090']