Home · Latest · Trends  /  Kubernetes
0

Scale kubernetes pods to 0 to effectively restart them

rated 0 times [  0] [ 0]  / comments: 0 / hits: 12  / 5 days ago, mon, aug 12, 2019, 13:25:12
# First, see how many there are..
kubectl get pods -n <namespace> | grep <name>

# Then, scale it to 0
kubectl scale deployment <name> --replicas=0 -n <namespace>

# Then, scale it back to whatever.. 
kubectl scale deployment <name> --replicas=2 -n <namespace>
More From » Kubernetes
 

Comments

There are no comments for this Snippet yet
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
rob

rob

Member since Feb 22, 2017
Total Code Snippets: 127
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017