Skip to main content

Cluster Policy Details

< create overview | cluster policy create workflow

Cluster Policy Create Details

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

InstructionCLI Command
List all cluster policieswf get globalclusterpolicies
View a cluster policy's manifest in consolewf get globalclusterpolicies POLICYNAME -o yaml
Output a cluster policy's manifest to filewf get globalclusterpolicies POLICYNAME -o yaml > MYPOLICY.yaml
Apply a cluster policy's manifest from filewf 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:

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

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


  1. 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)

Create Cluster Policy - Details Section


Properties

FieldDescription
NameThe name of the cluster policy.
DescriptionA short description describing the purpose of the cluster policy.
TypeThe type of cluster policy.
Option(s):
- Kyverno


What comes next?