Show Table of Contents
12.7. Switching Between Multiple OpenShift Environments
The client tools now support the environment variable
OPENSHIFT_CONFIG, which overrides the default configuration file that the client tools will read from. This enables specifying only once the configuration file rather than having to specify it every time using the --config option. See Section 12.6, “Using Multiple OpenShift Configuration Files”. When you define the OPENSHIFT_CONFIG setting in your environment, the client tool will read the defined configuration file.
Procedure 12.3. To Switch Between OpenShift Environments
- Set the
OPENSHIFT_CONFIGenvironment variable under a bash shell using the following command:#
export OPENSHIFT_CONFIG=bob - Run
rhc setupto create the new configuration file: ~/.openshift/bob.conf. Specify which broker server you want to connect to using the--serveroption:#
rhc setup --server broker.example.com - Verify that you are connected to the defined environment by running an
rhccommand:# rhc domain show - Restore to default configuration by removing the value in
OPENSHIFT_CONFIGwith the following command:# export OPENSHIFT_CONFIG=
Note
Authentication tokens are stored locally based on the broker server and the username, so you do not need to sign in again as you switch between servers.
To check which broker server you are currently configured to use, run the following command:
# rhc account
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.