Documentation
¶
Index ¶
- type Controller
- type FamilyType
- type MetricType
- type Options
- type ResolverType
- type StoreType
- func (s *StoreType) Add(objectI interface{}) error
- func (s *StoreType) Delete(objectI interface{}) error
- func (s *StoreType) Get(_ interface{}) (interface{}, bool, error)
- func (s *StoreType) GetByKey(_ string) (interface{}, bool, error)
- func (s *StoreType) List() []interface{}
- func (s *StoreType) ListKeys() []string
- func (s *StoreType) Replace(_ []interface{}, _ string) error
- func (s *StoreType) Resync() error
- func (s *StoreType) Update(objectI interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the controller implementation for managed resources.
func NewController ¶
func NewController( ctx context.Context, options *Options, kubeClientset kubernetes.Interface, crdmetricsClientset clientset.Interface, dynamicClientset dynamic.Interface, ) *Controller
NewController returns a new sample controller.
type FamilyType ¶
type FamilyType struct {
// Name is the Name of the metric family.
Name string `yaml:"name"`
// Help is the Help text for the metric family.
Help string `yaml:"help"`
// Metrics is a slice of Metrics that belong to the MetricType family.
Metrics []*MetricType `yaml:"metrics"`
// Resolver is the resolver to use to evaluate the labelset expressions.
Resolver ResolverType `yaml:"resolver"`
// LabelKeys is the set of inherited or defined label keys.
LabelKeys []string `yaml:"labelKeys,omitempty"`
// LabelValues is the set of inherited or defined label values.
LabelValues []string `yaml:"labelValues,omitempty"`
// contains filtered or unexported fields
}
FamilyType represents a metric family (a group of metrics with the same name).
type MetricType ¶
type MetricType struct {
// LabelKeys is the set of label keys.
LabelKeys []string `yaml:"labelKeys"`
// LabelValues is the set of label values.
LabelValues []string `yaml:"labelValues"`
// Value is the metric Value.
Value string `yaml:"value"`
// Resolver is the resolver to use to evaluate the labelset expressions.
Resolver ResolverType `yaml:"resolver"`
}
MetricType represents a single time series.
type Options ¶
type Options struct {
AutoGOMAXPROCS *bool
RatioGOMEMLIMIT *float64
Kubeconfig *string
MasterURL *string
SelfHost *string
SelfPort *int
MainHost *string
MainPort *int
TryNoCache *bool
Workers *int
Version *bool
// contains filtered or unexported fields
}
Options represents the command-line Options.
type ResolverType ¶
type ResolverType string
ResolverType represents the type of resolver to use to evaluate the labelset expressions.
const ( // ResolverTypeCEL represents the CEL resolver. ResolverTypeCEL ResolverType = "cel" // ResolverTypeUnstructured represents the Unstructured resolver. ResolverTypeUnstructured ResolverType = "unstructured" // ResolverTypeNone represents an empty resolver. ResolverTypeNone ResolverType = "" )
type StoreType ¶
type StoreType struct {
// Group is the API group of the custom resource.
Group string `yaml:"g"`
// Version is the API version of the custom resource.
Version string `yaml:"v"`
// Kind is the type of the custom resource.
Kind string `yaml:"k"`
// ResourceName is the name (plural) of the custom resource, in lowercase.
ResourceName string `yaml:"r"`
// Selectors is the selectors to use to filter the objects.
Selectors struct {
Label string `yaml:"label,omitempty"`
Field string `yaml:"field,omitempty"`
} `yaml:"selectors,omitempty"`
// Families is a slice of metric families.
Families []*FamilyType `yaml:"families"`
// Resolver is the resolver to use to evaluate expressions.
Resolver ResolverType `yaml:"resolver"`
// LabelKeys is a slice of label keys.
LabelKeys []string `yaml:"labelKeys,omitempty"`
// LabelValues is a slice of label values.
LabelValues []string `yaml:"labelValues,omitempty"`
// contains filtered or unexported fields
}
StoreType implements the k8s.io/client-go/tools/cache.StoreType interface. The cache.Reflector uses the cache.StoreType to operate on the store.metrics map with the various metric families and their metrics based on the associated object's events.
func (*StoreType) Delete ¶
Delete deletes the given object from the accumulator associated with its key.
func (*StoreType) List ¶
func (s *StoreType) List() []interface{}
List returns a list of all the currently non-empty accumulators.
func (*StoreType) ListKeys ¶
ListKeys returns a list of all the keys of the currently non-empty accumulators.
func (*StoreType) Replace ¶
Replace will delete the contents of the store, using instead the given list. store takes ownership of the list, you should not reference it after calling this function. NOTE: cache.Reflector starts off with Replace followed by Add rather than just Add, and as such this is skipped to avoid building stores twice.