Skip to content

Instantly share code, notes, and snippets.

@joshy91
Created July 13, 2018 07:29
Show Gist options
  • Save joshy91/33b7863f47bb29e86bc461a67c7cffeb to your computer and use it in GitHub Desktop.
Save joshy91/33b7863f47bb29e86bc461a67c7cffeb to your computer and use it in GitHub Desktop.
Manually scaling an application
#!/bin/bash
#Manually scaling an application (can also be done through yaml changes)
#Nginx deployment yaml created in previous script
kubectl create -f nginx-deployment.yaml
#Detailed status of nginx deployment
kubectl describe deployment nginx-deployment
#Scale deployment to 3 replicas
kubectl scale deployment/nginx-deployment --replicas=3
#Check status of nginx deployment after scaling
kubectl get deployments
#Check status of pods; including replicas
kubectl get pods
#Scale deployment to 1 replicas
kubectl scale deployment/nginx-deployment --replicas=1
#Check status of pods; including replicas
kubectl get pods
#Scale deployment to 2 replicas
kubectl scale deployment/nginx-deployment --replicas=2
#Check status of pods; including replicas
kubectl get pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment