Prompt
How do I deploy containerized apps with Kubernetes?
Latest observation
Oct 19, 2026
OpenAI APIWeb search: off
Deploying containerized apps with Kubernetes usually looks like this:
1) Build and push your container image
First, package your app into a Docker/OCI image and push it to a registry.
docker build -t myrepo/myapp:1.0 .
docker push myrepo/myapp:1.0
Common registries:
- Docker Hub
- GitHub Container Registry
- AWS ECR / GCP Artifact Registry / Azure ACR
2) Create Kubernetes manifests
You typically define:
- Deployment: runs and manages your app pods
- Service: exposes your app inside or outside the cluster
- Optional: Ingress, ConfigMap, Secret, HPA, etc.
Example Deployment
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
Example Service
apiVersion: v1
kind: Service
metadata:
name: myapp-service
spec:
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
type: ClusterIP
Apply them:
kubectl apply -f deployment.yaml
kubectl apply -f service.yaml
3) Expose the app
If you want external access, use one of these:
- ClusterIP: internal-only
- NodePort: exposes on each node’s port
- LoadBalancer: provisions a cloud load balancer
- Ingress: HTTP/HTTPS routing with a controller like NGINX or Traefik
Example LoadBalancer service:
apiVersion: v1
kind: Service
metadata:
name: myapp-lb
spec:
type: LoadBalancer
selector:
app: myapp
ports:
- port: 80
targetPort: 8080
4) Verify deployment
Check pods, services, and rollout status:
kubectl get pods
kubectl get svc
kubectl rollout status deployment/myapp
View logs:
kubectl logs deploy/myapp
Describe a pod if something is wrong:
kubectl describe pod <pod-name>
5) Add environment config and secrets
Use ConfigMaps for non-sensitive config:
apiVersion: v1
kind: ConfigMap
metadata:
name: myapp-config
data:
APP_ENV: production
Use Secrets for sensitive values:
apiVersion: v1
kind: Secret
metadata:
name: myapp-secret
type: Opaque
stringData:
DB_PASSWORD: supersecret
6) Use health checks
Add liveness and readiness probes so Kubernetes can restart unhealthy containers and avoid sending traffic too early:
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
7) Update safely
Kubernetes Deployments support rolling updates by default. Update the image and re-apply:
kubectl set image deployment/myapp myapp=myrepo/myapp:1.1
8) Optional: use Helm or Kustomize
For real-world deployments:
- Helm: templated package manager
- Kustomize: overlay-based customization
Typical workflow
- Code app
- Build container image
- Push image to registry
- Write Kubernetes manifests
kubectl apply- Expose with Service/Ingress
- Monitor logs and health
- Roll out updates
If you want, I can also give you:
- a complete end-to-end example
- a Kubernetes YAML template for a web app
- or steps to deploy on EKS/GKE/AKS/minikube