apiserverk8s.io/apiserver/plugin/pkg/audit/buffered Index | Files

package buffered

import "k8s.io/apiserver/plugin/pkg/audit/buffered"

Package buffered provides an implementation for the audit.Backend interface that batches incoming audit events and sends batches to the delegate audit.Backend.

Index

Constants

const PluginName = "buffered"

PluginName is the name reported in error metrics.

Functions

func NewBackend

func NewBackend(delegate audit.Backend, config BatchConfig) audit.Backend

NewBackend returns a buffered audit backend that wraps delegate backend. Buffered backend automatically runs and shuts down the delegate backend.

Types

type BatchConfig

type BatchConfig struct {
	// BufferSize defines a size of the buffering queue.
	BufferSize int
	// MaxBatchSize defines maximum size of a batch.
	MaxBatchSize int
	// MaxBatchWait indicates the maximum interval between two batches.
	MaxBatchWait time.Duration

	// ThrottleEnable defines whether throttling will be applied to the batching process.
	ThrottleEnable bool
	// ThrottleQPS defines the allowed rate of batches per second sent to the delegate backend.
	ThrottleQPS float32
	// ThrottleBurst defines the maximum number of requests sent to the delegate backend at the same moment in case
	// the capacity defined by ThrottleQPS was not utilized.
	ThrottleBurst int

	// Whether the delegate backend should be called asynchronously.
	AsyncDelegate bool
}

BatchConfig represents batching delegate audit backend configuration.

Source Files

buffered.go doc.go

Version
v0.33.0 (latest)
Published
Apr 23, 2025
Platform
linux/amd64
Imports
8 packages
Last checked
11 minutes ago

Tools for package owners.