Created
February 9, 2023 16:41
-
-
Save sumansrivastava/a674ed9621747f3455785d9cba2384bd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/bin/bash | |
| # Set the name of the namespace | |
| namespace="my-namespace" | |
| # Get the names of all pods in the namespace | |
| pod_list=$(kubectl get pods -n $namespace -o jsonpath='{.items[*].metadata.name}') | |
| # Loop through the pods and check the status of their mounts | |
| for pod in $pod_list; do | |
| echo "Checking pod: $pod" | |
| # Get the status of the mounts | |
| kubectl exec -n $namespace $pod -- df -h | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment