MFormations
Modern DevOps Engineering

Chapitre 23

23 - Annexes DevOps

23 - Annexes DevOps

Cours 23 : Annexes DevOps

Partie 1 : Glossaire (200+ termes)

A

  • Affinity : Règle de scheduling K8s (node/pod affinity)
  • Aggregation Layer : Extension API K8s via apiserver
  • Alertmanager : Gestionnaire d'alertes Prometheus
  • AMI : Amazon Machine Image (template EC2)
  • Annotations : Métadonnées K8s non-identifiantes
  • API Server : Point d'entrée du control plane K8s
  • ArgoCD : Outil GitOps pour Kubernetes (CNCF)
  • Artifact : Fichier produit par un build (JAR, image, rapport)
  • Auto-scaling : Ajustement automatique des ressources
  • Availability Zone (AZ) : Zone de disponibilité cloud isolée

B

  • Backend : Stockage d'état Terraform (local, S3, etc.)
  • Backstage : Developer portal Spotify (CNCF)
  • Blue/Green Deployment : Stratégie de déploiement sans downtime
  • Bootstrap : Amorçage initial d'un cluster
  • BPF : Berkeley Packet Filter (Linux kernel)
  • Budget d'erreur : 100% - SLO (marge d'erreur autorisée)
  • BuildKit : Moteur de build Docker nouvelle génération

C

  • Canary Deployment : Déploiement progressif (petit % de trafic)
  • Capacity Planning : Planification des capacités
  • Chaos Engineering : Tests de résilience par injection de pannes
  • Cilium : CNI eBPF-based pour Kubernetes
  • CI/CD : Continuous Integration / Continuous Deployment
  • CKAD : Certifié Kubernetes Application Developer
  • CKA : Certifié Kubernetes Administrator
  • Cloud Native : Architecture conçue pour le cloud
  • Cluster : Ensemble de nœuds Kubernetes
  • Cluster Mesh : Connectivité multi-cluster (Cilium)
  • CNCF : Cloud Native Computing Foundation
  • ConfigMap : Configuration non-confidentielle K8s
  • Container : Unité d'exécution isolée (Docker, containerd)
  • Control Plane : Composants de management K8s (API, scheduler, etcd)
  • Controller Manager : Boucles de contrôle K8s
  • CRD : Custom Resource Definition (extension K8s API)
  • Crossplane : Control plane cloud-native multi-cloud
  • CSI : Container Storage Interface

D

  • DaemonSet : Pod exécuté sur chaque nœud
  • Dashboard : Interface web K8s
  • Data Plane : Plan de données (trafic utilisateur)
  • Deployment : Contrôleur K8s pour applications stateless
  • DevOps : Culture et pratiques fusionnant Dev et Ops
  • DEX : Identity provider OIDC pour K8s
  • Distroless : Image Docker minimale (sans OS complet)
  • DNS : Service de résolution de noms (CoreDNS)
  • Docker : Plateforme de conteneurisation
  • Docker Compose : Outil multi-conteneurs Docker
  • Downward API : Exposition des métadonnées Pod aux conteneurs
  • DR : Disaster Recovery (plan de reprise)

E

  • eBPF : Extended Berkeley Packet Filter (programmation kernel)
  • EC2 : Elastic Compute Cloud (AWS)
  • EKS : Elastic Kubernetes Service (AWS)
  • Endpoint : Point d'entrée réseau
  • Envoy : Proxy sidecar (Istio, Consul)
  • Error Budget : Budget d'erreur SRE
  • etcd : Key-value store distribué K8s
  • Event : Événement Kubernetes (kubectl get events)
  • External Secrets : Sync secrets depuis Vault/AWS/GCP

F

  • Falco : Runtime security (eBPF)
  • Feature Flag : Activation/désactivation conditionnelle
  • FinOps : Optimisation des coûts cloud
  • Flux : GitOps operator (CNCF)
  • For_each : Boucle Terraform sur map/set

G

  • Gatekeeper : Policy controller OPA/K8s (admission webhook)
  • Git : Système de contrôle de version distribué
  • GitHub Actions : CI/CD natif GitHub
  • GitLab CI : CI/CD natif GitLab
  • GitOps : Git comme source de vérité pour déploiements
  • GKE : Google Kubernetes Engine
  • Golden Signals : 4 métriques clés (latence, trafic, erreurs, saturation)
  • Grafana : Plateforme de visualisation de métriques
  • GreenOps : DevOps durable

H

  • HashiCorp : Éditeur de Terraform, Vault, Consul
  • HCL : HashiCorp Configuration Language
  • Helm : Package manager Kubernetes
  • HPA : Horizontal Pod Autoscaler
  • Hybrid Cloud : Cloud + on-premise

I

  • IaC : Infrastructure as Code
  • IAM : Identity and Access Management
  • IDP : Internal Developer Platform
  • Immutable Infrastructure : Infrastructure non modifiée (recréée)
  • Incident Commander : Rôle SRE pour gestion d'incidents
  • Ingress : Routeur HTTP/HTTPS externe K8s
  • Init Container : Conteneur d'initialisation (avant les app containers)
  • IaaS : Infrastructure as a Service
  • Istio : Service mesh open-source
  • IPVS : IP Virtual Server (mode proxy)

J

  • Jaeger : Distributed tracing (CNCF)
  • Jenkins : CI/CD server
  • JSONPath : Langage de requête JSON (kubectl -o jsonpath)
  • JWT : JSON Web Token (authentification)

K

  • K3s : Kubernetes léger (Rancher)
  • K9s : TUI Kubernetes
  • KEDA : Event-driven autoscaler K8s
  • Keycloak : Identity and Access Management
  • kind : Kubernetes in Docker (local)
  • Knative : Serverless sur Kubernetes
  • kubeadm : Tool de bootstrap K8s
  • kubectl : CLI Kubernetes
  • kubelet : Agent K8s sur chaque nœud
  • Kubernetes : Orchestrateur de conteneurs (K8s)
  • Kubescape : Scanner de sécurité K8s
  • Kustomize : Configuration customisation K8s native

L

  • Label : Tag key/value pour organiser les ressources K8s
  • Lens : IDE Kubernetes
  • Liveness Probe : Vérifie si le conteneur est vivant
  • Load Balancer : Équilibreur de charge
  • LogQL : Langage de requête Loki
  • Loki : Agrégateur de logs (Grafana Labs)

M

  • mTLS : Mutual TLS (chiffrement mutuel)
  • Master Node : Nœud control plane (terme legacy → Control Plane)
  • Metrics Server : Métriques CPU/mémoire K8s
  • Microservices : Architecture en services indépendants
  • Mimir : Métriques long terme (Grafana Labs)
  • minikube : K8s local mononœud
  • MirrorPod : Pod miroir pour static pods
  • MTBF : Mean Time Between Failures
  • MTTR : Mean Time To Recover

N

  • Namespace : Isolation logique K8s
  • NAT : Network Address Translation
  • Network Policy : Règles de traffic réseau K8s
  • Node : Machine worker dans un cluster K8s
  • NodePort : Service K8s exposé sur port statique
  • NVMe : Stockage SSD rapide

O

  • Observability : Capacité à comprendre l'état d'un système (logs, metrics, traces)
  • OCID : Open Container Initiative Distribution spec
  • OCI : Open Container Initiative
  • OIDC : OpenID Connect (authentification)
  • OLM : Operator Lifecycle Manager
  • on-call : Service d'astreinte
  • OPA : Open Policy Agent (policy as code)
  • OpenTelemetry : Standard d'observabilité (CNCF)
  • Operator : Extension K8s avec CRD + controller

P

  • PaaS : Platform as a Service
  • PersistentVolume : Stockage persistant K8s
  • Pillar : L'un des 3 piliers observabilité (logs, metrics, traces)
  • Plan : Terraform plan (prévisualisation des changements)
  • Platform Engineering : Conception d'IDP pour développeurs
  • Pod : Plus petite unité déployable K8s
  • PodDisruptionBudget : Garantie de disponibilité minimale
  • Post-mortem : Analyse d'incident (blameless)
  • Probe : Healthcheck K8s (liveness, readiness, startup)
  • Prometheus : Système de monitoring et alerting (CNCF)
  • PromQL : Prometheus Query Language
  • PVC : Persistent Volume Claim
  • Pyroscope : Continuous profiling (Grafana Labs)

Q

  • QoS : Quality of Service (Guaranteed, Burstable, BestEffort)
  • Quay : Registry de conteneurs (Red Hat)

R

  • RBAC : Role-Based Access Control
  • RDS : Relational Database Service (AWS)
  • Readiness Probe : Vérifie si le conteneur est prêt à servir
  • Reconciler : Boucle de réconciliation (controller)
  • ReplicaSet : Maintient un nombre stable de réplicas Pod
  • Rollback : Retour à une version précédente
  • Rolling Update : Mise à jour graduelle
  • Runbook : Document de procédures opérationnelles

S

  • S3 : Simple Storage Service (AWS)
  • Scheduler : Planificateur K8s (assigne Pods aux nœuds)
  • Scrape : Collecte de métriques Prometheus
  • Secret : Stockage de données sensibles K8s
  • SecurityContext : Permissions de sécurité d'un Pod/container
  • Self-healing : Auto-réparation (K8s restaure l'état désiré)
  • Serverless : Exécution sans gestion de serveurs
  • Service : Exposition réseau stable K8s
  • Service Account : Identité non-humaine K8s
  • Service Catalog : Catalogue de services (IDP)
  • Service Mesh : Infrastructure réseau pour microservices
  • Sidecar : Conteneur auxiliaire dans un Pod
  • SLI : Service Level Indicator (métrique mesurée)
  • SLO : Service Level Objective (cible de fiabilité)
  • SLA : Service Level Agreement (contrat)
  • SLSA : Supply-chain Levels for Software Artifacts
  • SPOF : Single Point of Failure
  • StatefulSet : Contrôleur pour apps stateful
  • StorageClass : Classe de stockage K8s (provisioning dynamique)
  • SRE : Site Reliability Engineering

T

  • Taint : Répulsion de Pod sur un nœud
  • TargetGroup : Groupe de cibles pour Load Balancer
  • Tempo : Distributed tracing (Grafana Labs)
  • Terraform : IaC HashiCorp
  • Terragrunt : Wrapper Terraform DRY
  • Tiller : Ancien composant Helm v2 (déprécié)
  • Toleration : Tolérance à un Taint
  • Toil : Tâche manuelle, répétitive, automatisable
  • Traces : Distributed tracing (parcours de requêtes)
  • Trivy : Scanner de vulnérabilités (Aqua Security)

U

  • UDP : User Datagram Protocol
  • USE Method : Utilization, Saturation, Errors (Brendan Gregg)
  • Uptime : Temps de fonctionnement

V

  • Values : Fichier de valeurs Helm
  • Velero : Backup/Restore K8s (VMware)
  • Vertical Pod Autoscaler (VPA) : Ajuste les ressources CPU/mem
  • VirtualService : Ressource Istio pour traffic routing
  • Volume : Stockage dans Docker/K8s
  • VPC : Virtual Private Cloud
  • Vulnerability : Vulnérabilité de sécurité

W

  • WAF : Web Application Firewall
  • WASM : WebAssembly (exécution sandbox)
  • Worker Node : Nœud d'exécution K8s

X

  • XDP : eXpress Data Path (eBPF network fast path)

Y

  • YAML : YAML Ain't Markup Language (format de sérialisation)

Z

  • Zero-downtime : Déploiement sans interruption de service
  • Zone : Availability Zone (cloud)

Partie 2 : Cheat Sheets

kubectl Cheat Sheet

# Context et configuration
kubectl config current-context
kubectl config get-contexts
kubectl config use-context <name>
kubectl config set-context --namespace=<ns>

# Get resources
kubectl get pods -A
kubectl get pods -n <ns> -o wide
kubectl get pods -n <ns> -o yaml
kubectl get pods -n <ns> --show-labels
kubectl get all -n <ns>
kubectl get pods --field-selector status.phase=Running

# Describe
kubectl describe pod <pod>
kubectl describe node <node>
kubectl describe svc <svc>

# Logs
kubectl logs <pod>
kubectl logs -f <pod>
kubectl logs --tail=100 <pod>
kubectl logs -l app=myapp -f
kubectl logs <pod> -c <container>

# Exec
kubectl exec -it <pod> -- sh
kubectl exec <pod> -- cat /etc/config

# Debug
kubectl debug node/<node> -it --image=ubuntu
kubectl run tmp --image=busybox -it --rm --restart=Never -- sh

# Apply/Delete
kubectl apply -f config.yaml
kubectl apply -f config/ -R
kubectl delete -f config.yaml
kubectl delete pod --all

# Port forwarding
kubectl port-forward svc/myapp 8080:80

# Events
kubectl get events --sort-by='.lastTimestamp'

# Resource usage
kubectl top pods
kubectl top nodes

# Aliases utiles
alias k='kubectl'
alias kg='kubectl get'
alias kd='kubectl describe'
alias kdel='kubectl delete'
alias kl='kubectl logs -f'
alias kx='kubectx'
alias kn='kubens'

Docker Cheat Sheet

# Images
docker images
docker pull nginx:alpine
docker build -t myapp:latest .
docker rmi <image>
docker image prune
docker history <image>

# Conteneurs
docker run -d --name web -p 80:80 nginx
docker ps -a
docker stop <container>
docker rm <container>
docker rm $(docker ps -aq)  # supprime tout
docker logs -f <container>
docker exec -it <container> sh
docker cp <container>:/path ./local
docker stats
docker inspect <container>

# Volumes
docker volume create <name>
docker volume ls
docker run -v <name>:/data ...

# Networks
docker network create app-net
docker network ls
docker run --network app-net ...

# Docker Compose
docker-compose up -d
docker-compose down
docker-compose logs -f
docker-compose ps
docker-compose exec <service> sh

# Nettoyage
docker system df
docker system prune -a --volumes

# Image Save/Load
docker save myapp:latest | gzip > myapp.tar.gz
gunzip -c myapp.tar.gz | docker load

Terraform Cheat Sheet

# Workflow de base
terraform init
terraform fmt
terraform validate
terraform plan -out=tfplan
terraform apply tfplan
terraform destroy

# State management
terraform state list
terraform state show <resource>
terraform state rm <resource>
terraform state mv <src> <dst>
terraform import <resource> <id>

# Workspaces
terraform workspace new dev
terraform workspace select dev
terraform workspace list

# Variables
terraform plan -var="region=eu-west-3"
terraform plan -var-file=dev.tfvars
terraform output
terraform console  # REPL

# Debug
TF_LOG=DEBUG terraform apply
TF_LOG=TRACE terraform plan

Git Cheat Sheet

# Configuration
git config --global user.name "Name"
git config --global user.email "email"
git config --global alias.co checkout
git config --global core.editor code --wait

# Branches
git branch <name>
git checkout -b <name>
git switch -c <name>
git branch -d <name>
git merge <branch>
git rebase <branch>

# Commits
git add -p  # interactive staging
git commit -m "feat: message"
git commit --amend  # modifier dernier commit
git log --oneline --graph --all

# Remote
git remote -v
git push -u origin <branch>
git pull --rebase
git fetch --all

# Reset et Revert
git reset --soft HEAD~1  # annule commit, garde les changements
git reset --hard HEAD~1  # annule commit ET changements
git revert HEAD          # nouveau commit inverse

# Stash
git stash
git stash pop
git stash list
git stash apply stash@{0}

# Cherry-pick
git cherry-pick <commit-hash>

# Diff
git diff
git diff --staged
git diff <branch>...HEAD

Bash Cheat Sheet

# Variables
NAME="world"
echo "Hello ${NAME}"
readonly VAR=value
export PATH=$PATH:/custom

# Conditions
if [ -f "$file" ]; then echo "exists"; fi
if [ -z "$var" ]; then echo "empty"; fi
if [ "$a" = "$b" ]; then echo "equal"; fi
if command -v kubectl &> /dev/null; then echo "installed"; fi

# Boucles
for f in *.yaml; do echo "$f"; done
for i in {1..10}; do echo "$i"; done
while IFS= read -r line; do echo "$line"; done < file.txt

# Functions
function hello() {
  local name=$1
  echo "Hello $name"
}

# Arrays
arr=("a" "b" "c")
echo "${arr[0]}"
echo "${arr[@]}"
echo "${#arr[@]}"

# Error handling
set -euo pipefail
trap 'echo "Error on line $LINENO"' ERR

# Substitutions
now=$(date +%Y%m%d)
result=$(curl -s http://api.example.com)
upper=${var^^}
lower=${var,,}

YAML Reference

# Scalaires
string: "value"
number: 42
float: 3.14
boolean: true
null: ~
date: 2024-01-01

# Collections
list:
  - item1
  - item2
map:
  key1: value1
  key2: value2

# Multi-ligne
literal_block: |
  Ligne 1
  Ligne 2
folded_block: >
  Ceci sera
  sur une seule ligne

# Ancres et aliases (DRY)
default: &default
  key: value
item1:
  <<: *default
  other: value

# Types spéciaux
integer: !!int 42
binary: !!binary |
  base64encoded
timestamp: 2024-01-01T12:00:00Z

Partie 3 : Troubleshooting Guides

Kubernetes Troubleshooting

1. Pod stuck en Pending

kubectl describe pod <pod>
# Causes possibles :
# - No nodes available to schedule
# - Insufficient resources (CPU/memory)
# - PersistentVolumeClaim not found
# - Taints/Tolerations mismatch

2. Pod en CrashLoopBackOff

kubectl logs <pod> --previous
kubectl describe pod <pod>
# Causes :
# - Application crash
# - Configuration invalide
# - Liveness probe failure
# - Image pull error

3. Node NotReady

kubectl describe node <node>
kubectl get nodes -o wide
kubectl top node <node>
# Causes :
# - Kubelet stopped
# - Disk pressure
# - Network issue
# - Out of memory/disk

4. Service inaccessible

kubectl describe svc <svc>
kubectl get endpoints <svc>
kubectl exec -it <pod> -- curl http://<service>:<port>
# Vérifier :
# - Selector correspond aux Pods
# - Endpoints existent
# - TargetPort correct

5. Certificat TLS expiré

kubeadm certs check-expiration
kubeadm certs renew all
# Control plane restart nécessaire après

Docker Troubleshooting

1. Build échoue

docker build --no-cache -t myapp .
# Vérifier :
# - Dockerfile syntaxe
# - Contexte de build
# - Réseau (proxy, DNS)
# - Espace disque

2. Conteneur exit immédiatement

docker logs <container>
docker run -it <image> sh  # debug interactif
# Causes :
# - Entrypoint invalide
# - Variable d'env manquante
# - Port déjà utilisé

3. Image pull error

docker pull <image> --platform=linux/amd64
docker login  # si registry privé
# Vérifier :
# - Connexion Internet
# - Registry accessible
# - Tag existe
# - Rate limiting Docker Hub

4. Docker daemon down

sudo systemctl status docker
sudo journalctl -u docker -n 100
docker info
docker system df

Network Troubleshooting

# Tester la connectivité
ping <host>
curl -v http://service:port
netstat -tlnp  # ports en écoute
ss -tlnp
nslookup <hostname>

# Traceroute
traceroute <host>
mtr <host>

# Bandwidth
iperf -c <server>
iperf -s  # serveur

# DNS
dig <domain>
nslookup <domain>
host <domain>

# HTTP
curl -v http://example.com
curl -k https://example.com  # ignore TLS
wget --spider http://example.com

CI/CD Troubleshooting

# GitHub Actions
# - Vérifier les logs du workflow
# - Secrets définis dans Settings → Secrets
# - Runners disponibles
# - Cache corruption : clear cache

# GitLab CI
# - Runners actifs : sudo gitlab-runner status
# - Tags des runners
# - Variables CI définies

# ArgoCD sync failure
argocd app get <app>
argocd app logs <app>
argocd app diff <app>
# Vérifier :
# - Repo access token
# - K8s credentials
# - Sync policy conflicts

Partie 4 : Arbres de Décision

Incident Response Tree

Détection (alerte/humain)
├── SEV1 (production down, clients affectés)
│   ├── ⏱ Objectif : < 15 min mitigation
│   ├── 📞 Incident Commander + équipe
│   ├── 🔄 Rollback ou feature flag
│   └── 📝 Post-mortem obligatoire < 24h
├── SEV2 (dégradation partielle)
│   ├── ⏱ Objectif : < 1h
│   ├── 👥 Équipe on-call
│   ├── 🔧 Fix déployé normalement
│   └── 📝 Post-mortem < 72h
├── SEV3 (mineur)
│   ├── ⏱ Objectif : < 24h
│   ├── 🎫 Ticket Jira
│   └── 🔧 Fix dans le prochain sprint
└── SEV4 (cosmétique/non-urgent)
    ├── 🎫 Ticket backlog
    └── 🔧 Planifié normalement

Pod Health Check

Pod not running?
├── kubectl describe pod <pod>
├── Status: Pending
│   ├── Events: "FailedScheduling"
│   │   ├── Ressources insuffisantes → HPA/Scale up
│   │   ├── Taints → Ajouter toleration
│   │   └── PVC not found → Créer PVC
│   └── Pas d'events → Scheduler check
├── Status: CrashLoopBackOff
│   ├── kubectl logs <pod> --previous
│   ├── Application error → Fix code
│   ├── Config error → Vérifier ConfigMap
│   └── Probe failure → Ajuster health check
├── Status: ImagePullBackOff
│   ├── Image tag incorrect → Corriger tag
│   ├── Registry auth → Vérifier secrets
│   └── Rate limit → Utiliser mirror
├── Status: Running
│   ├── kubectl exec -it <pod> -- curl localhost:port
│   ├── Service → Vérifier endpoints
│   └── Network Policy → Vérifier règles
└── Status: Terminating
    ├── kubectl delete pod --grace-period=0 --force
    └── Vérifier finalizers

Partie 5 : Commandes Essentielles

Linux Performance

# CPU
top -o %CPU
htop
mpstat -P ALL 1
lscpu

# Memory
free -h
vmstat 1
cat /proc/meminfo

# Disk
iostat -xz 1
iotop
df -h
du -sh /* 2>/dev/null

# Network
iftop
nethogs
tcpdump -i eth0 port 80
ss -tuln

# All-in-one
dstat 1
glances
sar -u -r -n DEV 1

Container Runtime Debug

# containerd CLI
ctr images list
ctr containers list
crictl pods
crictl ps -a
crictl logs <container>

# Debug node
kubectl debug node/<node> -it --image=nicolaka/netshoot