Build an AI system
Give a model context, tools, and a way to be evaluated.
TOPICS / FOLLOW YOUR CURIOSITY
Look inside the systems you use. Start with a question, follow a mechanism, and connect it to the next idea.
KNOWLEDGE MAPS / SEE HOW IT CONNECTS
Each subject is drawn as the shape that explains it best. Tap any part to open a full explanation, then keep going with Next.
Every leaf is one idea. The roots are what a language model is; each branch above builds on the ones below it, up to the crown, where models run in production.
Start at the roots (stage 1) and climb. Tap any leaf to open it, then use Next to walk the whole tree in order.
53 leaves to explore
1Roots: what a language model is
The few ideas everything else grows from.
2Trunk: how it understands
How text becomes numbers a model can reason over.
3How models are made
From raw text to a helpful assistant.
4Talking to a model
Prompts, sampling and getting answers you can use.
5Giving it knowledge
Search, retrieval and grounding answers in your data.
6Letting it act
Tools, loops and memory: where agents begin.
7Crown: running it in production
Hardware, serving, cost, safety and measurement.
Stage 1 starts at the roots, here at the bottom. Climb up from there.
AI & LLMs · Roots: what a language model is · Leaf 1 of 53
large language models that generate text by predicting the next token
A Large Language Model is a neural network trained on vast text corpora. Given a prompt, it generates tokens (words or subwords) one at a time by predicting the most likely next token based on the preceding context. The 'magic' is pattern completion at massive scale — trillions of parameters in the largest models.
curl -X POST -H "Content-Type: application/json" -d '{"model":"gpt-4","messages":[{"role":"user","content":"Hello"}]}' https://api.openai.com/v1/chat/completionscall an LLM API directlyollama run llama3run an LLM locally with OllamaAI & LLMs · Roots: what a language model is · Leaf 2 of 53
how autoregressive models generate text word by word
LLMs do not generate full answers at once. Given prior context, the model computes a probability distribution over the vocabulary for the single next token, samples one, appends it to context, and repeats.
curl -N http://localhost:11434/api/generatestream tokens in real-timeAI & LLMs · Roots: what a language model is · Leaf 3 of 53
how LLMs break text into pieces their neural networks can process
Tokenization is the first step of any LLM pipeline. Text is split into tokens — subwords, not whole words. 'unbelievable' becomes ['un', 'believe', 'able']. Each token maps to an integer ID in the model's vocabulary (typically 32K-200K tokens). Tokenization determines how the model 'sees' your text and directly affects cost, latency, and even comprehension.
['I', "'", 'm', ' run', 'ning', ' Ku', 'ber', 'net', 'es', ' on', ' AWS'].[40, 466, 12, 1285, 596, 17283, 29768, 4793, 659, 1649, 21371].python -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print(len(enc.encode('Hello world')))"count tokens in a string with tiktokennode -e "const {getEncoding} = require('js-tiktoken'); const enc = getEncoding('cl100k_base'); console.log(enc.encode('Hello world').length)"count tokens with js-tiktokenAI & LLMs · Roots: what a language model is · Leaf 4 of 53
what the model can 'see'
Tokens are text snippets (words or subwords). The context window is the maximum number of prompt and generation tokens a model can process in a single request.
python -c "import tiktoken; enc = tiktoken.get_encoding('cl100k_base'); print(len(enc.encode('hello context')))"count tokens in prompt stringAI & LLMs · Roots: what a language model is · Leaf 5 of 53
the working memory limit of a single model request
The total number of tokens (system prompt + history + docs + response) the model can hold in memory during one call. Anything outside this window does not exist to the model.
python -c import tiktoken; enc = tiktoken.get_encoding("cl100k_base"); print(len(enc.encode("test prompt")))count tokens in promptAI & LLMs · Roots: what a language model is · Leaf 6 of 53
learnable weights in the model
The internal variables (weights and biases) of a neural network that are adjusted during training to capture language patterns and mathematical relationships.
ollama show llama3 --parametersview parameter counts and sizesAI & LLMs · Trunk: how it understands · Leaf 7 of 53
converting text into numerical vectors for semantic search
An embedding model converts text — a word, sentence, or document — into a fixed-length array of floating-point numbers (e.g., 1536 dimensions for text-embedding-3-small). The key property: semantically similar texts produce vectors that are close together in vector space (high cosine similarity). This is the foundation of RAG, semantic search, and clustering.
curl -X POST -d '{"input":"What is Kubernetes?","model":"text-embedding-3-small"}' https://api.openai.com/v1/embeddingsgenerate an embeddingpython -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2'); emb = model.encode('Hello world')"generate embeddings locallyAI & LLMs · Trunk: how it understands · Leaf 8 of 53
high-dimensional space of meanings
A mathematical space where text and images are mapped as multi-dimensional coordinate vectors. Proximity in latent space represents semantic similarity.
python -c "import numpy as np; ..."calculate vector cosine similarity distancesAI & LLMs · Trunk: how it understands · Leaf 9 of 53
how models calculate context-sensitive word relationships
Self-attention computes Query-Key-Value (Q, K, V) dot products allowing tokens to weigh and dynamically route context from other tokens across the sequence.
python -c import torch; q=torch.randn(1,8,64); k=torch.randn(1,8,64); print((q @ k.transpose(-2,-1)).shape)compute QK^T score matrixAI & LLMs · Trunk: how it understands · Leaf 10 of 53
the foundational neural network architecture of modern LLMs
Stacked blocks combining Multi-Head Attention, Feed-Forward layers, Residual Connections, and LayerNorm that process sequence tokens in parallel during training and prompt processing.
python -c from transformers import AutoModel; model = AutoModel.from_pretrained("gpt2"); print(model)inspect transformer layersAI & LLMs · Trunk: how it understands · Leaf 11 of 53
AI models that understand text, images, audio, and video together
Multimodal models (GPT-4V, Claude 3, Gemini) can process and reason across multiple data types simultaneously. You can show them a screenshot and ask 'What's the error here?', give them a diagram and ask them to generate Terraform code, or show a video and ask for a summary. The model encodes all modalities into a shared representation space.
curl -X POST -d '{"model":"gpt-4-vision-preview","messages":[{"role":"user","content":[{"type":"text","text":"What's in this image?"},{"type":"image_url","image_url":{"url":"https://example.com/screenshot.png"}}]}]}' https://api.openai.com/v1/chat/completionssend an image to GPT-4 Visionollama run llava 'Describe this image' --image photo.jpgrun multimodal model locally with OllamaAI & LLMs · How models are made · Leaf 12 of 53
training on massive unlabeled data
The first phase of LLM training where a model learns language structures, grammar, and facts by predicting hidden tokens across web-scale text collections.
python -c "from transformers import AutoModel; ..."load a raw pre-trained checkpointAI & LLMs · How models are made · Leaf 13 of 53
the foundational pre-trained model
A raw, pre-trained model that has general language knowledge but has not yet been fine-tuned to follow instructions or act as a conversational assistant.
ollama show llama3:textinspect base text model detailsAI & LLMs · How models are made · Leaf 14 of 53
using vs building a model
Training is the process of adjusting weights over vast corpora (requires massive clusters). Inference is using that trained model to generate predictions (requires low latency).
ollama run llama3execute model inference locally on your CPU/GPUAI & LLMs · How models are made · Leaf 15 of 53
fine-tuning to follow instructions
Fine-tuning a base model on conversational data (User prompt + target Assistant response pairs) to teach it how to follow instructions and answer questions directly.
python -c "from transformers import AutoTokenizer; ..."load instruction token templatesAI & LLMs · How models are made · Leaf 16 of 53
ensuring helpful, honest, and harmless outputs
The engineering discipline of configuring models so that their generations match human values, avoiding toxicity, bias, and generation of dangerous instructions.
promptfoo redteamrun security checks against local endpointsAI & LLMs · How models are made · Leaf 17 of 53
Reinforcement Learning from Human Feedback
Aligning LLMs by collecting human preferences (rating model outputs A vs B), training a reward model to score outputs, and optimizing the LLM using reinforcement learning.
python -c "from trl import PPOTrainer; ..."load RLHF reinforcement optimization librariesAI & LLMs · How models are made · Leaf 18 of 53
specializing a base model on your domain data
Fine-tuning takes a pre-trained LLM and trains it further on a smaller, domain-specific dataset. Unlike RAG (which retrieves context at inference), fine-tuning embeds knowledge into the model's weights — it learns the style, terminology, and patterns of your data. The result: better performance on your specific tasks without needing to prompt with context every time.
{"messages": [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}.ollama create my-model -f Modelfilecreate a custom model from a base + templatepython -c "from transformers import Trainer; ..."HuggingFace transforminer training scriptAI & LLMs · How models are made · Leaf 19 of 53
fine-tuning models on consumer hardware
Low-Rank Adaptation. Freezes the base model weights and injects small, trainable adapters (rank decomposition matrices) into attention layers, reducing training memory by 90%+.
peft-convert --base llama-3 --adapter ./loramerge adapter weightsAI & LLMs · How models are made · Leaf 20 of 53
compressing knowledge from a large teacher model into a smaller student model
A model compression technique where a smaller student model is trained on outputs, reasoning traces, or probability logits of a massive teacher model to match performance at lower latency.
python -c print("KL-divergence loss matches student logits to teacher logits")distillation loss logicAI & LLMs · Talking to a model · Leaf 21 of 53
setting the model's behavior and constraints
The foundational instruction injected at the start of a conversation that defines the model's persona, tone, safety limits, and execution rules.
curl -X POST -d '{"model":"llama3","system":"You are a code compiler","prompt":"2+2"}' http://localhost:11434/api/generateset system prompt locally in OllamaAI & LLMs · Talking to a model · Leaf 22 of 53
the question or task from the end user
The specific query, command, or context block typed by the user. Prompt engineering optimizes this input text to extract accurate, structured answers from the model.
promptfoo viewopen local prompt engineering testing dashboardAI & LLMs · Talking to a model · Leaf 23 of 53
crafting inputs to get reliable, structured outputs from LLMs
The way you phrase a prompt dramatically affects the quality and format of an LLM response. Good prompt engineering uses clear instructions, few-shot examples (showing the model what you want), role-setting ('You are a senior DevOps engineer'), and output formatting (JSON, markdown). Systematic approaches like chain-of-thought improve reasoning tasks.
ollama run llama3 'Write a prompt that...'test prompts via Ollama locallycurl -X POST -d '{"model":"gpt-4","messages":[{"role":"system","content":"You are a terse Linux expert"}]}' https://api.openai.com/v1/chat/completionscall OpenAI with a system messageAI & LLMs · Talking to a model · Leaf 24 of 53
asking to perform tasks without examples
Prompting a model to complete a task directly without giving any reference examples (relying purely on the model's pre-trained patterns).
ollama run llama3 \"Translate: hello to Spanish\"run zero-shot query in shellAI & LLMs · Talking to a model · Leaf 25 of 53
providing examples to guide the model
Injecting a few examples (inputs and expected outputs) inside the prompt template to show the model the target format and style before asking the actual question.
promptfoo eval --config my-few-shot.yamltest few-shot template accuracyAI & LLMs · Talking to a model · Leaf 26 of 53
thinking step-by-step before answering
Instructing the model to write down its reasoning process step-by-step before outputting the final answer, which improves accuracy on logical, math, and coding tasks.
ollama run llama3 \"Solve 123 * 45. Let's think step-by-step.\"run chain-of-thought queryAI & LLMs · Talking to a model · Leaf 27 of 53
why answers vary
Temperature scales the token probability distribution. High temperature flattens probabilities (more creative/random); low temperature peaks probabilities (more deterministic).
curl -X POST -d '{\"model\":\"llama3\",\"prompt\":\"hi\",\"options\":{\"temperature\":0.0}}' http://localhost:11434/api/generatequery local model with explicit temperature settingsAI & LLMs · Talking to a model · Leaf 28 of 53
limiting choices to the top k tokens
A sampling filter that limits next-token choices to the top 'k' most likely tokens (e.g. k=40), dropping lower-probability choices to prevent the model from generating nonsense.
curl -X POST -d '{"model":"llama3","prompt":"hi","options":{"top_k":20}}' http://localhost:11434/api/generatequery local model with top-k limitsAI & LLMs · Talking to a model · Leaf 29 of 53
choosing from cumulative probability p
Nucleus sampling. Dynamically selects from the smallest pool of tokens whose combined probability exceeds threshold 'p' (e.g. p=0.9), keeping options flexible based on confidence.
curl -X POST -d '{"model":"llama3","prompt":"hi","options":{"top_p":0.9}}' http://localhost:11434/api/generatequery local model with top-p limitsAI & LLMs · Talking to a model · Leaf 30 of 53
enforcement of JSON schemas on LLM response payloads
Forcing the model to output strict schemas. Instead of hoping the LLM returns valid JSON (and writing complex parsers to catch errors), the API provider restricts the model's choices to ensure the response strictly matches your database fields.
python -c "from pydantic import BaseModel; ..."define schema with Pydantic for OpenAI Structured OutputsAI & LLMs · Talking to a model · Leaf 31 of 53
compiling declarative prompt pipelines
A framework by Stanford that replaces fragile manual prompt engineering by treating prompts as code programs, dynamically optimizing instructions and examples based on evaluations.
python -c import dspy; lm = dspy.LM('openai/gpt-4o'); dspy.settings.configure(lm=lm)bootstrap DSPy contextAI & LLMs · Giving it knowledge · Leaf 32 of 53
finding documents by conceptual meaning rather than exact keywords
Uses vector embeddings to map queries and documents into a shared high-dimensional latent space, measuring relevance via Cosine Similarity rather than string matching.
python -c import numpy as np; a=np.array([1,0]); b=np.array([0.9,0.1]); print(np.dot(a,b)/(np.linalg.norm(a)*np.linalg.norm(b)))calculate cosine similarityAI & LLMs · Giving it knowledge · Leaf 33 of 53
storing and searching by semantic similarity, not exact keywords
A vector database (Pinecone, Weaviate, Qdrant, pgvector) stores high-dimensional embeddings alongside metadata. Instead of WHERE title LIKE '%rag%', you search by cosine distance: ORDER BY embedding <=> query_embedding LIMIT 5. This finds documents that are semantically similar, even if they share no exact keywords.
text-embedding-3-small).curl -X POST -d '{"vector":[0.1,0.2,...],"topK":5}' http://localhost:6333/collections/my-collection/points/searchsearch via Qdrant APIAI & LLMs · Giving it knowledge · Leaf 34 of 53
fetching external, real-time knowledge at query time
The process of pulling relevant domain documents or DB records dynamically into the prompt window before model execution, overcoming training cutoff and memory limits.
curl -X POST http://localhost:8000/retrievequery retrieval serviceAI & LLMs · Giving it knowledge · Leaf 35 of 53
grounding LLM answers in your own data
Retrieval-Augmented Generation (RAG) adds a retrieval step before the LLM generates an answer. You embed a user's question into a vector, search a database of document chunks for the most relevant content, inject those chunks into the prompt as context, and then the LLM answers based on that retrieved information — not just its training data.
curl -X POST -d '{"input":"What is RAG?"}' https://api.openai.com/v1/embeddingsgenerate an embedding for a querypgvector 'SELECT * FROM docs ORDER BY embedding <=> $1 LIMIT 5'query for nearest vectors in pgvectorAI & LLMs · Giving it knowledge · Leaf 36 of 53
anchoring answers in verified facts
Ensuring model responses are based on verifiable, reference facts or documents (like your own documentation in RAG) rather than its internal parametric training data.
promptfoo eval -c RAG-grounding.yamltest grounding accuracyAI & LLMs · Giving it knowledge · Leaf 37 of 53
curating and structuring optimal prompt payloads for LLM stability
The systematic discipline of managing prompt structure, dynamic chunk placement, history summarization, and token budget allocation to maximize model reasoning performance.
python -c print("Context engineering balances token budget and attention placement")context architecture noteAI & LLMs · Letting it act · Leaf 38 of 53
LLMs that take actions — not just talk
An agent is an LLM looped into a cycle: it receives a task, calls tools (APIs, databases, shell commands) based on its reasoning, gets the results, and decides the next action. The model orchestrates the process, but the tools execute the actions. This turns an LLM from a chatbot into an autonomous operator.
call_tool: query_prometheus, args: { query: 'http_request_duration_seconds_p99' }.python -c "from openai import OpenAI; client = OpenAI(); response = client.chat.completions.create(model='gpt-4', tools=[...])"SDK call with tool definitionsAI & LLMs · Letting it act · Leaf 39 of 53
how models talk to your systems
Function calling lets models output structured JSON actions representing function arguments. Model Context Protocol (MCP) standardizes how models connect to local file systems.
npx -y @modelcontextprotocol/server-sqlitelaunch an MCP database server nodeAI & LLMs · Letting it act · Leaf 40 of 53
the perceive → reason → act cycle that drives autonomous agents
The execution loop (also called the agent loop or cognitive loop) is the core cycle of any AI agent: Perceive (gather observations from tools or the environment), Reason (the LLM decides what to do next based on observations and goals), Act (execute the chosen action — call a tool, return a response, or ask for clarification). This loop repeats until the task is complete or a termination condition is met.
python -c "while not done and steps < MAX_STEPS: observation = tool.run(action); action = llm.decide(observation); steps += 1"pseudocode for a basic execution loopAI & LLMs · Letting it act · Leaf 41 of 53
giving agents short-term and long-term recall beyond the context window
LLMs have no inherent memory — each request starts from scratch. Memory systems solve this by maintaining state across interactions. Short-term memory (conversation buffer, sliding window) keeps recent turns in the context. Long-term memory (vector stores, key-value databases) persists facts, preferences, and past interactions that can be retrieved when relevant. Together they let an agent remember who you are, what you discussed last week, and what your preferences are.
python -c "from langchain.memory import ConversationBufferMemory; memory = ConversationBufferMemory(); memory.save_context({'input': 'hi'}, {'output': 'hello'})"add conversation memory with LangChainpython -c "from mem0 import Memory; m = Memory(); m.add('User prefers dark mode', user_id='supraj')"persist long-term memory with Mem0AI & LLMs · Letting it act · Leaf 42 of 53
the orchestration framework that turns an LLM into a reliable agent
An agent harness is the scaffolding code around an LLM that manages the planning-execution loop, tool dispatch, error recovery, and state persistence. Frameworks like LangGraph, CrewAI, and AutoGen provide this harness out of the box — they handle retries, conversation memory, multi-agent coordination, and human-in-the-loop checkpoints so you don't reinvent it.
python -c "from langgraph.graph import StateGraph; graph = StateGraph(...); graph.add_node('agent', agent_fn); app = graph.compile()"build a LangGraph agent with state managementpython -c "from crewai import Agent, Task, Crew; crew = Crew(agents=[...], tasks=[...]); crew.kickoff()"run a multi-agent crew with CrewAIAI & LLMs · Letting it act · Leaf 43 of 53
connecting AI agents to real-world APIs and SaaS platforms
External integrations are the bridges between your AI system and the outside world — Slack for notifications, Jira for ticket creation, GitHub for code changes, Stripe for billing, or any REST/GraphQL API. The agent doesn't just generate text; it calls real services to take action. Each integration needs authentication (OAuth, API keys), error handling, and rate limit awareness.
curl -X POST -H 'Authorization: Bearer $SLACK_TOKEN' -d '{"channel":"C01234","text":"Agent alert"}' https://slack.com/api/chat.postMessagepost a message to Slack via APIAI & LLMs · Crown: running it in production · Leaf 44 of 53
why AI needs special hardware
GPUs handle parallel matrix math equations. Graphics Memory (VRAM) stores active model parameters, dictating the maximum model size you can run.
nvidia-smicheck GPU resource load and VRAM consumption in LinuxAI & LLMs · Crown: running it in production · Leaf 45 of 53
shrinking models to fit
Quantization compresses model parameter weights by converting high-precision numbers (FP32/FP16) to lower-precision formats (INT8/INT4), shrinking file sizes.
ollama show llama3 | grep -i quantizationcheck quantization precision of a local modelAI & LLMs · Crown: running it in production · Leaf 46 of 53
running open-source models on your developer machine
Running AI models entirely on your own hardware without sending data to third-party APIs. You download quantized model weights (like Llama 3) and run them locally using your system's VRAM/RAM.
ollama run llama3pull and start a local chat session with Llama 3ollama show --system llama3inspect the default system prompt templateAI & LLMs · Crown: running it in production · Leaf 47 of 53
putting a model behind an endpoint
Model serving means deploying a trained model behind an HTTP/gRPC endpoint (like vLLM, Triton) that dynamically batches queries to optimize graphics card (GPU) utility.
python -m vllm.entrypoints.openai.api_server --model facebook/opt-125mstart an OpenAI-compatible serving host locally with vLLMAI & LLMs · Crown: running it in production · Leaf 48 of 53
sending each prompt to the best model for the job
Model routing is the practice of dynamically selecting which LLM handles a given request based on criteria like complexity, cost, latency, or domain. A lightweight classifier (or simple heuristics) analyzes the incoming prompt and routes it — 'What time is it?' goes to a cheap, fast model; 'Debug this distributed system deadlock' goes to the most capable one. This optimizes spend and response quality simultaneously.
python -c "from litellm import Router; router = Router(model_list=[...]); router.completion(model='gpt-4o', messages=[...])"use LiteLLM's router for multi-model routingAI & LLMs · Crown: running it in production · Leaf 49 of 53
a unified proxy layer between your app and multiple LLM providers
An AI Gateway sits between your application and LLM providers (OpenAI, Anthropic, Google, etc.) like a reverse proxy. It handles provider failover, request/response logging, rate limiting, cost tracking, caching, and guardrails — all in one place. Instead of hardcoding provider-specific SDKs everywhere, your app talks to the gateway, and it routes to the right provider.
curl -X POST -H 'x-portkey-api-key: YOUR_KEY' -d '{"model":"gpt-4o","messages":[...]}' https://api.portkey.ai/v1/chat/completionscall GPT-4o through Portkey AI Gatewaynpx -y @portkey-ai/gatewayrun an open-source AI gateway locallyAI & LLMs · Crown: running it in production · Leaf 50 of 53
optimizing LLM API latency and token reuse costs
Saving the context history. When sending massive prompt instructions (like full project codebases or reference docs) to an LLM, the provider caches the initial part of the prompt. Subsequent questions reuse that cached state, slashing costs and response wait times.
curl -X POST -d '{"model":"claude-3-5-sonnet","system":[{"type":"text","text":"...","cache_control":{"type":"ephemeral"}}]}' https://api.anthropic.com/v1/messagescall API with explicit prompt cachingAI & LLMs · Crown: running it in production · Leaf 51 of 53
preventing LLMs from producing harmful, unsafe, or off-brand output
Guardrails are safety layers that inspect LLM inputs and outputs in real-time. They check for prompt injection, PII leakage, toxic content, off-topic queries, and hallucinated facts. If a guardrail is triggered, the request can be blocked, the response can be rewritten or redacted, or a fallback response is returned instead. Think of it as a content firewall for your LLM.
python -c "from guardrails import Guard; guard = Guard.from_rail('my_config.rail'); guard.validate(llm_output)"validate LLM output with Guardrails AIcurl -X POST -d '{"content":"Check this text for toxicity"}' https://api.openai.com/v1/moderationsrun OpenAI's content moderationAI & LLMs · Crown: running it in production · Leaf 52 of 53
measuring LLM output quality systematically
Evaluating an LLM is harder than evaluating a traditional model because there's no single 'correct' answer. Evaluation frameworks use a mix of automated metrics (BLEU, ROUGE for summarization, exact match for code) and LLM-as-a-judge (a stronger model rates the output). A good eval set covers accuracy, safety, formatting, and edge cases.
python -m llm_judge.evaluate --model my-model --dataset eval_set.jsonlrun an LLM evaluationAI & LLMs · Crown: running it in production · Leaf 53 of 53
testing something non-deterministic
Evaluating LLM outputs by comparing model responses against test benchmarks (accuracy, toxicity, safety) using deterministic assertions or evaluator models.
promptfoo evalrun a prompt engineering evaluation matrix test locallyNetworking makes sense as a trip. Follow one request from the moment you press Enter until the page arrives, one stop at a time.
Ride the line from stop 1. Tap any stop to open it, then use Next to travel the whole route.
17 stops to explore
Networking · Find the address · Stop 1 of 17
how names become IP addresses
The internet's phone book: you ask for supraj.dev, a chain of servers answers with an IP address such as 203.0.113.10. Everything else is caching and who gets asked.
.dev.dig +short supraj.devjust the answer, no noisedig +trace supraj.devwatch the full chain above, liveNetworking · Travel the network · Stop 2 of 17
the foundation all internet communication rides on
Data is split into packets, each tagged with source and destination IP and port. TCP guarantees delivery by numbering packets and retransmitting lost ones. IP handles routing — hopping across routers until the destination network is reached.
ping -c 5 supraj.devcheck latency and packet losstraceroute supraj.devsee every hop packets takeNetworking · Travel the network · Stop 3 of 17
what /24 really means
Classless Inter-Domain Routing (CIDR) defines network sizes. A /24 subnet mask means the first 24 bits are the network address, leaving 8 bits (256 IPs) for host addresses.
ipcalc 192.168.1.0/24calculate IP ranges, masks, and hostsnmap -sn 192.168.1.0/24scan active hosts in a subnetNetworking · Travel the network · Stop 4 of 17
how packets find their way
Routers inspect the destination IP of incoming packets and consult routing tables to determine the next hop. BGP handles internet-level routing; OSPF handles internal networks.
route -nview the system routing tabletraceroute 8.8.8.8trace the hops packets take to GoogleNetworking · Travel the network · Stop 5 of 17
how private IPs reach the internet
Network Address Translation (NAT) maps multiple private IP addresses inside a local network to a single public IP address, allowing local resources outbound access while keeping them hidden from inbound traffic.
curl ifconfig.mecheck your public IP as seen behind NATip route showsee your local routing gatewayNetworking · Travel the network · Stop 6 of 17
who gets in, who gets out
A security barrier that inspects incoming and outgoing network traffic based on rules (IP, port, protocol). Statefulness lets it automatically allow return traffic for established sessions.
iptables -L -n -vlist active Linux firewall rulesufw status verbosecheck Ubuntu firewall statusNetworking · Knock on the door · Stop 7 of 17
how one machine runs many services
A socket is the combination of an IP address and a port (e.g., 127.0.0.1:8080). Ports allow a single machine to multiplex traffic, routing packets to the correct application.
lsof -i :8080find what process is listening on port 8080ss -tulpnlist all active TCP and UDP listeners on the machineNetworking · Knock on the door · Stop 8 of 17
how two machines agree to talk
Before sending any data, the client and server exchange three packets (SYN, SYN-ACK, ACK) to synchronize sequence numbers and establish a reliable session.
netstat -anp | grep SYN_RECVcheck for half-open connections (potential SYN flood)tcpdump -i any tcp[tcpflags] & tcp-syn != 0capture raw SYN packets on the wireNetworking · Knock on the door · Stop 9 of 17
how encryption happens before the lock icon appears
A handshake where the client and server agree on a cipher, exchange keys, and verify identity via a certificate chain. After that, every byte is encrypted with a session key only they know.
ClientHello listing supported cipher suites and TLS versions.pre-master secret encrypted with the server's public key.openssl s_client -connect supraj.dev:443 -showcertsinspect the full certificate chaincurl -vI https://supraj.devwatch every TLS handshake stepNetworking · Arrive at the front door · Stop 10 of 17
serving content from a server near your user
A Content Delivery Network (CDN) caches static assets — images, JS, CSS, videos — at edge locations around the world. When a user in Tokyo requests your site, the CDN serves from a Tokyo edge node instead of fetching from your origin server in Virginia. This cuts latency dramatically and offloads traffic from your origin.
https://cdn.example.com/logo.webp from their browser.Cache-Control: max-age=31536000 tells the edge and browser how long to keep the file.curl -sI https://cdn.example.com/file.jscheck cache headers on a CDN assetaws cloudfront create-invalidation --distribution-id DIST_ID --paths "/*"purge entire CloudFront cacheNetworking · Arrive at the front door · Stop 11 of 17
distributing traffic across servers to keep things fast and reliable
A load balancer sits in front of a group of servers and distributes incoming requests across them using algorithms like round-robin, least connections, or IP hash. It also runs health checks — if a server goes down, traffic stops going to it. Cloud LBs (ALB, NLB, GLB) scale transparently and terminate TLS.
aws elbv2 describe-target-groupslist all target groups and health statuscurl -I https://your-alb-dns.us-east-1.elb.amazonaws.cominspect LB response headersNetworking · Arrive at the front door · Stop 12 of 17
the middleman in front of your app
A server (like Nginx, HAProxy, Caddy) placed in front of your applications. It receives client requests, handles SSL termination, compression, and routes traffic to internal backends.
nginx -ttest Nginx configuration syntaxcurl -I -H 'Host: supraj.dev' http://localhostquery proxy locallyNetworking · Arrive at the front door · Stop 13 of 17
a single front door for all your backend services
An API Gateway sits between clients and your microservices, handling authentication, rate limiting, request routing, response transformation, and API versioning — so your backend services don't have to. Common implementations: AWS API Gateway, Kong, NGINX, Envoy, and Zuul.
https://api.example.com/orders).429 Too Many Requests./orders to the Orders microservice and proxies the request.curl -s -o /dev/null -w "%{http_code}" https://api.example.com/healthcheck gateway health statusaws apigateway get-usage-plan-keys --usage-plan-id PLAN_IDlist API keys for a usage planNetworking · Have the conversation · Stop 14 of 17
the protocol the web speaks
A request-response protocol where your browser sends a method (GET, POST) + path + headers, and the server replies with a status code (200, 404, 500) plus a body. HTTP/2 and 3 add multiplexing and server push on top.
GET /api/users HTTP/1.1 followed by headers and optionally a body.HTTP/1.1 200 OK with response headers and body.curl -I https://supraj.devfetch just the response headerscurl -v https://api.example.comsee the full request/response exchangeNetworking · Have the conversation · Stop 15 of 17
what happens when you hit Enter
From typing a URL to rendering the page: DNS lookup, TCP/TLS handshake, sending the HTTP request, backend routing, receiving the response, and browser rendering.
curl -w '@curl-format.txt' -o /dev/null -s https://supraj.devprint timing breakdown for DNS, TCP, TLSdig +trace supraj.devtrace DNS pathNetworking · Have the conversation · Stop 16 of 17
keeping a connection alive
A protocol providing full-duplex communication over a single TCP connection. It starts as an HTTP request with an Upgrade header, then switches to a persistent binary stream.
wscat -c ws://echo.websocket.orgconnect and chat over WebSocketswebsocat ws://localhost:8080CLI utility to pipe stdin to WebSocketsNetworking · Why it feels slow · Stop 17 of 17
why 'fast' means two things
Bandwidth is the width of the pipe (how many bytes per second); latency is the speed of light (how long a single round-trip takes). You can't outrun the speed of light.
ping -c 10 8.8.8.8check round-trip latencyiperf3 -c speedtest.servertest network bandwidth limitsKubernetes stands on containers, the way a building stands on its foundation. Each floor only makes sense once the floor below it is solid.
Start on the ground floor and go up. Tap any room to open it, then use Next to visit every room in order.
16 rooms to explore
Floor 1 is the foundation, at the bottom. Build upward from there.
Containers & Kubernetes · Foundation: what a container is · Room 1 of 16
isolation without a whole OS
Virtual Machines bundle a full guest OS with virtual hardware via a hypervisor. Containers share the host kernel and isolate processes using kernel namespaces and cgroups, making them lightweight.
docker infocheck host kernel and container platform infouname -acheck host kernel release name inside containerContainers & Kubernetes · Foundation: what a container is · Room 2 of 16
package apps with their entire runtime into lightweight boxes
A Dockerfile describes each layer — OS base, dependencies, app code, start command. docker build creates a cached image; docker run launches a container from it. Each container is an isolated process with its own filesystem, network, and PID namespace.
run command to the Docker daemon (dockerd).--restart is set).docker ps -alist all containers, including stoppeddocker exec -it CONTAINER shget a shell inside a running containerContainers & Kubernetes · Foundation: what a container is · Room 3 of 16
how images are built from stacked, cached snapshots
Every RUN, COPY, or ADD in a Dockerfile creates an immutable layer. Layers stack to form the image. When you rebuild, only changed layers are recreated; unchanged layers come from cache. At runtime, a thin writable layer sits on top — changes never modify the underlying image.
docker history IMAGE_NAMEinspect every layer in an imagedocker image inspect IMAGE_NAMEsee full image metadata and layer digestsContainers & Kubernetes · Foundation: what a container is · Room 4 of 16
where container images are stored, versioned, and scanned
A container registry stores and serves Docker images. Docker Hub, ECR, GCR, GHCR, and self-hosted registries like Harbor. Images are tagged by version or commit SHA, and registries typically offer vulnerability scanning, access control, and retention policies. Your CI pushes images here; your CD pulls them for deployment.
docker push ghcr.io/myorg/myapp:v1.2.3.myapp@sha256:abc...) for deployment — not the mutable tag.docker pull ghcr.io/myorg/myapp@sha256:abc123...pull an image by digesttrivy image ghcr.io/myorg/myapp:v1.2.3scan an image for vulnerabilitiesContainers & Kubernetes · Connecting containers · Room 5 of 16
define and run multi-container apps with a single YAML file
Docker Compose lets you define multiple containers — web app, database, cache, queue — in a compose.yaml file. One docker compose up starts them all on a shared network with configured volumes, ports, and environment variables. Perfect for local dev and CI environments; not designed for production orchestration.
compose.yaml with services (web, db, redis), each specifying image, ports, env, and volumes.depends_on — it starts your database before your web app.docker compose down stops all containers and removes the network, volumes optionally.docker compose up -dstart all services in detached modedocker compose logs -f webtail logs from the web serviceContainers & Kubernetes · Connecting containers · Room 6 of 16
how containers find each other
Containers use virtual network interfaces (veth pairs) linked to a virtual bridge (docker0). The bridge routes packets locally, while iptables rules translate port bindings for external traffic.
docker network lslist all local container networksdocker network inspect bridgeinspect IP allocations and bridge configurationContainers & Kubernetes · Connecting containers · Room 7 of 16
data that survives restarts
Container filesystems are ephemeral. Writable layers are destroyed when a container stops. Volumes mount a directory on the host's physical disk directly into the container filesystem.
docker volume lslist local persistent volumesdocker run -v db_data:/var/lib/mysql mysqlmount volume db_data inside database containerContainers & Kubernetes · Kubernetes takes over · Room 8 of 16
why one container is never enough
The system framework (like Kubernetes, ECS) that coordinates container scheduling, load balancing, replication, service discovery, and health monitoring across a cluster of servers.
kubectl get nodeslist all cluster nodes managed by the orchestratordocker-compose up -d --scale app=3scale replicas locallyContainers & Kubernetes · Kubernetes takes over · Room 9 of 16
orchestrating containers at scale
A cluster of nodes (servers) managed by a control plane. You declare desired state in YAML — Deployment, Service, ConfigMap — and the control plane drives actual state toward it. Pods are the smallest deployable unit: one or more containers sharing a network namespace.
kubectl apply -f deploy.yaml which sends the manifest to the API server.kubectl get pods -Alist every pod across all namespaceskubectl describe pod POD_NAMEsee events, conditions, and container statusContainers & Kubernetes · Kubernetes takes over · Room 10 of 16
many teams, one cluster
Kubernetes Namespaces partition a single physical cluster into multiple virtual clusters, allowing teams to share compute resources without interfering with each other's configuration.
kubectl get nslist all namespaces in the clusterkubectl create ns test-envcreate a new namespaceContainers & Kubernetes · Kubernetes takes over · Room 11 of 16
sharing a node politely
Requests are the minimum CPU/Memory guaranteed to a container. Limits are the absolute maximum resources a container is permitted to consume before getting throttled or killed.
kubectl top podview real-time CPU/Memory usage of active podskubectl describe node NODE_NAMEsee resource allocations and allocations percentageContainers & Kubernetes · Kubernetes takes over · Room 12 of 16
alive isn't ready
Liveness probes check if a container is running (if it fails, the system restarts it). Readiness probes check if the application is fully booted and ready to receive real requests.
kubectl describe pod POD_NAME | grep -i probeinspect active health checks configuration on podContainers & Kubernetes · Rooftop: running real services · Room 13 of 16
routing external traffic to services inside your cluster
An Ingress is a Kubernetes resource that exposes HTTP/HTTPS routes from outside the cluster to services inside. Instead of creating a LoadBalancer for every service, you create one Ingress that routes requests based on hostnames (api.example.com) and paths (/users, /orders) to different backend services.
GET https://api.example.com/users to the Ingress controller's IP.Host header and path.Host: api.example.com + path /users → service: user-svc, port: 8080.kubectl get ingress -Alist all ingress resourceskubectl describe ingress my-ingressshow routing rules and TLS configContainers & Kubernetes · Rooftop: running real services · Room 14 of 16
attaching helper containers to your pod without modifying app code
A sidecar is an additional container running in the same pod as your main application container. They share the same network namespace and volume mounts. Common use cases: logging agents (Fluentd), service mesh proxies (Envoy), secret reloaders, and metrics exporters. The app stays blissfully unaware of the sidecar.
kubectl logs deployment/my-app -c sidecar-proxyview logs of just the sidecar containerkubectl exec deployment/my-app -c sidecar-proxy -- ls /var/logexec into the sidecarContainers & Kubernetes · Rooftop: running real services · Room 15 of 16
running databases in clusters
StatefulSets manage stateful workloads (like databases) by guaranteeing persistent identity names (pod-0, pod-1) and stable storage. Operators extend the API to automate database failovers.
kubectl get statefulsetlist active StatefulSet controllerskubectl get pvcsee volume claims bound to stateful podsContainers & Kubernetes · Rooftop: running real services · Room 16 of 16
kubernetes package manager — templated charts for complex apps
A Helm Chart is a bundle of templated Kubernetes YAML files plus a values.yaml for configuration. helm install renders the templates with your values and applies them to the cluster. Revisions let you upgrade, rollback, and diff releases cleanly.
values.yaml..yaml.tpl file through Go templates, substituting values with .Values.* and .Chart.* references.helm list -Alist all releases across namespaceshelm get values RELEASE_NAMEsee what values were actually appliedGood security is layers, not one big wall. The treasure sits in the vault, guards check everyone at the gate, the outer walls control who gets near, and a watchtower keeps looking out over time.
Start in the vault (layer 1) and work outward. Tap any defence to open it, then use Next to walk every layer in order.
22 defences to explore
3The outer walls: network and edge
Controlling what can reach your systems at all.
2The gate: identity and access
Who are you, and what are you allowed to do?
1The vault: secrets and cryptography
Protecting the data itself.
4The watchtower: staying safe over time
Attacks, vulnerabilities and noticing trouble early.
Security · The vault: secrets and cryptography · Defence 1 of 22
one-way vs two-way
Hashing is a one-way mathematical function that outputs a fixed-length string (like SHA256) and cannot be reversed. Encryption is a two-way function that can be reversed using a secret key.
echo -n "password" | sha256sumgenerate a SHA256 hash of a stringgpg -c secrets.txtencrypt a file symmetrically with a passphraseSecurity · The vault: secrets and cryptography · Defence 2 of 22
the math behind SSH and TLS
A cryptographic model using a public key (shareable) to encrypt data and a private key (secret) to decrypt it. Data encrypted with your public key can only be decrypted by your private key.
ssh-keygen -t rsa -b 4096generate a secure public/private key pairSecurity · The vault: secrets and cryptography · Defence 3 of 22
why browsers trust anyone
Public Key Infrastructure (PKI) manages certificates. A Certificate Authority (CA) signs your public key, confirming your ownership of a domain so browsers trust your site's HTTPS connection.
openssl x509 -in cert.pem -text -nooutinspect certificate fields, domain, and expiration datesSecurity · The vault: secrets and cryptography · Defence 4 of 22
two places data leaks
Encryption in Transit secures data as it travels across the network (TLS, HTTPS). Encryption at Rest secures data stored physically on disks (KMS keys, BitLocker).
openssl enc -aes-256-cbc -salt -in data.txt -out data.encmanually encrypt data before writing to storageSecurity · The vault: secrets and cryptography · Defence 5 of 22
storing and rotating API keys, passwords, and certificates safely
A secrets manager (Vault, AWS Secrets Manager, GCP Secret Manager) stores encrypted secrets and serves them on demand via API. Access is controlled by IAM policies. Secrets are never in code, config files, or environment variables at rest — they're fetched at runtime and rotated automatically.
vault kv get secret/my-app/dbfetch a secret from Vaultaws secretsmanager get-secret-value --secret-id prod/db/passwordget a secret from AWS Secrets ManagerSecurity · The vault: secrets and cryptography · Defence 6 of 22
keys that expire on purpose
The security process of periodically invalidating API keys and passwords, replacing them with new ones to limit the window of opportunity if credentials are leaked.
aws secretsmanager rotate-secret --secret-id my-secretmanually trigger immediate rotation of a secretSecurity · The gate: identity and access · Defence 7 of 22
who you are vs what you may do
Authentication (AuthN) verifies your identity (who you are). Authorization (AuthZ) verifies your access privileges (what resources you are permitted to open or modify).
curl -u username:password https://api.example.comauthenticate via Basic AuthSecurity · The gate: identity and access · Defence 8 of 22
the default should be 'no'
The security principle that users, programs, and service roles should only be granted the minimum necessary permissions to perform their tasks, and nothing more.
aws iam generate-service-last-accessed-details --arn arn:aws:iam::...find unused permissions on an IAM roleSecurity · The gate: identity and access · Defence 9 of 22
how apps get limited access to your data without your password
A protocol where a user authorizes a third-party app (client) to access their data on another service (resource server). Instead of sharing a password, the client gets an access token — scoped, time-limited, and revocable. The authorization code flow is the gold standard for web apps.
client_id, redirect_uri, and scope.authorization_code.client_secret for an access_token and optionally a refresh_token at Google's token endpoint.Authorization: Bearer header to call Google APIs on behalf of the user.curl -H "Authorization: Bearer $TOKEN" https://api.example.com/usercall an API with an OAuth2 tokencurl -d "grant_type=authorization_code&code=..." https://auth.example.com/tokenexchange code for a tokenSecurity · The gate: identity and access · Defence 10 of 22
secretless repository authentication for CI/CD actions
Secretless authentication. Instead of saving permanent password keys (which can leak) inside your deployment pipelines to access cloud resources, your pipeline gets a temporary trust token from its platform and swaps it for a short-lived key at runtime.
aws sts assume-role-with-web-identity --role-arn arn:aws:iam::... --web-identity-token $JWTmanually trade JWT for AWS credentialsSecurity · The gate: identity and access · Defence 11 of 22
compact, self-contained tokens for passing identity and claims
JSON Web Tokens (JWT) are base64-encoded JSON objects with a cryptographic signature. A JWT has three parts: header (algorithm), payload (claims like sub, exp, role), and signature. The server signs it with a secret or private key. Any service that trusts the public key can verify the token without contacting the issuer — no database lookup needed.
eyJhbGciOiJIUzI1NiIs... — signed with a secret key.Authorization: Bearer <token> on every request.user_id: 42, role: admin, exp: 1719000000 — and grants or denies access.jwt-cli decode eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNqPdecode a JWT to inspect its payloadjwt-cli verify --key "my-secret" eyJhbGciOiJIUzI1NiJ9...verify a JWT signatureSecurity · The gate: identity and access · Defence 12 of 22
passwordless, but safe
SSH keys use public-key cryptography to authenticate logins. An SSH agent runs in memory to manage your private keys, decrypting them once with a passphrase so you don't enter it repeatedly.
ssh-add ~/.ssh/id_rsaload your private key into the SSH agentssh-add -llist all active keys managed by the agentSecurity · The outer walls: network and edge · Defence 13 of 22
never trust, always verify — no implicit access based on network location
Traditional security trusts anything inside the corporate network. Zero Trust assumes the network is hostile. Every request — from any user, device, or location — must be authenticated, authorized, and encrypted. Access is granted per-session with least privilege, and continuous monitoring flags anomalous behavior.
curl -v https://zero-trust.example.com 2>&1 | grep -i "cf-access"check for Zero Trust proxy headerstailscale statusinspect Tailscale node connectionsSecurity · The outer walls: network and edge · Defence 14 of 22
perimeter-less access verification
Zero Trust Network Access. Authenticates, authorizes, and audits every user request individually based on device posture and identity before granting minimal resource access.
step-ca bootstrap --ca-url https://ca.local --fingerprint 123initialize private certificates engineSecurity · The outer walls: network and edge · Defence 15 of 22
mutual TLS — both sides prove their identity, not just the server
In regular TLS, only the client verifies the server's certificate. In mutual TLS (mTLS), the server also verifies the client's certificate. Both sides present certificates signed by a trusted CA. This ensures that not only is the server who it claims to be, but every connecting client is authenticated with a cryptographic identity — not just a password or API key.
ClientHello with supported ciphers.CertificateRequest).openssl s_client -connect my-service:443 -cert client.crt -key client.keytest an mTLS connectionkubectl exec deploy/my-app -- ls /etc/certscheck certificates mounted in a podSecurity · The outer walls: network and edge · Defence 16 of 22
in-cluster firewall controls for isolating pod traffic
Pod-level firewalls. By default, any application inside a cluster can freely talk to any other. Network policies let you define traffic isolation rules so that only designated components (like your frontend) are allowed to access sensitive databases.
kubectl get netpol -Alist all active firewalls in the clusterkubectl describe netpol database-isolationview ingress/egress firewall rulesSecurity · The outer walls: network and edge · Defence 17 of 22
filtering malicious traffic before it reaches your application
A Web Application Firewall (WAF) inspects HTTP/HTTPS traffic at the edge and blocks common attacks — SQL injection, cross-site scripting (XSS), cross-site request forgery (CSRF), and OWASP Top 10 threats. AWS WAF, Cloudflare WAF, and ModSecurity allow you to write custom rules to block or rate-limit specific patterns, IPs, or geographies.
GET /products?search=1' OR '1'='1' -- — a classic SQL injection attempt.' OR '1'='1' pattern triggers a SQLi rule.403 Forbidden and logs the event. The attacker never touches your server.aws wafv2 list-web-acls --scope REGIONALlist WAF web ACLsaws wafv2 get-web-acl --name my-acl --scope REGIONAL --id ACL_IDinspect WAF rules and conditionsSecurity · The outer walls: network and edge · Defence 18 of 22
the browser's same-origin policiy enforcer
Cross-Origin Resource Sharing (CORS) is a browser mechanism that controls which domains can access resources from your server. When a web app at app.example.com fetches data from api.example.com, the browser sends a preflight OPTIONS request first. The server responds with Access-Control-Allow-Origin headers to permit or deny the cross-origin request.
OPTIONS preflight request with Origin: https://app.example.com and Access-Control-Request-Method: POST.Access-Control-Allow-Origin: https://app.example.com (or *) and the allowed methods/headers.GET or POST and exposes the response to JavaScript.curl -H "Origin: https://evil.com" -v https://api.example.com/datasimulate a cross-origin requestcurl -X OPTIONS -H "Origin: https://app.example.com" -H "Access-Control-Request-Method: GET" -v https://api.example.com/datatrigger a preflight manuallySecurity · The watchtower: staying safe over time · Defence 19 of 22
when input becomes code
An attack where malicious input strings are interpreted as system commands (SQL, Shell, HTML). Input sanitization and parameterized queries keep input separated from executable commands.
sqlmap -u \"https://example.com/item?id=1\"test endpoints for SQL injection vulnerabilitiesSecurity · The watchtower: staying safe over time · Defence 20 of 22
how vulnerabilities get names
Common Vulnerabilities and Exposures (CVE) index catalog security bugs. Patching is the process of updating system packages and dependencies to run patched releases.
trivy fs .scan local directory dependencies for known CVEsnpm auditcheck package project dependencies for vulnerability alertsSecurity · The watchtower: staying safe over time · Defence 21 of 22
a full inventory of every software component in your application
A Software Bill of Materials (SBOM) is a nested list of all open-source and third-party components in your application — libraries, packages, container base images, their versions, and dependencies. In the event of a CVE (e.g., Log4Shell), you query your SBOM database to instantly know every service that's affected, instead of manually tracking down dependencies.
npm install or go mod download, a tool (Syft, Trivy, CycloneDX plugin) generates an SBOM in SPDX or CycloneDX format.lodash@4.17.20 → 3 known CVEs.syft packages ghcr.io/myorg/myapp:v1.2.3 -o spdx-jsongenerate an SBOM for a container imagegrype ghcr.io/myorg/myapp:v1.2.3scan an image for CVEs using its SBOMSecurity · The watchtower: staying safe over time · Defence 22 of 22
centralized logging and alerting for security events
A Security Information and Event Management (SIEM) system ingests logs from every source — cloud trails, firewall flows, server syslogs, app audit logs — normalizes them, and runs real-time correlation rules. When a rule fires (e.g., 'same user logs in from 2 continents in 5 minutes'), an alert is created for the SOC team to investigate.
wazuh-control statuscheck Wazuh SIEM agent statussplunk search 'index=aws sourcetype=cloudtrail eventName=ConsoleLogin'search for AWS console logins in SplunkDevOps is a pipeline. You describe what you want, build it into something shippable, release it safely, then watch it run and fix it when it breaks.
Follow the pipeline from station 1. Tap any step to open it, then use Next to go through the whole pipeline in order.
17 steps to explore
Write down the desired state, not the commands.
Turn a commit into a versioned artifact.
Release to users without betting everything at once.
Know how it behaves, and respond when it breaks.
DevOps · Describe it · Step 1 of 17
describing vs commanding
Declarative states WHAT the infrastructure should look like (e.g. Kubernetes, Terraform), while Imperative states HOW to build it using a series of steps (e.g. bash scripts, CLI commands).
kubectl apply -f deployment.yamldeclaratively apply a configuration statekubectl create deployment my-app --replicas=3imperatively command pod creationDevOps · Describe it · Step 2 of 17
why running twice must be safe
A property where executing an operation multiple times produces the exact same result as executing it once, preventing resource duplication or configuration errors.
ansible-playbook --check playbook.ymlverify if tasks will make changes without altering target statemkdir -p my-diridempotently create a directory (succeeds even if folder exists)DevOps · Describe it · Step 3 of 17
automating server setup and software configuration at scale
Tools like Ansible, Puppet, or Chef define the desired state of servers in code — packages installed, services running, files placed. Ansible is agentless (SSH-based), while Puppet/Chef use agents. Running the tool converges the server toward the declared state, fixing any drift.
ansible-playbook with an inventory (list of hosts) and a playbook (YAML tasks).ansible all -m pingtest SSH connectivity to all inventory hostsansible-playbook --check playbook.ymldry-run a playbook without making changesDevOps · Describe it · Step 4 of 17
when reality stops matching the code
Drift happens when manual changes, auto-scaling events, or untracked scripts modify active server states so they no longer match the version-controlled IaC code files.
terraform plancompare live cloud resources with IaC files to locate driftDevOps · Build and package · Step 5 of 17
automated pipelines that build, test, and deploy every change
Every time you push code, a CI server (GitHub Actions, GitLab CI, Jenkins) automatically runs tests, linters, and builds. If everything passes, CD deploys the artifact to staging or production — no manual steps. The pipeline is defined in YAML in your repo, versioned alongside your code.
gh run list --limit 10list recent GitHub Actions runsact --listlist GitHub Actions jobs locally with actDevOps · Build and package · Step 6 of 17
what 2.1.3 promises
A standard formatting rule for code releases: MAJOR.MINOR.PATCH. Increment MAJOR for breaking changes, MINOR for features, and PATCH for backward-compatible bug fixes.
npm semver v2.1.3check if a version fits within range constraintsgit tag -a v2.0.0 -m "breaking release"publish a SemVer tag to git repository historyDevOps · Build and package · Step 7 of 17
storing, versioning, and distributing build outputs
After CI builds your code, the output — a Docker image, JAR, npm package, or binary — is pushed to an artifact registry (Docker Hub, ECR, Artifactory, GHCR). Each artifact is immutable and tagged with a version or commit SHA. Deployments pull the exact same artifact that passed testing, eliminating 'works on my machine'.
myapp:abc1234).docker pull ghcr.io/myorg/myapp:abc1234pull an exact artifact by SHAdocker tag myapp:latest myapp:v1.2.3tag an image with a semantic versionDevOps · Ship it safely · Step 8 of 17
declarative GitOps continuous delivery for Kubernetes
Your git repository is the single source of truth. A background agent constantly compares what is written in your code with what is actually running in your servers. If they differ, it pulls the changes from Git to make them match.
argocd app get my-appcheck synchronization status and healthargocd app sync my-apptrigger a manual state synchronizationDevOps · Ship it safely · Step 9 of 17
turning features on and off without deploying code
Feature flags (aka feature toggles) are conditionals in your code that enable or disable functionality without a deployment. You wrap a new feature in if (flags.isEnabled('new-checkout')) { ... }. The flag service evaluates at runtime — flip a switch and the feature activates for all users, a beta group, or just internal testers.
if (flagService.isEnabled('dark-mode')) — the new code is deployed but dormant.isEnabled is called, the SDK fetches the flag rules (cached locally) and evaluates against user attributes.curl -s https://launchdarkly.com/sdk/flag/eval/my-flag --header "Authorization: $SDK_KEY"evaluate a feature flag via APIgit grep "featureFlag|isEnabled" -- '*.ts' '*.go' '*.py' | wc -lcount flag usage in codebaseDevOps · Ship it safely · Step 10 of 17
shipping without downtime
A zero-downtime release pattern where two identical production environments (Blue/active, Green/staging) exist. You deploy changes to Green, test it, then switch the router to direct traffic to Green.
aws elbv2 modify-listener --listener-arn ... --default-actions Type=forward,TargetGroupArn=green-tgroute ALB traffic to the green target groupkubectl patch service my-app -p '{\"spec\":{\"selector\":{\"version\":\"green\"}}}'point service selector to green podsDevOps · Ship it safely · Step 11 of 17
rolling out changes to a small subset before full release
A canary deployment routes a small percentage of traffic (e.g., 5%) to the new version while the rest hits the stable version. You monitor metrics — error rate, latency, throughput — and if everything looks good, you gradually ramp up to 100%. If something goes wrong, you route all traffic back to the old version instantly.
kubectl set image deployment/my-app canary=my-app:v2update the canary pod's imagekubectl rollout undo deployment/my-approllback a deploymentDevOps · Ship it safely · Step 12 of 17
undoing a bad release
The process of reverting a system to its last known stable state. Reverting deployments can be achieved by redeploying the previous build artifact or modifying DNS/routing selectors.
kubectl rollout undo deployment/my-apprevert a Kubernetes deployment rollout immediatelygit revert COMMIT_SHAcreate a new commit that undoes the changes of a broken commitDevOps · Run and watch it · Step 13 of 17
managing microservice traffic, security, and observability out-of-band
A dedicated infrastructure layer that controls how services talk to each other. Instead of writing custom security, logging, and retry logic inside every single microservice codebase, you attach a tiny helper proxy next to each service to handle all communication.
istioctl analyzedetect configuration issues in your meshistioctl dashboard kialilaunch the visual mesh topology dashboardDevOps · Run and watch it · Step 14 of 17
knowing what your system is doing at all times
Monitoring collects metrics (CPU, latency, error rates) and triggers alerts when thresholds are breached. Observability goes further — with traces (distributed request paths), structured logs, and rich metrics — so you can ask arbitrary questions about system behavior without pre-defining every dashboard.
/metrics.node_cpu_seconds_total > 0.9 for 5 minutes, fires an alert.promtool check rules alerts.ymlvalidate Prometheus alerting rulescurl localhost:9090/api/v1/query?query=upquery Prometheus API for target statusDevOps · Run and watch it · Step 15 of 17
standardizing logs, metrics, and traces
An open-source observability framework (CNCF) providing a standardized set of APIs, SDKs, and collectors to capture and export telemetry data across microservices.
otelcol --config config.yamlstart local telemetry collectorDevOps · Run and watch it · Step 16 of 17
measuring 'is it working?'
SLI (Indicator) is the actual metric (e.g. latency). SLO (Objective) is the target goal (e.g. 99% under 200ms). SLA (Agreement) is the legal promise to customers with penalties.
promtool check metricstest alert metrics calculations syntaxDevOps · Run and watch it · Step 17 of 17
the structured process of detecting, responding to, and learning from outages
When a production incident happens — site down, errors spiking, data corrupted — you need a process, not panic. Incident management means: declare severity, assemble a response team (commander, comms, responders), communicate in a dedicated channel, mitigate (rollback, scale up, feature flag off), and follow up with a postmortem. Blameless culture is non-negotiable.
pd ack INCIDENT_IDacknowledge a PagerDuty incidentcurl -X POST -d '{"status":"resolved"}' https://api.pagerduty.com/incidents/INCIDENT_IDresolve an incident via APIGive a model context, tools, and a way to be evaluated.
Start with a name. Follow it to an application.
Connect a change to its runtime and operating signals.
THE KNOWLEDGE MAP
From tokens and retrieval to agents, evaluation, and production model systems.
Follow a request through names, connections, routing, and the web.
Read the operating system through its processes, files, permissions, and services.
Understand images, workloads, orchestration, and the boundaries around a service.
Connect compute, storage, identity, and networks with cost and resilience in mind.
Move changes through delivery, observe their behavior, and recover when things fail.
Turn infrastructure into definitions you can review, repeat, and maintain.
Reason about trust, access, secrets, and the controls between system boundaries.
Understand the history behind commits, branches, merges, and safe recovery.
Try a shorter phrase, another subject, or clear the filters.