apiserver

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallOpenAPIV2

func InstallOpenAPIV2(container *restful.Container, webServices []*restful.WebService) (*handler.OpenAPIService, *spec.Swagger, error)

InstallOpenAPIV2 adds the SwaggerUI webservice to the given mux.

func InstallOpenAPIV3

func InstallOpenAPIV3(container *restful.Container, webServices []*restful.WebService) (*handler3.OpenAPIService, error)

InstallOpenAPIV3 adds the static group/versions defined in the RegisteredWebServices to the OpenAPI v3 spec

func InstallRootAPIs

func InstallRootAPIs(container *restful.Container) discovery.GroupManager

InstallRootAPIs installs the root APIs for the apiserver.

Types

type CustomMetricsProvider

type CustomMetricsProvider struct {
	// contains filtered or unexported fields
}

CustomMetricsProvider is an implementation of provider.CustomMetricsProvider

func NewCustomMetricsProvider

func NewCustomMetricsProvider(conf CustomMetricsProviderConfig) *CustomMetricsProvider

NewCustomMetricsProvider creates a new CustomMetricsProvider

func (*CustomMetricsProvider) GetMetricByName

GetMetricByName returns the value of a single metric for a single object

func (*CustomMetricsProvider) GetMetricBySelector

func (p *CustomMetricsProvider) GetMetricBySelector(ctx context.Context, namespace string, selector labels.Selector, info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValueList, error)

GetMetricBySelector returns the value of a metric for all objects which match a resource selector

func (*CustomMetricsProvider) Install

func (p *CustomMetricsProvider) Install(container *restful.Container, discoveryGroupManager discovery.GroupManager) error

Install installs the custom metrics API for the server.

func (*CustomMetricsProvider) ListAllMetrics

func (p *CustomMetricsProvider) ListAllMetrics() []provider.CustomMetricInfo

ListAllMetrics returns the list of all metrics provided by this API

type CustomMetricsProviderConfig

type CustomMetricsProviderConfig struct {
	DynamicClient dynamic.Interface
	RESTMapper    apimeta.RESTMapper
	CustomMetric  Store[*v1alpha1.CustomMetric]
}

CustomMetricsProviderConfig is a configuration struct for CustomMetricsProvider

type ExternalMetricProviderConfig

type ExternalMetricProviderConfig struct {
	ExternalMetric Store[*v1alpha1.ExternalMetric]
}

ExternalMetricProviderConfig is a configuration struct for ExternalMetricProvider

type ExternalMetricsProvider

type ExternalMetricsProvider struct {
	// contains filtered or unexported fields
}

ExternalMetricsProvider is an implementation of provider.ExternalMetricsProvider

func NewExternalMetricsProvider

func NewExternalMetricsProvider(conf ExternalMetricProviderConfig) *ExternalMetricsProvider

NewExternalMetricsProvider returns a new ExternalMetricsProvider

func (*ExternalMetricsProvider) GetExternalMetric

GetExternalMetric returns the external metric value for the given metric name and selector

func (*ExternalMetricsProvider) Install

func (p *ExternalMetricsProvider) Install(container *restful.Container, discoveryGroupManager discovery.GroupManager) error

Install registers the external metrics API and handlers

func (*ExternalMetricsProvider) ListAllExternalMetrics

func (p *ExternalMetricsProvider) ListAllExternalMetrics() []provider.ExternalMetricInfo

ListAllExternalMetrics returns the list of all external metrics

type Store

type Store[T any] interface {

	// List returns a list of all the currently non-empty accumulators
	List() []T

	// ListKeys returns a list of all the keys currently associated with non-empty accumulators
	ListKeys() []string

	// GetByKey returns the accumulator associated with the given key
	GetByKey(key string) (item T, exists bool, err error)

	// Resync is meaningless in the terms appearing here but has
	// meaning in some implementations that have non-trivial
	// additional behavior (e.g., DeltaFIFO).
	Resync() error
}

func NewStore

func NewStore[T any](store cache.Store) Store[T]

Jump to

Keyboard shortcuts

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