Ce contenu n'est pas disponible dans la langue sélectionnée.

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
Retour au début
Red Hat logoGithubredditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance. Découvrez nos récentes mises à jour.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez le Blog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

Theme

© 2025 Red Hat