Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying OPENSHIFT COOKBOOK
  • Table Of Contents Toc
OPENSHIFT COOKBOOK

OPENSHIFT COOKBOOK

By : Gulati
3.8 (6)
close
close
OPENSHIFT COOKBOOK

OPENSHIFT COOKBOOK

3.8 (6)
By: Gulati

Overview of this book

If you are a web application developer who wants to use the OpenShift platform to host your next big idea but are looking for guidance on how to achieve this, then this book is the first step you need to take. This is a very accessible cookbook where no previous knowledge of OpenShift is needed.
Table of Contents (14 chapters)
close
close
12
A. Running OpenShift on a Virtual Machine
13
Index

Setting up an OpenShift account using rhc

In the Installing the OpenShift rhc command-line client recipe, you learned how to install the rhc command-line client. After installation, the first operation you have to perform is to set up the OpenShift account. In this recipe, you will learn how to set up your account using rhc.

Getting ready

To complete this recipe, you will need to have rhc installed on your machine. Refer to the Installing the OpenShift rhc command-line client recipe for instructions.

How to do it…

To set up an OpenShift account, open a command-line terminal and run the following command:

$ rhc setup

How it works…

Before you can use the rhc client to work with OpenShift, you have to set up the account.

The setup command does the following:

  1. It first asks you to provide your OpenShift credentials to authenticate with openshift.redhat.com.
  2. After successful authentication, rhc asks whether it should create an authorization token. An authorization token allows you to access the OpenShift server without entering the password with every command. It stores the token in the .openshift folder under the user's home directory. By default, the token is valid for 30 days, which means that after this you have to authenticate it again.
  3. Next, the setup command creates a file called express.conf in the .openshift folder under the user's home directory. The express.conf file stores the basic configuration required by rhc such as the OpenShift server location, your OpenShift username, and whether or not to create and use authorization tokens.
  4. If no SSH key exists in the .ssh folder at ~/.ssh, then the rhc setup command will generate a new key pair using the ssh-keygen utility.
  5. After generating the new SSH key pair, rhc will upload the public SSH key to the OpenShift server. OpenShift copies the public key into an authorization file on the application gear called authorized_keys at ~/.ssh/authorized_keys. In the Uploading SSh keys using the web console recipe, you uploaded the public SSH key using the web console. It will prompt you to provide the name of the key or use the default name generated by the setup command.
  6. Next, rhc checks if Git has been installed. The rhc setup command will run a simple check against your local configuration and credentials to confirm that the configurations have been completed. It will also run a series of tests to check whether ssh has been configured properly and whether your system can communicate with OpenShift servers.
  7. Finally, rhc asks the user to create a domain if one is not already created. In the Creating OpenShift domains using the web console recipe, you created the domain using the web console.

There's more…

You can run the rhc setup command anytime while working with OpenShift. Every time you run the rhc setup command, it will use the configuration properties defined in the express.conf file. If you want to generate a new, clean configuration, you can use the --clean option. This will run the setup command again, ignoring any saved configuration options stored in express.conf:

$ rhc setup --clean

See also

  • The Enabling the autocomplete feature in an rhc command-line client recipe
  • The Viewing the account details using rhc recipe
  • The Specifying a different OpenShift server hostname recipe
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
OPENSHIFT COOKBOOK
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon