Last active
June 20, 2018 16:57
-
-
Save davidxia/b99a1a32754e66b85438e39a262e4d38 to your computer and use it in GitHub Desktop.
get k8s cluster's namespaces with httpie, jq, yq, gcloud, and fish shell
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
http GET \ | |
(yq r ~/.kube/config -j | jq -r ".clusters[] | select(.name == \"$cluster_name\") | .cluster.server")/api/v1/namespaces \ | |
'Authorization: Bearer '(\ | |
gcloud config config-helper --format json | jq -r .credential.access_token | |
) \ | |
--verify no \ | |
| jq -r .items[].metadata.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment