百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
K

konstraint

> 云原生
开源

一个用于与 Gatekeeper 进行交互的策略管理工具

393 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个用于与 Gatekeeper 进行交互的策略管理工具

Konstraint

Konstraint is a CLI tool to assist with the creation and management of templates and constraints when using Gatekeeper.

Installation

go install github.com/plexsystems/konstraint@latest

A docker image is also provided for each release:

docker run -v $PWD:/konstraint ghcr.io/plexsystems/konstraint create /konstraint/examples

Usage

To create the Gatekeeper resources, use konstraint create .

To generate the accompanying documentation, use konstraint doc .

Both commands support the --output flag to specify where to save the output. For more detailed usage documentation, see the CLI Documentation.

Why this tool exists

Automatically copy Rego to the ConstraintTemplate

When writing policies for Gatekeeper, the Rego must be added to ConstraintTemplates in order for Gatekeeper to enforce the policy. This creates a scenario in which the Rego is written in a .rego file, and then copied into the ConstraintTemplate. When a change is needed to be made to the Rego, both instances must be updated.

Automatically update all ConstraintTemplates with library changes

Gatekeeper supports importing libraries into ConstraintTemplates with the libs field. If a change is required to the imported library, every template must be updated to include this new change.

Enable writing the same policies for Conftest and Gatekeeper

With Gatekeeper, policies are evaluated in the context of an AdmissionReview. This means that policies are typically written with a prefix of input.review.object.

With Conftest, policies are written against yaml files.

This creates a scenario where the policy needs to be written differently depending upon the context in which the policy is being evaluated in.

Kubernetes Libraries

In the examples/lib directory, there are multiple libraries that enable policies to be written for both Conftest and Gatekeeper.

You can include as little or as many of these libraries into your policies as desired.

Purpose

By first validating the Kubernetes manifests with Conftest on a local machine, we can catch manifests that would otherwise violate policy without needing to deploy to a cluster running Gatekeeper.

FAQ

Konstraint ran without error, but I don't see any new files.

This typically means no policies were found, or the policies did not have any violation[] rules, so they are not compatible with Gatekeeper.

For more information, see How Constraints are Created.

My ConstraintTemplates are missing the input parameters

Input parameters can be specified by using one or more @parameter tags in the comment header block. If you use input parameters, Konstraint will skip generating the Constraint resource for that policy.

For more information, see Using Input Parameters.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goconftestgatekeeperkubernetesopa

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类云原生
定价开源

> 相关工具

K
Kubernetes
容器编排事实标准
H
Helm
Kubernetes 包管理器
S
seaweedfs
SeaweedFS is a distributed storage system for object storage (S3), file systems, and Iceberg tables,