Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Accessing PRODUCTION rails console

Nell Shamrell-Harrington edited this page Feb 5, 2018 · 1 revision

To access the Rails console on our production infrastructure you will first need to set up your workstation to access our Kubernetes Cluster.

One your workstation is set up, run this command to view a list of our Kubernetes pods:

$ kubectl get pods -n operationcode

You should see output similar to this:

operationcode-backend-b867668dc-8jjkl6       2/2       Running   0          3d
operationcode-backend-b867668dc-chmxfa       2/2       Running   0          3d
operationcode-frontend-65c997d69-hlhzg       1/1       Running   0          43m
operationcode-frontend-65c997d69-pfcf0       1/1       Running   0          43m
operationcode-redis-redis-7c5db6c694-xnmtt   1/1       Running   0          28d
town-crier-6b698646fd-2sn4r

Our rails application runs in the "operationcode-backend" pods (they should be identical).

Select on of the "operationcode-backend" pods, it doesn't matter which one, and run this command (substituting in the identifier of the backend pod):

$ kubectl exec -it operationcode-backend-identifer -c app bash -n operationcode

This will put you into a container running our Rails application. From there, run

$ rails console