Kubernetes Basics for Frontend Engineers
Understand the core objects, the deployment flow, and the minimum commands you need to ship a frontend app with confidence.
Learn what Kubernetes actually does, how a frontend app moves from image to cluster to domain, and which objects matter when you first deploy a real project.
Core concepts
That is why Kubernetes feels different from running a process on one VM. You do not manage one machine; you manage a set of rules. The cluster decides where pods should run, how many should exist, and what to do when one dies.
For a frontend team, this means deployments become repeatable. If the desired state says three replicas of a given image should be available, Kubernetes keeps working until that is true.
- Cluster = the whole Kubernetes environment.
- Node = a machine that runs workloads.
- Pod = the smallest deployable unit, usually one app container.
- Deployment = keeps the desired number of pods alive and handles updates.
Service gives pods a stable internal address even when individual pods change. Ingress exposes the app to the outside world and routes a domain to the right Service. ConfigMap holds non-secret configuration, while Secret holds sensitive values like tokens and passwords.
You will also see Namespace early. It is a practical way to separate environments, teams, or experiments without mixing everything together.
- Service = stable networking for pod-to-pod or app-to-app traffic.
- Ingress = public HTTP entry point for a domain.
- ConfigMap = environment config that is safe to expose.
- Secret = values that must not live in plain text.
- Namespace = a logical boundary inside a cluster.
A CI pipeline builds a container image and pushes it to a registry. A Deployment then references that image and creates pods. A Service gives those pods a stable name inside the cluster, and an Ingress maps a real domain to that Service.
The key lesson is separation of concerns. The image is immutable, the Deployment manages replicas, the Service handles internal traffic, and the Ingress handles public routing.
- Build once, deploy many times.
- Do not rely on the `latest` tag for production.
- Keep the app image reusable across staging and production.
`kubectl get pods` shows status at a glance. `kubectl describe pod` shows events and the reason behind a failure. `kubectl logs` shows app output. `kubectl rollout status` tells you whether a deployment is progressing, and `kubectl rollout undo` gives you a fast rollback path.
If a teammate asks what is broken, these commands are your first-response toolkit. You will look much more senior if you can explain the failure from pod status, events, and logs instead of from intuition alone.
- Use `get` to scan the cluster.
- Use `describe` when status alone is not enough.
- Use `logs` for application behavior.
- Use `rollout status` and `rollout undo` for deployment control.
This is one of the easiest ways to avoid rebuilds for every environment. Keep public values like API base URLs in a ConfigMap and keep private values in Secrets. That lets the same image run in staging and production with different settings.
For frontend apps, this matters because build-time and runtime configuration are not always the same thing. Decide early which values are baked into the image and which values should be injected when the pod starts.
- Use ConfigMap for public runtime settings.
- Use Secret for tokens, keys, and passwords.
- Do not commit secrets to the repository.
Visual model
Practical examples
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
template:
spec:
containers:
- name: web
image: ghcr.io/org/web:1.2.3Service + Ingress expose the pods
- Service gives the pods a stable internal name
- Ingress maps app.example.com to that Service
- Deployment keeps replicas alive and rolls out new imagesenvFrom:
- configMapRef:
name: web-config
- secretRef:
name: web-secretsThe pod starts with environment-specific values injected at runtimekubectl get pods
kubectl describe pod web-7f9d9
kubectl logs web-7f9d9You can usually tell whether the failure is image, config, permissions, or app code