Documentation ¶
Index ¶
Constants ¶
const EndpointSliceSubsystem = "endpoint_slice_controller"
EndpointSliceSubsystem - subsystem name used for Endpoint Slices.
Variables ¶
var ( // EndpointsAddedPerSync tracks the number of endpoints added on each // Service sync. EndpointsAddedPerSync = metrics.NewHistogramVec( &metrics.HistogramOpts{ Subsystem: EndpointSliceSubsystem, Name: "endpoints_added_per_sync", Help: "Number of endpoints added on each Service sync", StabilityLevel: metrics.ALPHA, Buckets: metrics.ExponentialBuckets(2, 2, 15), }, []string{}, ) // EndpointsRemovedPerSync tracks the number of endpoints removed on each // Service sync. EndpointsRemovedPerSync = metrics.NewHistogramVec( &metrics.HistogramOpts{ Subsystem: EndpointSliceSubsystem, Name: "endpoints_removed_per_sync", Help: "Number of endpoints removed on each Service sync", StabilityLevel: metrics.ALPHA, Buckets: metrics.ExponentialBuckets(2, 2, 15), }, []string{}, ) // EndpointsDesired tracks the total number of desired endpoints. EndpointsDesired = metrics.NewGaugeVec( &metrics.GaugeOpts{ Subsystem: EndpointSliceSubsystem, Name: "endpoints_desired", Help: "Number of endpoints desired", StabilityLevel: metrics.ALPHA, }, []string{}, ) // NumEndpointSlices tracks the number of EndpointSlices in a cluster. NumEndpointSlices = metrics.NewGaugeVec( &metrics.GaugeOpts{ Subsystem: EndpointSliceSubsystem, Name: "num_endpoint_slices", Help: "Number of EndpointSlices", StabilityLevel: metrics.ALPHA, }, []string{}, ) // DesiredEndpointSlices tracks the number of EndpointSlices that would // exist with perfect endpoint allocation. DesiredEndpointSlices = metrics.NewGaugeVec( &metrics.GaugeOpts{ Subsystem: EndpointSliceSubsystem, Name: "desired_endpoint_slices", Help: "Number of EndpointSlices that would exist with perfect endpoint allocation", StabilityLevel: metrics.ALPHA, }, []string{}, ) // EndpointSliceChanges tracks the number of changes to Endpoint Slices. EndpointSliceChanges = metrics.NewCounterVec( &metrics.CounterOpts{ Subsystem: EndpointSliceSubsystem, Name: "changes", Help: "Number of EndpointSlice changes", StabilityLevel: metrics.ALPHA, }, []string{"operation"}, ) // EndpointSlicesChangedPerSync observes the number of EndpointSlices // changed per sync. EndpointSlicesChangedPerSync = metrics.NewHistogramVec( &metrics.HistogramOpts{ Subsystem: EndpointSliceSubsystem, Name: "endpointslices_changed_per_sync", Help: "Number of EndpointSlices changed on each Service sync", }, []string{ "topology", "traffic_distribution", }, ) // EndpointSliceSyncs tracks the number of sync operations the controller // runs along with their result. EndpointSliceSyncs = metrics.NewCounterVec( &metrics.CounterOpts{ Subsystem: EndpointSliceSubsystem, Name: "syncs", Help: "Number of EndpointSlice syncs", StabilityLevel: metrics.ALPHA, }, []string{"result"}, ) // ServicesCountByTrafficDistribution tracks the number of Services using some // specific trafficDistribution ServicesCountByTrafficDistribution = metrics.NewGaugeVec( &metrics.GaugeOpts{ Subsystem: EndpointSliceSubsystem, Name: "services_count_by_traffic_distribution", Help: "Number of Services using some specific trafficDistribution", StabilityLevel: metrics.ALPHA, }, []string{"traffic_distribution"}, ) )
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache tracks values for total numbers of desired endpoints as well as the efficiency of EndpointSlice endpoints distribution.
func (*Cache) DeleteService ¶
func (c *Cache) DeleteService(serviceNN types.NamespacedName)
DeleteService removes references of a Service from the global cache and updates the corresponding metrics.
func (*Cache) UpdateServicePortCache ¶
func (c *Cache) UpdateServicePortCache(serviceNN types.NamespacedName, spCache *ServicePortCache)
UpdateServicePortCache updates a ServicePortCache in the global cache for a given Service and updates the corresponding metrics. Parameters: * serviceNN refers to a NamespacedName representing the Service. * spCache refers to a ServicePortCache for the specified Service.
func (*Cache) UpdateTrafficDistributionForService ¶ added in v0.30.0
func (c *Cache) UpdateTrafficDistributionForService(serviceNN types.NamespacedName, trafficDistributionPtr *string)
type EfficiencyInfo ¶
EfficiencyInfo stores the number of Endpoints and Slices for calculating total numbers of desired endpoints and the efficiency of EndpointSlice endpoints distribution.
type ServicePortCache ¶
type ServicePortCache struct {
// contains filtered or unexported fields
}
ServicePortCache tracks values for total numbers of desired endpoints as well as the efficiency of EndpointSlice endpoints distribution for each unique Service Port combination.
func NewServicePortCache ¶
func NewServicePortCache() *ServicePortCache
NewServicePortCache initializes and returns a new ServicePortCache.
func (*ServicePortCache) Set ¶
func (spc *ServicePortCache) Set(pmKey endpointsliceutil.PortMapKey, eInfo EfficiencyInfo)
Set updates the ServicePortCache to contain the provided EfficiencyInfo for the provided PortMapKey.