LPI DevOps Tools Engineer cheat sheet
LPI DevOps Tools Engineer · Keep the key ideas within reach.
Software Engineering
Git three-stage model: working tree → index (staging area) → repository;
git addupdates the index,git commitrecords the index as a tree object.A merge commit has two parents; fast-forward merges move the branch pointer without creating a commit;
git merge --no-ffforces a merge commit.git rebasereplays commits onto a new base, producing new commit hashes; never rebase commits already pushed to a shared branch.CI pipeline stages run in order: build → unit test → package artifact → integration test → deploy; each stage gates the next on exit code 0.
Semantic versioning: MAJOR.MINOR.PATCH; MAJOR increments on incompatible API changes, MINOR on backward-compatible features, PATCH on backward-compatible fixes.
Infrastructure as Code declarative tools (Terraform) compute a diff between desired and actual state; imperative scripts execute steps without state tracking.
git bisectperforms binary search over commit history to locate the first bad commit; mark commitsgoodorbadto narrow the range.Twelve-Factor App: config in environment variables, stateless processes, logs as event streams to stdout, and strict build/release/run separation.
Application Container
A container shares the host kernel and isolates via Linux namespaces (PID, NET, MNT, UTS, IPC, USER) and cgroups (CPU, memory, I/O limits).
Dockerfile instruction order determines cache reuse: once a layer's instruction or its parent layer changes, that layer and all subsequent layers rebuild.
COPYcopies from build context;ADDadditionally handles URLs and local tar extraction - preferCOPYfor predictability.Multi-stage builds use multiple
FROMlines; only artifacts copied into the final stage ship in the image, reducing size and attack surface.Container image references:
registry/repository:tag; a missing tag defaults tolatest, which is mutable and unsuitable for reproducible deploys.docker run -d -p hostPort:containerPort imagepublishes a port;-v hostPath:containerPathbind-mounts;--rmdeletes the container on exit.The container's main process is PID 1; it must reap orphaned children or handle SIGTERM for graceful shutdown - use an init process such as tini when needed.
docker buildsends the build context (directory) to the daemon; a.dockerignorefile excludes paths from that context and fromCOPY.
Kubernetes
Control plane components: kube-apiserver (all requests), etcd (cluster state store), kube-scheduler (pod-to-node assignment), kube-controller-manager (reconciliation loops).
Node components: kubelet manages pod lifecycle on the node; kube-proxy programs Service routing rules; the container runtime runs containers.
Pod is the smallest deployable unit; containers in one Pod share network namespace (same IP, localhost) and can share volumes.
Service types: ClusterIP (internal virtual IP), NodePort (static port on every node), LoadBalancer (external LB), ExternalName (DNS CNAME).
Deployment manages ReplicaSets for stateless workloads; StatefulSet provides stable pod names and per-pod PersistentVolumeClaims; DaemonSet runs one pod per node.
A Pod is scheduled only when requests fit node allocatable resources; limits cap usage, and exceeding a memory limit triggers OOMKill of the container.
Readiness probes gate Service endpoints; liveness probes restart containers; startup probes delay liveness checks for slow-starting apps.
ConfigMap and Secret inject configuration via env vars or volume mounts; Secrets are base64-encoded, not encrypted, unless encryption at rest is configured.
Security and Observability
The three pillars of observability are metrics (numeric aggregates over time), logs (discrete timestamped events), and traces (request path across services).
Prometheus pulls metrics from HTTP
/metricsendpoints; PromQL rates userate(counter[5m]), and histograms expose_bucket,_sum, and_countseries.The four golden signals: latency, traffic, errors, saturation - the minimum metric set for monitoring a service.
Kubernetes RBAC: Role/RoleBinding are namespaced; ClusterRole/ClusterBinding are cluster-wide; permissions are additive and default-deny.
Pod Security Standards define privileged, baseline, and restricted profiles;
runAsNonRoot, dropped capabilities, and read-only root filesystems harden containers.Secrets management: avoid baking credentials into images; inject at runtime from a vault or Kubernetes Secret and rotate regularly.
Distributed tracing propagates context via headers (e.g., W3C
traceparent); a trace is a tree of spans identified by trace ID and span ID.Least privilege for service accounts: disable automounting of the default token (
automountServiceAccountToken: false) when the pod does not call the API.