Skip to content

Instantly share code, notes, and snippets.

@Bharathkumarraju
Last active May 19, 2020 03:05
Show Gist options
  • Save Bharathkumarraju/97a919f7cb4313d9ab4f23e079d2c446 to your computer and use it in GitHub Desktop.
Save Bharathkumarraju/97a919f7cb4313d9ab4f23e079d2c446 to your computer and use it in GitHub Desktop.
List all available api resources in all namespaces in kubernetes cluster
#! /bin/bash
ALL_RESOURCES=$(kubectl api-resources | awk 'NR>1' | awk '{print $1}' | xargs echo)
for i in $ALL_RESOURCES
do
echo -e "$i\n------------------------------------------------------------------"
kubectl get $i --all-namespaces
echo -e "\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment