OpenShift Template Operations: Difference between revisions
Line 52: | Line 52: | ||
[...] | [...] | ||
name: '''<font color=teal>project-request</font>''' | name: '''<font color=teal>project-request</font>''' | ||
5. When a new project request is submitted, the API substitutes the following parameters into the template: | |||
* 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 administrating user. | |||
* PROJECT_REQUESTING_USER: the username of the requesting user. | |||
Access to the API is granted to user with the "self-provisioner" role and the "self-provisioners" cluster role binding. This role is available to all authenticated users by default. |
Revision as of 21:31, 2 November 2017
Internal
Get a List of Templates for a Specific Project
oc get templates -n openshift
Upload a Template to the Current Project
oc create -f <template-file.json|yaml>
Creating a Template
Modify the Template for New Projects
1. Start with the current default project template:
oadm create-bootstrap-project-template -o yaml > new-project-template.yaml
It will produce a file similar to this: default new project template
2. The file content can be modified by adding new objects or modifying existing objects.
3. Once the template has been modified, it must be loaded into the default namespace:
oc create -f ./new-project-template.yaml -n default
The newly created template can then be displayed with:
oc get templates -n default NAME DESCRIPTION PARAMETERS OBJECTS project-request 5 (5 blank) 6
4. Modify master-config.yaml projectRequestTemplate as follows:
... projectConfig: projectRequestTemplate: "default/project-request" ...
The "project-request" name comes from the oadm-generated template:
apiVersion: v1 kind: Template metadata: [...] name: project-request
5. When a new project request is submitted, the API substitutes the following parameters into the template:
- 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 administrating user.
- PROJECT_REQUESTING_USER: the username of the requesting user.
Access to the API is granted to user with the "self-provisioner" role and the "self-provisioners" cluster role binding. This role is available to all authenticated users by default.