Introduction
OpenShift Online cartridges are a mechanism to encapsulate application components, for example language runtimes, middleware, and databases, and expose them as services so developers can use them to create applications. OpenShift Online provides a set of default cartridges for various web programming languages and frameworks, for example Java, PHP, Ruby, Python, Node.js, and Perl. It also provides default cartridges for databases and other types of services, for example MySQL, PostgreSQL, Jenkins CI server and client, Cron, and the HAProxy load balancer.
A developer begins creating an application in OpenShift Online by selecting a web framework cartridge for the desired programming language. Web framework cartridges handle HTTP requests and serve web pages or business APIs. The OpenShift Online servers route traffic to the application’s web cartridge, where the developer’s code runs. The developer can add further cartridges, for example a database or a build server, to provide additional capabilities to the application. OpenShift Online also provides embedded cartridges to support other cartridges, for example the phpMyAdmin cartridge for managing a MySQL database.
The OpenShift Online cartridge model enables choice in application technology while reducing the effort of integrating various application components. OpenShift Online cartridges encapsulate standard application runtimes and binaries and contain an implementation of the life cycle events required to run the software. For example, cartridges implement commands to start, stop, and scale applications. Cartridge configuration and setup is convention based, with an emphasis on minimizing external dependencies in the cartridge code.
OpenShift Online cartridges are extensible, and custom cartridges can be created to integrate application components that are not supported with the available cartridges. This document provides guidelines and specifications about OpenShift Online cartridges, and it is intended for developers who are interested in creating custom cartridges.
Basic Administration
1. Viewing Account Information
View basic information for an account with the following command:
$ rhc account
Example 1.1. Viewing Account Information
$ rhc account
root@ubuntu:~# rhc account Login kang.yang@linksprite.com on openshift.redhat.com ---------------------------------------------- ID: 539917d75973ca25ba000109 Plan: Free Gears Used: 0 Gears Allowed: 3 Domains Allowed: 1 Allowed Gear Sizes: small SSL Certificates: no</code>
2.Ending Current Session
End the current session with the remote server and remove all local session files with the following command:
$ rhc logout
3.Viewing Authorization Tokens
View the tokens associated with your account with the following command:
$rhc authorization list
Example3.1. Viewing Authorization Tokens
root@ubuntu:~# rhc authorization list RHC/1.21.3 (from ubuntu on arm-linux-eabihf) -------------------------------------------- Token: 1ffeeaac9a9c025f69b817e8af09f605486027c2eb1c3ccf7c78ab2cd2c8bae8 Scopes: session Created: 3:01 AM Expires In: 30 days OpenShift Console (from 113.57.190.25 on browser) ------------------------------------------------- Token: 9d9ade3a4c04324a7341ba6cab0f2b87a42f01b81be204176f8d40fa8e4a4ca8 Scopes: session Created: 3:00 AM Expires In: 30 days
4. Supported SSH Keys
ssh-rsa |
ssh-dss |
ecdsa-sha2-nistp256-cert-v01@openssh.com |
ecdsa-sha2-nistp384-cert-v01@openssh.com |
ecdsa-sha2-nistp521-cert-v01@openssh.com |
ssh-rsa-cert-v01@openssh.com |
ssh-dss-cert-v01@openssh.com |
ssh-rsa-cert-v00@openssh.com |
ssh-dss-cert-v00@openssh.com |
ecdsa-sha2-nistp256 |
ecdsa-sha2-nistp384 |
ecdsa-sha2-nistp521 |
4.1 Generating Keys Manually
The following instructions describe how to generate a new pair of RSA or DSA keys.
-
Run the following command to generate a pair of keys, replacing KeyType with the type of key to generate:
$ ssh-keygen -t
-
Press Enter when prompted to save the key file in the default location:
... Generating public/private rsa key pair. Enter file in which to save the key (/home/username/.ssh/id_rsa): /home/<em class="replaceable">username</em>/.ssh/id_rsa
-
Enter a passphrase or leave blank when prompted, then press Enter:
Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/<em class="replaceable">username</em>/.ssh/id_rsa Your public key has been saved in /home/<em class="replaceable">username</em>/.ssh/id_rsa.pub. ...
Example 4.1 Generating Keys Manually
root@ubuntu:~# ssh-keygen -t ssh-rsa Generating public/private ssh-rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/id_rsa already exists. Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: 22:9b:8e:30:7e:0a:22:64:95:df:36:74:f7:18:6e:49 root@ubuntu The key's randomart image is: +--[ RSA 2048]----+ | | | . | | o . . E | | . . o . + = | | o ...+S = . | |o +... . | |* o | |=o + | | o+ . | +-----------------+
4.2 Adding a Key
Once an SSH key has been generated, add the key by uploading it to the remote server with the following command, replacing KeyName and KeyPath with the name and path of the key to upload:
$rhc sshkey add KeyName KeyPath
Example 4.2 Adding a Key
root@ubuntu:~# rhc sshkey add pcduinokey /root/.ssh/id_rsa.pub RESULT: SSH key /root/.ssh/id_rsa.pub has been added as 'pcduinokey'
4.3 Viewing All Public Keys
View a list of all public keys associated with an account with the following command:
$ rhc sshkey list
Example 4.3. Viewing All Public Keys
root@ubuntu:~# rhc sshkey list default (type: ssh-rsa) ----------------------- Fingerprint: d6:77:2a:c2:ba:e4:f5:42:bf:f9:2f:d8:64:6a:16:60 pcduinokey (type: ssh-rsa) -------------------------- Fingerprint: 22:9b:8e:30:7e:0a:22:64:95:df:36:74:f7:18:6e:49 You have 2 SSH keys associated with your account.
4.4 Viewing a Specific Public Key
View details of a specific key with the following command, specifying the name of the key:
$rhc sshkey show KeyName
Example 4.4. Viewing All Public Keys
root@ubuntu:~# rhc sshkey show pcduinokey pcduinokey (type: ssh-rsa) -------------------------- Fingerprint: 22:9b:8e:30:7e:0a:22:64:95:df:36:74:f7:18:6e:49
4.5 Deleting a Key
Delete an existing public key from the remote server with the following command:
$rhc sshkey remove KeyName
Example 4.5. Viewing All Public Keys
root@ubuntu:~# rhc sshkey remove pcduinokey Removing the key 'pcduinokey ... removed
5. Staying Current
Once you’ve installed the rhc
gem, it’s very easy to update. Ruby includes a built in mechanism for updating libraries. Just run:
$ gem update rhc
or
$ sudo gem update rhc
and you’ll get the latest version of the tools. Be sure to check your specific Operating System instructions above if you have any problems.
Leave a Reply
You must be logged in to post a comment.