🚀 Deploy
A Deployment is the standard way to run an application on the cluster. You say which image to use and how many copies (replicas) you want, and Kubernetes creates the pods and keeps them running: if a pod goes down, it creates another.
Deployment -> ReplicaSet -> Pods
Deployment is done with kubectl. The Nuvion Panel takes care of the cluster, but does not create applications inside it.
🚀 Before you start
- Have cluster access configured (see Cluster Access).
🚀 1. Create the Deployment file
Create the file deploy-web.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-deploy
spec:
replicas: 2
selector:
matchLabels:
app: web-deploy
template:
metadata:
labels:
app: web-deploy
spec:
containers:
- name: nginx
image: nginx:1.26
ports:
- containerPort: 80
resources:
requests:
cpu: 100m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
httpGet:
path: /
port: 80
What each part does:
| Field | Purpose |
|---|---|
replicas | How many pods to keep running |
image | The container image (and version) |
requests | The minimum resources the pod needs |
limits | The maximum resources the pod can use |
readinessProbe | Only sends traffic to the pod after it responds |
🚀 2. Apply
kubectl apply -f deploy-web.yaml
Expected output: deployment.apps/web-deploy created
🚀 3. Verify
kubectl get deployment web-deploy
kubectl get pods -l app=web-deploy
Wait for the READY column to show 2/2 and the pods to be Running.
🚀 4. See the automatic recreation
Delete one of the pods and watch:
kubectl delete pod NAME-OF-ONE-OF-THE-PODS
kubectl get pods -l app=web-deploy
Kubernetes creates a new pod to keep 2 replicas.
🚀 5. Expose the application
To access the Deployment, create a Service (see the Services page):
kubectl expose deployment web-deploy --name=web-deploy-svc --port=80
✅ How to know it worked
kubectl get deployment web-deploy shows READY 2/2 and AVAILABLE 2.
❗ Common problems
| Symptom | Cause | Solution |
|---|---|---|
READY 0/2 | Pods did not start | See kubectl describe pod and Events |
ImagePullBackOff | Image or version does not exist | Check the name and tag in image |
selector does not match template labels | matchLabels differs from labels | Use the same label in both |
Pods Pending | No resources on the nodes | Reduce requests or increase capacity (Scale) |
🧹 Cleanup
Keep the Deployment for the next Operations pages. When you are done:
kubectl delete svc web-deploy-svc
kubectl delete deployment web-deploy
➡️ Next step: Scale
🧠 Questions?
Talk to our SaveinCloud technical support team!