- OpenShift Cookbook
- Shekhar Gulati
- 544字
- 2021-08-05 17:37:37
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:
- It first asks you to provide your OpenShift credentials to authenticate with openshift.redhat.com.
- 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'shome
directory. By default, the token is valid for 30 days, which means that after this you have to authenticate it again. - Next, the
setup
command creates a file calledexpress.conf
in the.openshift
folder under the user'shome
directory. Theexpress.conf
file stores the basic configuration required byrhc
such as the OpenShift server location, your OpenShift username, and whether or not to create and use authorization tokens. - If no SSH key exists in the
.ssh
folder at~/.ssh
, then therhc
setup
command will generate a new key pair using thessh-keygen
utility. - 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 calledauthorized_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 thesetup
command. - Next,
rhc
checks if Git has been installed. Therhc 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 whetherssh
has been configured properly and whether your system can communicate with OpenShift servers. - 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
- 物聯網與北斗應用
- 電子政務效益的經濟分析與評價
- 信息通信網絡建設安全管理概要2
- Windows Server 2003 Active Directory Design and Implementation: Creating, Migrating, and Merging Networks
- Building RESTful Web Services with Spring 5(Second Edition)
- Getting Started with WebRTC
- Android UI Design
- 云計算技術與標準化
- 精通SEO:100%網站流量提升密碼
- 商業的本質和互聯網
- 現場綜合化網絡運營與維護:運營商數字化轉型技術與實踐
- 想象的互動:網絡人際傳播中的印象形成
- 物聯網傳感器技術與應用
- 結網@改變世界的互聯網產品經理(修訂版)
- 現場總線與工業以太網及其應用技術(第2版)