Last active
April 28, 2021 19:38
-
-
Save richstokes/365ab4821e99cdfac06e2f7d9f9eae81 to your computer and use it in GitHub Desktop.
Create KUBECONFIG for current convox rack
This file contains hidden or 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
#!/bin/bash | |
set -e | |
RACKNAME=$(convox rack | grep Name | xargs | cut -d" " -f2) | |
echo "Creating kubeconfig for $RACKNAME" | |
convox rack kubeconfig > $HOME/.kube/$RACKNAME-config | |
export KUBECONFIG=$HOME/.kube/$RACKNAME-config | |
echo "Testing" | |
kubectl get nodes | |
echo "Run: export KUBECONFIG=$HOME/.kube/$RACKNAME-config" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment