Skip to content

Add 'gator benchmark' command for policy performance evaluation #4286

@JaydipGabani

Description

@JaydipGabani

Describe the solution you'd like
A new gator subcommand to benchmark policy performance, similar to the benchmarking in Gatekeeper policy_benchmark_test.go. The goal is to provide policy authors and Gatekeeper users a way to measure the performance of their policies (constraints/templates), using a tool directly in the gator CLI.

Key requirements:

  • Allow selection of constraints, templates, and resources to benchmark
  • Ability to configure the number/scale of constraints and resources evaluated (similar to existing load array: [5, 10, 50, ...])
  • Flexible output: support plain text and JSON, suitable for CI or local use
  • Captures metrics such as validation time, memory usage, constraint evaluation counts, and potential other policy-related metrics

Anything else you would like to add:

  • Should be easily scriptable for local and CI workflows
  • Ideally produces Go benchmark-compatible output
  • Reference implementation: policy_benchmark_test.go
  • If possible, allow targeting multiple templates/constraints/types of resources
  • Useful for regression detection in policy performance

Environment:

  • Gatekeeper version: [please fill]
  • Kubernetes version: (use kubectl version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions