Skip to content

Instantly share code, notes, and snippets.

@joshy91
Created July 13, 2018 07:42
Show Gist options
  • Save joshy91/f449f59af55079a3e21237d7dc955352 to your computer and use it in GitHub Desktop.
Save joshy91/f449f59af55079a3e21237d7dc955352 to your computer and use it in GitHub Desktop.
#!/bin/bash
#Manually scaling an application through yaml and cml
#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=4
#Check status of nginx deployment after scaling
kubectl get deployments
#Check status of pods; including replicas
kubectl get pods
#Change set image in nginx deployment yaml
sed -i 's/replicas: 2/replicas: 4/g' /home/user/nginx-deployment.yaml
#Apply changes to nginx deployment yaml
kubectl apply -f nginx-deployment.yaml
#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