1. Container
What: A lightweight, standalone package of software with everything it needs to run.
Analogy: A shipping container that works on any truck, ship, or train.
# Example: Container image for a POS backend
FROM node:18
COPY app.js /app/
CMD ["node", "/app/app.js"]
Key point for IM: When investigating issues, you're looking at logs from containers.
2. Pod
What: The smallest deployable unit in K8s. Usually contains one container (sometimes multiple related containers).
Analogy: A pod is like a virtual machine that runs your container.
# Example: POS backend pod
apiVersion: v1
kind: Pod
metadata:
name: pos-backend-abc123
labels:
app: pos-backend
spec:
containers:
- name: pos-backend
image: yum/pos-backend:2.1
ports:
- containerPort: 8080Key point for IM: During an incident, you'll often check if pods are running or crashing.
Common pod states:
Running: Everything is workingCrashLoopBackOff: Container keeps crashing (red flag!)Pending: Waiting to be scheduledImagePullBackOff: Can't download container image (network issue?)
3. Deployment
What: Manages a set of identical pods, ensures desired number are always running.
Analogy: A manager that ensures you always have 3 cashiers working (if one quits, hire another).
# Example: POS backend deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: pos-backend
spec:
replicas: 3 # Always run 3 copies
selector:
matchLabels:
app: pos-backend
template:
metadata:
labels:
app: pos-backend
spec:
containers:
- name: pos-backend
image: yum/pos-backend:2.1Key point for IM: If a service is "down," check if the deployment has the right number of replicas running.
4. Service
What: A stable network endpoint that load balances traffic to pods.
Analogy: A phone number for a company that routes calls to available agents.
# Example: POS backend service
apiVersion: v1
kind: Service
metadata:
name: pos-backend-service
spec:
selector:
app: pos-backend
ports:
- port: 80
targetPort: 8080
type: ClusterIPKey point for IM: If the POS can't reach the backend, check if the service is properly routing traffic.
5. Namespace
What: Virtual clusters within a physical cluster. Isolates resources.
Analogy: Folders on a computer to organize files.
Common namespaces in Byte Edge:
default: Default namespacepos: POS-related servicespayment: Payment processing servicesobservability: ClickStack components (ClickHouse, HyperDX UI, OpenTelemetry Collector)kube-system: K8s internal services (don't touch!)
Key point for IM: Always specify namespace when investigating. Services in different namespaces are isolated.
6. ConfigMap & Secret
What: Store configuration data and sensitive data (passwords, API keys).
ConfigMap: Plain text configuration Secret: Base64-encoded sensitive data
# ConfigMap example
apiVersion: v1
kind: ConfigMap
metadata:
name: pos-config
data:
api_endpoint: "https://cloud.yum.com/api"
log_level: "info"
---
# Secret example
apiVersion: v1
kind: Secret
metadata:
name: payment-secret
type: Opaque
data:
api_key: c29tZS1zZWNyZXQta2V5 # base64 encoded
Key point for IM: Configuration changes (new ConfigMap/Secret) can cause issues. Check recent changes during incidents.