Create Constraint Templates
This section describes how to create a constraint template.
Prerequisites
You should join a cluster and have the cluster-admin permission within the cluster. For more information, refer to "Cluster Members" and "Cluster Roles".
Gatekeeper should have been installed and enabled.
Steps
Log in to the KubeSphere web console with a user who has the cluster-admin permission, and access your cluster.
Click Gatekeeper > Constraint Templates in the left navigation pane.
Click Create on the page.
In the Create Constraint Template dialog, set the name and targets of the constraint template, then click OK.
Parameter Description CRD Name
The CRD name corresponding to the constraint template.
Targets
Targets are the target objects of the constraint, i.e., the resource objects that need to apply the constraint rules. Targets can be various resources in the Kubernetes cluster, such as Pod, Deployment, Namespace, etc. Constraints will be applied to these target objects to ensure they meet the requirements of the constraint rules.
You will view the created constraint template on the Constraint Templates page.
Feedback
Was this page Helpful?
Receive the latest news, articles and updates from KubeSphere
Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.