We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not sure exactly where these should go. But here are some useful kubectl templates
Calls python to search for directories on all pods matching a search criteria
kubectl -n NAMESPACE get pods | grep SEARCH_CRITERIA | awk '{ print $1 }' | xargs -I@ kubectl exec -n NAMESPACE @ -- /opt/conda/envs/worker/bin/python -c 'import sys; import os; matches=[f for f in os.listdir("PATH_TO_SEARCH_DIR") if f in [DIRNAME_OR_LIST_OF_DIRNAMES]]; print((str(sys.argv[1]) + ": " + str(matches) + "\n") if len(matches) > 0 else "", end="");' @
For example, this finds specific geoclaw run directories on test-hub pods matching the pattern "dask-delgadom*":
"dask-delgadom*"
kubectl -n test-hub get pods | grep dask-delgadom | awk '{ print $1 }' | xargs -I@ kubectl exec -n test-hub @ -- /opt/conda/envs/worker/bin/python -c 'import sys; import os; matches=[f for f in os.listdir("/") if f in ["gfdl5_rcp45_2007_2025_1825", "miroc5_rcp45_2007_2025_1083", "ccsm4_rcp85_2007_2025_626", "ccsm4_rcp85_2007_2025_1035", "mpi5_rcp45_2055_2065_668"]]; print((str(sys.argv[1]) + ": " + str(matches) + "\n") if len(matches) > 0 else "", end="");' @
kubectl -n NAMESPACE get pods | grep Completed | awk "{print $1}" | xargs kubectl -n NAMESPACE delete pods
for example on the main compute.rhg deployment:
kubectl -n rhodium-jupyter get pods | grep Completed | awk "{print $1}" | xargs kubectl -n rhodium-jupyter delete pods
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Not sure exactly where these should go. But here are some useful kubectl templates
Interacting directly with pods
Find a (or one of several) named directory(ies) on all pods:
Calls python to search for directories on all pods matching a search criteria
For example, this finds specific geoclaw run directories on test-hub pods matching the pattern
"dask-delgadom*"
:Managing pods
Delete "Succeeded" pods
for example on the main compute.rhg deployment:
The text was updated successfully, but these errors were encountered: