Created
August 9, 2022 11:39
-
-
Save makkes/92b07b5ad53eea49b63dfe37269c8afc 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
#!/usr/bin/env bash | |
# | |
# A silly little kubectl plugin helping you become more intimate with your Kubernetes | |
# cluster. | |
# | |
# 1. Download the file | |
# 2. Put it somewhere within your `$PATH` | |
# 3. Make it executable | |
# 4. `kubectl im-feeling-lucky` | |
NS=$(kubectl get ns -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | shuf | head -1) | |
RES=$(kubectl api-resources -o name | shuf | head -1) | |
CMD="kubectl -n $NS get $RES" | |
echo $CMD | |
$CMD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment