Skip to content

Instantly share code, notes, and snippets.

@IanVaughan
Created May 14, 2018 08:30
Show Gist options
  • Save IanVaughan/583e4821886c24088c124f7e4c870993 to your computer and use it in GitHub Desktop.
Save IanVaughan/583e4821886c24088c124f7e4c870993 to your computer and use it in GitHub Desktop.
Get a Rails Console to CoreAPI
# Usage
# api-console staging
ENV=$1
echo "* Finding POD on: $ENV"
POD=$(kubectl --context $ENV get pods | grep core-api-app | tail -n 1 | cut -d " " -f 1)
echo "* Execing into: $POD"
kubectl --context $ENV exec -it $POD rails c
@IanVaughan
Copy link
Author

$ kubectl config get-contexts
CURRENT   NAME      CLUSTER                                                          AUTHINFO                                                         NAMESPACE
          prod      ...
          qa        ...
          staging   ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment