$ oadm create-bootstrap-project-template -o yaml > template.yaml
You can allow developers to create their own projects. An accessible endpoint exists that will provision a project according to a template. This endpoint is made accessible when a developer creates a new project.
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.
To create your own custom project template:
Start with the current default project template:
$ oadm create-bootstrap-project-template -o yaml > template.yaml
Modify the template by adding objects or modifying existing objects, then load the template:
$ oc create -f template.yaml -n default
Modify the master-config.yaml file to reference the loaded template:
... projectConfig: projectRequestTemplate: "default/project-request" ...
When a project request is submitted, the API substitutes the following parameters into the template:
Parameter | Description |
---|---|
PROJECT_NAME |
The name of the project. Required. |
PROJECT_DISPLAYNAME |
The display name of the project. May be empty. |
PROJECT_DESCRIPTION |
The description of the project. May be empty. |
PROJECT_ADMIN_USER |
The username of the requesting user. |
Access to the API is granted to developers with the
self-provisioner
role and the self-provisioners
cluster role binding. This role is available
to all authenticated developers by default.
Deleting the self-provisioners
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 web console and command line when they attempt to self-provision a project.
For example:
Contact your system administrator at projectname@example.com 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.