Skip to content

Instantly share code, notes, and snippets.

@richstokes
Last active April 28, 2021 19:38
Show Gist options
  • Save richstokes/365ab4821e99cdfac06e2f7d9f9eae81 to your computer and use it in GitHub Desktop.
Save richstokes/365ab4821e99cdfac06e2f7d9f9eae81 to your computer and use it in GitHub Desktop.
Create KUBECONFIG for current convox rack
#!/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