Prompt
How do I deploy containerized applications with Kubernetes?
Latest observation
Oct 2, 2026
OpenAI APIWeb search: off
Deploying a containerized application with Kubernetes usually means: package your app in a container image, define the desired state in YAML, and apply it to a Kubernetes cluster.
Typical workflow
1. Containerize the app
Create a container image with a Dockerfile, then build and push it to a registry.
docker build -t myrepo/myapp:1.0 .
docker push myrepo/myapp:1.0
2. Create Kubernetes manifests
You generally need at least:
- Deployment: runs and manages your app pods
- Service: exposes your app inside or outside the cluster
- Optional: Ingress, ConfigMap, Secret, PersistentVolumeClaim
3. Define a Deployment
Example deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 3
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myrepo/myapp:1.0
ports:
- containerPort: 8080
This tells Kubernetes to keep 3 replicas of your app running.
4. Expose it with a Service
Example service.yaml:
apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
type: ClusterIP
If you want external access, use:
LoadBalanceron cloud providersNodePortfor basic external exposureIngressfor host/path-based routing
5. Apply the manifests
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
6. Verify deployment
kubectl get pods
kubectl get deployments
kubectl get svc
Check logs if something fails:
kubectl logs <pod-name>
kubectl describe pod <pod-name>
Common extras
Environment variables
env:
- name: NODE_ENV
value: production
Health checks
livenessProbe:
httpGet:
path: /health
port: 8080
readinessProbe:
httpGet:
path: /ready
port: 8080
Scaling
kubectl scale deployment myapp --replicas=5
Updating
Build and push a new image tag, then update the Deployment:
kubectl set image deployment/myapp myapp=myrepo/myapp:1.1
Minimal example in one file
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp
spec:
replicas: 2
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: myrepo/myapp:1.0
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: myapp
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
type: ClusterIP
Apply it with:
kubectl apply -f app.yaml
If you want, I can also give you:
- a full step-by-step deployment example,
- a Helm chart example, or
- a deployment guide for a specific app stack like Node.js, Python, or Java.
Brands