官术网_书友最值得收藏!

Adding an editor member to a domain using rhc

Imagine that you are leading a software development team that uses OpenShift for development. During development, you would like all the developers in your team to be able to create, delete, push, or even SSH into application gear. However, you would not want users to rename or delete a domain, as this might impact other developers in your team or other teams. Another thing you would not like is to allow developers to change gear sizes. You can restrict development domains to only use small gears to save money. In this scenario, you will give developers an editor role that gives them the freedom to work with applications but not domains.

Getting ready

To complete this recipe, you will need to have rhc installed on your machine. Please refer to the Installing the OpenShift rhc command-line client recipe in Chapter 1, Getting Started with OpenShift, for instructions.

You will need two OpenShift accounts to work through this recipe. Please refer to the Creating an OpenShift online account recipe in Chapter 1, Getting Started with OpenShift, for OpenShift account registration instructions.

How to do it…

To add the openshift.cookbook.test@gmail.com user as an editor to the devosbook domain of openshift.cookbook@gmail.com, run the following command:

$ rhc add-member openshift.cookbook.test@gmail.com --namespace devosbook --role edit

How it works…

The edit role allows a user to perform the following actions on a domain:

  • A user can create applications under the domain
  • A user can delete applications under the domain
  • A user can view logs of the application
  • A user can perform other application-related actions such as start, stop, and restart
  • A user can push the source code using Git
  • A user can SSH into the application gear using SSH

When you run the rhc add-member command with the edit role, OpenShift will firstly add a new member to a domain with an edit role and then copy the user public SSH key to the OpenShift gear ~/.ssh/authorized_keys file. This allows an editor to perform SSH-related operations such as code deployment using Git and SSH to the application gear.

To check whether the editor has been added successfully, you can view the domain details:

$ rhc show-domain
Domain devosbook (owned by openshift.cookbook@gmail.com)
-----------------------------------------------------
Created: Jan 14 9:49 AM
Allowed Gear Sizes: small
Members: openshift.cookbook.test@gmail.com (edit)

There's more…

You can also use the web console to add the editor to your application. Just follow the steps mentioned in the Adding viewer members to a domain using rhc recipe in this chapter.

See also

  • The Adding viewer members to a domain using rhc recipe
  • The Adding an admin member to a domain using rhc recipe
  • The Viewing all the members in a domain using rhc recipe
主站蜘蛛池模板: 宝山区| 蒙阴县| 海阳市| 沽源县| 娄烦县| 尖扎县| 涿州市| 桐梓县| 化州市| 永善县| 桂平市| 和平县| 临海市| 建平县| 隆化县| 普兰县| 苍溪县| 临清市| 万荣县| 县级市| 石泉县| 三门县| 平罗县| 滕州市| 康乐县| 台州市| 沅江市| 玉树县| 淳安县| 凯里市| 顺平县| 饶河县| 阳山县| 邻水| 印江| 江永县| 石泉县| 奇台县| 明星| 宣城市| 乐至县|