Cluster Policy Details
< create overview | cluster policy create workflow
Overview
- Identification and Description: Provide clear names to help your team understand the policy's purpose and configuration.
- Type: Implement policies using Kyverno, which validates, mutates, and generates Kubernetes resources based on custom rules.
📚 For more details on key points, refer to the overview section.
📚 Explore the properties section for additional information on each UI property.
CLI Instructions
CLI Commands - Quick Reference
Instruction | CLI Command |
---|---|
List all cluster policies | wf get globalclusterpolicies |
View a cluster policy's manifest in console | wf get globalclusterpolicies POLICYNAME -o yaml |
Output a cluster policy's manifest to file | wf get globalclusterpolicies POLICYNAME -o yaml > MYPOLICY.yaml |
Apply a cluster policy's manifest from file | wf apply -f MYPOLICY.yaml |
Create a new cluster policy
The best way to create a new cluster policy is to copy an existing one.
Follow these steps:
- Check which cluster policies already exist using the
wf get globalclusterpolicies
command.
wf get globalclusterpolicies
NAME STATUS AGE
flux.default.global Success 535d
limitranges.default.global Success 535d
networkpolicy.certmanagerhttp Success 286d
networkpolicy.default.global Success 535d
pvc.storageclass.global Success 535d
service.nodeport.global Success 535d
- Get the yaml from an existing policy:
wf get globalclusterpolicies flux.default.global -o yaml > MYPOLICY.yaml
This copies the the flux.default.global
cluster policy and places it in a file MYPOLICY.yaml
.
- Edit the policy section of the file as needed, being sure to change the metadata name to a new name, to indicate that you wish to make a new cluster policy. Thereafter, apply the file:
wf apply -f MYPOLICY.yaml
Web Interface Instructions
Note that Wayfinder's User Interface has several sections you need to follow in order to create a new cluster policy. Below only outlines the Details section.
Steps
- Expand Admin, and then navigate to Policy > Cluster
- Click the +Cluster policy button
- Fill in the details as outlined in the properties section.
- Click Continue to proceed
Screenshot(s)
Properties
Field | Description |
---|---|
Name | The name of the cluster policy. |
Description | A short description describing the purpose of the cluster policy. |
Type | The type of cluster policy. Option(s): - Kyverno |