DevOps Study Guide
DevOps Study Guide
1. Kubernetes
Definition: Kubernetes is a container orchestration platform that automates deployment, scaling, and
operations of containers.
Key Concepts:
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.
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:
4. GitHub Actions
Definition: GitHub Actions is a CI/CD tool that runs workflows based on events (like a code push).
Code Example:
name: Python CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
uses: actions/setup-python@v2
with:
python-version: '3.10'
DevOps Exam Study Guide
- run: pytest
Definition: Terraform is an Infrastructure as Code (IaC) tool to provision and manage infrastructure.
Code Example:
provider "aws" {
region = "us-east-1"
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t2.micro"
tags = {
Name = "MyEC2"
6. Ansible
Goal: Manage multiple servers from one control machine using YAML playbooks.
Key Concepts:
Code Example:
DevOps Exam Study Guide
hosts: all
become: yes
tasks:
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:
8. Observability
Definition: Observability is about understanding the internal state of a system based on output (metrics, logs,
traces).
Pillars of Observability:
Common Tools:
DevOps Exam Study Guide
- Metrics: Prometheus
- Dashboards: Grafana
- Tracing: Jaeger
Prometheus Example:
scrape_configs:
- job_name: 'my-app'
static_configs:
- targets: ['localhost:9090']