< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

创建约束模板

本节介绍如何创建约束模板。

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".

  • KubeSphere 平台需要安装并启用 Gatekeeper 扩展组件。

Steps

  1. Log in to the KubeSphere web console with a user who has the cluster-admin permission, and access your cluster.

  2. Click Gatekeeper > 约束模板 in the left navigation pane.

  3. Click Create on the page.

  4. 创建约束模板对话框,设置约束模板的名称和目标(Targets),然后点击确定

    参数 描述

    CRD 名称

    约束模板对应的 CRD 名称。

    Targets

    Targets 是约束的目标对象,即需要应用约束规则的资源对象。Targets 可以是 Kubernetes 集群中的各种资源,如 Pod、Deployment、Namespace 等。约束将被应用于这些目标对象,以确保它们满足约束规则的要求。

    您将在约束模板页面查看已创建的约束模板。

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.

What’s on this Page