How to manage multiple Openshift accounts using rhc

Openshift is one of the best PaaS from my point of view. In comparison with Heroku, Openshift I believe has upper hand and much superiority, particularly in CLI tool, ssh facility, and most importantly huge numbers of offered frameworks. Therefore, it totally makes sense to have different account for different purposes. However, switching between account might be cumbersome especially when you want to deploy, monitor different applications located in different account. Don’t worry, Openshift CLI tool (rhc) provides all required facility and switching between account is one of them. Basically what you need to do is to logout from one account and then login to another account to do the task. This usually can be done with two commands and will take less than a minute to do.

Assume I am logged in using account to and now I want to switch to account. To do so I do this,

$ rhc logout
$ rhc setup -l

The above solution works perfectly fine, but even if you don’t want to switch between accounts constantly, there is better solution. Assume, I am logged in using and decided to quickly check log of one my application named “xyz” which is in account and then continue my work using account.  To do so, I need to use -l argument with every command without switching sessions like following,

$ rhc tail xyz -l

As you can see by using -l parameter in every command you are not required to switch session for each single simple task.

Leave a Reply