etcd3

package
v0.32.0-alpha.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 41 Imported by: 71

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EtcdHealthCheck added in v0.16.4

func EtcdHealthCheck(data []byte) error

EtcdHealthCheck decodes data returned from etcd /healthz handler. Deprecated: Validate health by passing storagebackend.Config directly to storagefactory.CreateProber.

func New

func New(c *kubernetes.Client, codec runtime.Codec, newFunc, newListFunc func() runtime.Object, prefix, resourcePrefix string, groupResource schema.GroupResource, transformer value.Transformer, leaseManagerConfig LeaseManagerConfig, decoder Decoder, versioner storage.Versioner) storage.Interface

New returns an etcd3 implementation of storage.Interface.

func NewETCDLatencyTracker added in v0.24.0

func NewETCDLatencyTracker(delegate clientv3.KV) clientv3.KV

NewETCDLatencyTracker returns an implementation of clientv3.KV that times the calls from the specified 'delegate' KV instance in order to track latency incurred.

func StartCompactor

func StartCompactor(ctx context.Context, client *clientv3.Client, compactInterval time.Duration)

StartCompactor starts a compactor in the background to compact old version of keys that's not needed. By default, we save the most recent 5 minutes data and compact versions > 5minutes ago. It should be enough for slow watchers and to tolerate burst. TODO: We might keep a longer history (12h) in the future once storage API can take advantage of past version of keys.

func TestOnlySetFatalOnDecodeError

func TestOnlySetFatalOnDecodeError(b bool)

TestOnlySetFatalOnDecodeError should only be used for cases where decode errors are expected and need to be tested. e.g. conversion webhooks.

Types

type Decoder added in v0.32.0

type Decoder interface {
	// Decode decodes value of bytes into object. It will also
	// set the object resource version to rev.
	// On success, objPtr would be set to the object.
	Decode(value []byte, objPtr runtime.Object, rev int64) error

	// DecodeListItem decodes bytes value in array into object.
	DecodeListItem(ctx context.Context, data []byte, rev uint64, newItemFunc func() runtime.Object) (runtime.Object, error)
}

Decoder is used by the etcd storage implementation to decode transformed data from the storage into an object

func NewDefaultDecoder added in v0.32.0

func NewDefaultDecoder(codec runtime.Codec, versioner storage.Versioner) Decoder

NewDefaultDecoder returns the default decoder for etcd3 store

type LeaseManagerConfig added in v0.18.18

type LeaseManagerConfig struct {
	// ReuseDurationSeconds specifies time in seconds that each lease is reused
	ReuseDurationSeconds int64
	// MaxObjectCount specifies how many objects that a lease can attach
	MaxObjectCount int64
}

LeaseManagerConfig is configuration for creating a lease manager.

func NewDefaultLeaseManagerConfig added in v0.18.18

func NewDefaultLeaseManagerConfig() LeaseManagerConfig

NewDefaultLeaseManagerConfig creates a LeaseManagerConfig with default values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL