Last active
July 26, 2022 10:14
-
-
Save GoaMind/c7bb167d33a8f5f14d7e809ad2a6e467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PODS | |
# Get all problematic pods from all namespaces | |
kubectl get pods -A | grep -v "Running\|Completed" | |
# Get most PODs with most reservation | |
kubectl get po -o=custom-columns='NAME:.metadata.name,CONTAINERS:.spec.containers[*].name,REQUEST:.spec.containers[*].resources.requests.cpu,AGE:.metadata.creationTimestamp' --sort-by='.spec.containers[0].resources.requests.cpu' -A | |
# DEPLOYMENTS | |
# Scale all deployments to 1 | |
kubectl scale --replicas=1 `kubectl get deploy -o name` | |
# NODES | |
# Get nodes sorted with by creation time (oldest on top) | |
kubectl get get nodes --sort-by=.metadata.creationTimestamp | |
# Get nodes resource | |
kubectl get nodes -o=custom-columns='NAME:.metadata.name,CPU ALLOC:.status.allocatable.cpu,CPU CAPACITY:.status.capacity.cpu' | |
# HELM | |
# Uninstall all releases | |
helm uninstall `helm list --short` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment