Create Cluster Template
Cluster templates for GKE is only supported with self hosted controller.
A Cluster Template is a preset configuration that can be used to replicate infrastructure resources. The controller allows the Infra Admin to create Cluster Templates, enabling to abstract the details of the resource creation by exposing limited configuration. Both Infra Admin and Cluster Admin can use these templates to create GKE clusters.
A cluster template can be used to preconfigure and limit the configuration details available to users when provisioning a cluster. Templates can be used to restrict or enforce infrastructure configurations within an environment.
Step 1: New Cluster Template¶
To create a new cluster template, perform the below procedure:
- Login to the controller and click Cluster Templates.
- Click New Template.
- Enter the Cluster Name and optionally provide the Description.
- Click Create.
The cluster templates are version-controlled so that the lifecycle can be properly managed. In this example, the admin has not yet configured anything. So, no versions are available yet.
Step 2. New Version¶
- Click New Version and use the wizard to provide details.
- Provide a version number/name.
- When creating a new version of a cluster template in the Console, the settings from the previous version are loaded on to the page. This allows users to make adjustments to an existing cluster template configuration.
- Refer to the GKE Schema for more information about the cluster template configuration.
- Select the GCP credentials from the drop-down. See Credentials for GCP GKE for creating credentials.
- Select a location type, zone, and K8s version.
- Select a Blueprint and Version. See Blueprints for creating blueprints.
- Select a location. Add additional locations, if needed.
Use the Override option if required.
|Allowed||Allows the users to provide any value.|
|Not Allowed||Users are not allowed to override the values defined in the template.|
|Allow Limited||Allows adding one or more values (like regions) to a restricted list. When creating a cluster from a template, the user can only select the values defined in the restricted list.|
Set the network name and node subnet.
Use the name for the network and node subnet. Do not use the CIDR.
Select a cluster privacy setting.
- Set the control plane IP range.
- Set access controls and other network settings.
- Add control plane authorized networks, if needed.
- Add node pools, if needed.
The GKE node pools specified in a cluster template are all that will be available to the cluster. Once a cluster is created from a template, adding and deleting node pools to that cluster is not allowed. Make sure the cluster template has the desired node pools attached before creating a cluster.
- Select workload identity, RBAC, and other security settings.
- Select feature settings, like logging and monitoring.
- Select pre-bootstrap commands and enable a proxy.
- Click SAVE CHANGES to complete the cluster template creation.
The entire history of cluster template versions is maintained on the Controller. Admins can view details about the versions of cluster templates.
View/ Share/ Edit/ Delete/ Cluster Templates¶
As an Admin, login to the Controller.
Navigate to Infrastructure -> Cluster Templates. The dashboard shows the list of templates available within this project. A cluster template can be used for creating one or more cluster(s).
Click the share icon to share a cluster template to all projects or a specific project.
- Users cannot share a cluster template from a project to other project(s) if the cluster template name is identical in any other project(s).
- Once a cluster template is mapped to a cluster, it cannot be unassigned/unshared from that cluster specific project.
- When sharing a cluster template to a project, user must also share the blueprint and cloud credential associated with that specific cluster template.
To edit an existing template and add a new version, click Edit icon.
Click Delete icon to delete an existing template.
Users cannot share/edit/delete a cluster template that are inherited from other project. Also, cannot delete a cluster template which is associated with a cluster.
- Click the Clusters count to view the list of clusters and their respective cluster template version.