Git Access and Policy History
See whether Nirmata Control Hub can reach the GitLab repository of a Policy Set, which commit last changed each policy, whether that change is deployed, and the commit history of each policy.
Policy Sets are a collection of individual policies that allow a set of configuration standards to be applied to various objects within the Kubernetes clusters.
To create a new Policy Set:

Click on the Add Policy Set button located on the top right-hand corner of the page.
Nirmata provides curated policy sets for Pod Security Standards and RBAC Best Practices. Nirmata manages these policies and upgrades them as necessary. The policies can be found in the kyverno-policies repository.
It is not mandatory to use Nirmata’s curated policy sets. Create a custom policy set by clicking on Add Custom Policy Set. This option provides more control over the lifecycle of the underlying policies.
The page displays two options to create a policy set:
a. Git (recommended) - Select this option to create a Policy Set from an existing Git repository.
b. YAML - Select this option to create a Policy Set by uploading YAML files directly.

To create a Git Policy Set, click on the Git option. The Policy Set form is displayed. In that form:
Sync Interval (seconds) field. If not specified, the default sync interval will be 300 seconds.Default Policy Set checkbox if you want to make this policy set as a default whenever future clusters are onboarded.Auto Deploy Changes checkbox if you want the changes in Git to automatically sync to the clusters.Cluster Selector field by adding Match Labels and Match Expressions in the form of key-value pairs.key and value sections.Add item to add multiple Match Labels.key and value sections and specifying the operator within the operator section from the drop-down list. The available operator options are In, Not In, Exists, and Does Not Exist. Multiple values for Match Expressions must be comma-separated (e.g., “value1, value2”).Add Selector to add multiple Match Expressions.Note: In the case of multiple selectors being specified, all the cluster selectors must be satisfied for the Policy Set to be deployed to the cluster.
Private repository checkbox. The K8s secrets form will be displayed. In that form:namespace, secret, and token key.NOTE: Create a Kubernetes secret in the provided namespace containing Git credentials. This allows the Operator to connect to your private Git repo to fetch the policies.
Policies, Kustomize, and HelmChart.HelmChart is selected, an additional form will be displayed to specify the Helm Customizations in the form of key-value pair.key and value section.Add item to add multiple customizations.
To create a YAML Policy Set:
Note: If Create fails with an error such as
'<name>' is already used by a legacy <type> policy group (id ..., created ...) that is not shown on the Policy Sets page(where<type>isgitoruntyped), an older policy group holds that name. It appears on the Policy Sets page with a Legacy badge. Delete it from there, or choose a different name. The Also delete from clusters checkbox is unchecked by default, so deleting the legacy group does not remove policies already deployed to clusters.



To view a newly created Policy Set:

+ button available within the cards. Alternatively, clicking on the Add Cluster button on the top right corner will do the same for adding clusters in the Policy Set.For Git Policy Sets whose repository is on GitLab (gitlab.com or self-hosted) and whose repository type is Policies, Nirmata Control Hub reads the repository directly and can open merge requests in it:
These features use a Git provider account for the GitLab host. See Add a Git provider account.
In addition to specifying matching cluster labels and expressions for the policy sets, you can also directly choose the clusters to deploy policy sets.
Add Cluster and select one or more clusters from the list.Deployed Policies tab. All the deployed policies along with their Status will be shown. For Git Policy Sets on GitLab, the Last Changed column shows the commit that last changed each policy and whether that change is deployed (Deployed in <sha>) or not yet (Not yet deployed).kubectl to view policies on the command line.kubectl get policyset -A
kubectl get cpol
See whether Nirmata Control Hub can reach the GitLab repository of a Policy Set, which commit last changed each policy, whether that change is deployed, and the commit history of each policy.
Edit a policy of a GitLab-backed Policy Set in Nirmata Control Hub, run its Kyverno tests, open a merge request, follow it on the Changes tab until it is deployed, and delete a policy through a merge request.
Let a team own a Policy Set that deploys only namespace-scoped policies into namespaces the team can access, from a GitLab source an admin approved.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.