Skip to content

Instantly share code, notes, and snippets.

@sumansrivastava
Created February 9, 2023 16:41
Show Gist options
  • Select an option

  • Save sumansrivastava/a674ed9621747f3455785d9cba2384bd to your computer and use it in GitHub Desktop.

Select an option

Save sumansrivastava/a674ed9621747f3455785d9cba2384bd to your computer and use it in GitHub Desktop.
#!/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