-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Edits to self_provisioning file #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,31 +10,105 @@ | |
| toc::[] | ||
|
|
||
| == Overview | ||
| In some cases, it is desirable to allow users to create projects for themselves without administrator intervention. To make this simpler, a user accessible endpoint is present that will provision a project according to a template. This endpoint is made accessible via: `osc new-project <project-name>`. | ||
| You can allow developers to create their own projects. An accessible endpoint | ||
| exists that will provision a project according to a | ||
| link:../dev_guide/templates.html[template]. This endpoint is made accessible | ||
| when a developer link:../dev_guide/projects.html[creates a new project]. | ||
|
|
||
| == Configuration | ||
| === New project template | ||
| The API server creates new auto-provisioned projects based on a template that it finds based on the `projectRequestTemplate` property of the master-config.yaml. The property is in the form "namespace/templatename", by default "openshift/project-request". If the template does not exist, the API server will create a default template that creates a project with the requested name and assigns the requesting user to the "admin" role for that project. If the property is empty, then no action is taken and self-provisioning will fail. | ||
| == Template for New Projects | ||
| The API server automatically provisions projects based on the template that is | ||
| defined in the `projectRequestTemplate` parameter of the *_master-config.yaml_* | ||
| file. If the parameter is not defined, the API server creates a default template | ||
| that creates a project with the requested name, and assigns the requesting user | ||
| to the "admin" role for that project. | ||
|
|
||
| If you want to change the way the shape of self-provisioned projects, you can change the template. The API will substitute the following parameters into the template: | ||
| You can create your own custom template by using the below as an example, and | ||
| defining the desired template's location in the *_master-config.yaml_* file: | ||
|
|
||
| . PROJECT_NAME - name of the project | ||
| .Example New Project Template | ||
| ==== | ||
| ---- | ||
| apiVersion: v1beta3 | ||
| kind: Template | ||
| metadata: | ||
| name: project-request | ||
| namespace: openshift | ||
| objects: | ||
| - apiVersion: v1beta1 | ||
| displayName: ${PROJECT_DISPLAYNAME} | ||
| kind: Project | ||
| metadata: | ||
| annotations: | ||
| description: ${PROJECT_DESCRIPTION} | ||
| displayName: ${PROJECT_DISPLAYNAME} | ||
| creationTimestamp: null | ||
| name: ${PROJECT_NAME} | ||
| spec: {} | ||
| status: {} | ||
| - apiVersion: v1beta1 | ||
| groupNames: [] | ||
| kind: RoleBinding | ||
| metadata: | ||
| creationTimestamp: null | ||
| name: admins | ||
| namespace: ${PROJECT_NAME} | ||
| roleRef: | ||
| name: admin | ||
| userNames: | ||
| - ${PROJECT_ADMIN_USER} | ||
| parameters: | ||
| - name: PROJECT_NAME <1> | ||
| - name: PROJECT_DISPLAYNAME <2> | ||
| - name: PROJECT_DESCRIPTION <3> | ||
| - name: PROJECT_ADMIN_USER <4> | ||
| ---- | ||
|
|
||
| . PROJECT_DISPLAYNAME = display name of the project (defaults to PROJECT_NAME) | ||
| <1> The name of the project | ||
| <2> The display name of the project. Defaults to *PROJECT_NAME*. | ||
| <3> The description of the project. Defaults to *PROJECT_DISPLAYNAME*. | ||
| <4> The name of the requesting user. | ||
|
|
||
| . PROJECT_DESCRIPTION = description of the project (defaults to PROJECT_DISPLAYNAME) | ||
| ==== | ||
| //// | ||
| The API substitutes the following parameters into the template: | ||
|
|
||
| . PROJECT_ADMIN_USER = name of the requesting user | ||
| [cols="4,8",options="header"] | ||
| |=== | ||
| |Parameter |Description | ||
|
|
||
| |*PROJECT_NAME* | ||
| |The name of the project | ||
|
|
||
| |*PROJECT_DISPLAYNAME* | ||
| |The display name of the project. Defaults to *PROJECT_NAME*. | ||
|
|
||
| === Permissions | ||
| Access to this API is granted via the `self-provisioner` role and the `self-provisioners` cluster role binding. By default, it is available to all authenticated users. | ||
| |*PROJECT_DESCRIPTION* | ||
| |The description of the project. Defaults to *PROJECT_DISPLAYNAME*. | ||
|
|
||
| === Disabling auto-provisioning | ||
| Deleting the `self-provisioners` cluster role binding will deny permissions for auto-provisioning new projects. If you remove this permission, you should consider setting the `projectRequestMessage` option inside of the master-config.yaml file with instructions for how users can request a project. That field is a string that will be presented to user in the webui and the cli when they attempt to self-provision a project. Some common examples are: | ||
| |*PROJECT_ADMIN_USER* | ||
| |The name of the requesting user. | ||
| |=== | ||
| //// | ||
|
|
||
| . Call Bob at (555) 867-5309 to request a project | ||
| Access to the API is granted to developers with the | ||
| link:../dev_guide/authorization.html#roles[`self-provisioner` role] and the | ||
| `self-provisioners` cluster role binding. This role is available to all | ||
| authenticated developers by default. | ||
|
|
||
| . Fill out the project request form located at https://internal.example.com/openshift-project-request | ||
|
|
||
| == Disabling Self-provisioning | ||
| Deleting the `self-provisioners` link:../architecture/additional_concepts/authorization.html#roles[cluster role binding] will deny permissions for | ||
| self-provisioning any new projects. When disabling self-provisioning, set the | ||
| `projectRequestMessage` parameter in the *_master-config.yaml_* file instructing developers on how to request a new project. This parameter is a | ||
| string that will be presented to the developer in the Management Console and | ||
| command line when they attempt to self-provision a project. For example: | ||
|
|
||
| ---- | ||
| Contact your system administrator at [email protected] to request a project. | ||
| ---- | ||
|
|
||
| or: | ||
|
|
||
| ---- | ||
| To request a new project, fill out the project request form located at | ||
| https://internal.example.com/openshift-project-request. | ||
| ---- | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We create the default template internally, but we never persist it, so you can't view it.