Este contenido no está disponible en el idioma seleccionado.

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

  1. Set the OPENSHIFT_CONFIG environment variable under a bash shell using the following command:
    # export OPENSHIFT_CONFIG=bobexport OPENSHIFT_CONFIG=bob
    Copy to Clipboard Toggle word wrap
  2. Run rhc setup to create the new configuration file: ~/.openshift/bob.conf. Specify which broker server you want to connect to using the --server option:
    # rhc setup --server broker.example.comrhc setup --server broker.example.com
    Copy to Clipboard Toggle word wrap
  3. Verify that you are connected to the defined environment by running an rhc command:
    # rhc domain show
    Copy to Clipboard Toggle word wrap
  4. Restore to default configuration by removing the value in OPENSHIFT_CONFIG with the following command:
    # export OPENSHIFT_CONFIG=
    Copy to Clipboard Toggle word wrap

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
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat