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

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
主站蜘蛛池模板: 九龙城区| 友谊县| 淮阳县| 信丰县| 绥江县| 平塘县| 云霄县| 左贡县| 浙江省| 五寨县| 织金县| 金山区| 漳浦县| 张家界市| 磴口县| 遂溪县| 新竹县| 内丘县| 盖州市| 抚州市| 平和县| 惠州市| 樟树市| 成武县| 菏泽市| 南汇区| 屯留县| 大渡口区| 海淀区| 新源县| 行唐县| 丰台区| 稻城县| 广东省| 射阳县| 尼勒克县| 绿春县| 梁平县| 金秀| 会理县| 萍乡市|