Kubernetes Advanced for Frontend Teams
Learn the production patterns that keep deployments safe, scaling sensible, and debugging fast when real traffic starts hitting your app.
Go beyond the basics and learn how health checks, autoscaling, rollout strategy, permissions, observability, and packaging work together in real clusters.
Core concepts
Requests tell the scheduler what the pod needs to run. Limits cap how much it can use. If you under-request CPU or memory, the pod can be placed badly or get squeezed under load. If you over-request, the cluster wastes capacity and scales less efficiently.
Frontend apps can be surprisingly expensive when they server-render, warm caches, or perform heavy data work during startup. That is why requests and limits should be based on real load, not guesses.
- Set CPU and memory requests so scheduling is predictable.
- Set limits to protect the node and other workloads.
- Watch for throttling and OOMKilled pods when the app gets busy.
Readiness means 'should traffic be sent yet?' This is the most important probe during a rollout because it keeps users away from pods that are still warming up or waiting on dependencies. Liveness means 'is this process stuck or broken?' If the answer is no, Kubernetes restarts it. Startup gives slow apps time to boot without being killed too early.
For SSR apps, this matters a lot. If your app needs to compile, hydrate, warm caches, or wait for a downstream service, the readiness gate should reflect that real startup cost.
- Use readiness to protect traffic.
- Use liveness to recover from dead or stuck processes.
- Use startup when boot time is slower than the normal probe window.
The default rolling update is often enough, but you still need to know what `maxUnavailable` and `maxSurge` do. If a bad release starts breaking requests, rollback speed matters more than optimism. For higher-risk services, teams often add canary or blue/green patterns so they can observe a change before all traffic moves.
Production readiness is not only about the app being up; it is about the update path being safe enough that the team trusts it. That trust is what lets you ship often.
- Rolling updates replace pods gradually.
- Canary releases expose a small slice of traffic first.
- Blue/green keeps two versions around and switches traffic between them.
- PodDisruptionBudgets help keep too many pods from disappearing at once.
Horizontal Pod Autoscaling adds or removes replicas when metrics cross thresholds. That is useful for handling traffic spikes without paying for the maximum size all the time. Namespaces then help you keep dev, staging, and prod separated so configuration and access stay sane.
If you truly need persistent storage or stable pod identity, you start looking at PVCs and StatefulSets. For most frontend teams this is not day one knowledge, but it is important to know that stateless apps and stateful workloads are intentionally handled differently.
- HPA scales replicas based on metrics.
- Namespaces keep environments and teams separated.
- Stateless apps are easier to scale; stateful apps need extra care.
RBAC decides who can do what. Service accounts let workloads act with limited permissions. For debugging, you should know how to check logs, events, and rollout status before you guess. For packaging, Helm and Kustomize help you reuse manifests across environments instead of copying YAML by hand.
The goal is not to memorize every command. The goal is to have a repeatable path from pull request to cluster to rollback, with enough visibility that your team can trust the result.
- Give people and workloads the minimum permissions they need.
- Use logs, events, and metrics together when debugging.
- Use Helm or Kustomize to avoid copy-pasted manifests.
- Keep environment differences in overlays or values, not in ad hoc edits.
Visual model
Practical examples
readinessProbe:
httpGet:
path: /api/health
port: 3000
initialDelaySeconds: 5
periodSeconds: 10The pod stays out of service until the app is readyapiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
spec:
minReplicas: 2
maxReplicas: 8Replicas increase when the metric crosses the thresholdkubectl rollout status deployment/web
kubectl describe pod web-7f9d9
kubectl logs web-7f9d9You can usually tell whether the issue is probe failure, image pull, permissions, or app crashNamespace: staging
Image: ghcr.io/org/web:1.2.3
Config overlay: staging-values.yamlEach environment gets the right domain, config, and access rules