Documentation ¶
Index ¶
- Constants
- Variables
- func CreateHPAFromDeployment(d *appsv1.Deployment) (*autoscalingv2.HorizontalPodAutoscaler, error)
- func IsOwnerReference(uid types.UID, ownerReferences []metav1.OwnerReference) bool
- func ManageByPixiuController(hpa *autoscalingv2.HorizontalPodAutoscaler) bool
- func NewItems() map[string]Empty
- type ControllerClientBuilder
- type Empty
- type ExternalRule
- type InformerFactory
- type PrometheusAdapterConfig
- type ResourceMap
- type ResourceOverride
- type Rule
- type RuleName
- type SimpleControllerClientBuilder
- func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
- func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
- func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
- func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
Constants ¶
View Source
const ( PixiuManager string = "kubez-autoscaler-controller" PixiuMain string = "main" // Just for local test PixiuRootPrefix string = "hpa.caoyingjunz.io" PixiuSeparator string = "/" PixiuDot string = "." MinReplicas string = "hpa.caoyingjunz.io/minReplicas" MaxReplicas string = "hpa.caoyingjunz.io/maxReplicas" // PrometheusCustomMetric 指标来自 prometheus 时,需要指定指标名称 PrometheusCustomMetric = PixiuRootPrefix + PixiuSeparator + "targetCustomMetric" )
View Source
const ( AppsAPIVersion string = "apps/v1" AutoscalingAPIVersion string = "autoscaling/v2" Deployment string = "Deployment" HorizontalPodAutoscaler string = "HorizontalPodAutoscaler" DesireConfigMapName string = "prometheus-adapter" NotifyAt string = PixiuRootPrefix + PixiuSeparator + "notifyAt" )
Variables ¶
View Source
var (
KeyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc
)
Functions ¶
func CreateHPAFromDeployment ¶
func CreateHPAFromDeployment(d *appsv1.Deployment) (*autoscalingv2.HorizontalPodAutoscaler, error)
func IsOwnerReference ¶
func IsOwnerReference(uid types.UID, ownerReferences []metav1.OwnerReference) bool
func ManageByPixiuController ¶
func ManageByPixiuController(hpa *autoscalingv2.HorizontalPodAutoscaler) bool
Types ¶
type ControllerClientBuilder ¶
type Empty ¶
type Empty struct{}
Empty is public since it is used by some internal API objects for conversions between external string arrays and internal sets, and conversion logic requires public types today.
type ExternalRule ¶
type ExternalRule struct { MetricsQuery string `yaml:"metricsQuery"` Name RuleName `yaml:"name"` Resources ResourceMap `yaml:"resources"` SeriesQuery string `yaml:"seriesQuery"` }
type InformerFactory ¶
type InformerFactory interface { ForResource(resource schema.GroupVersionResource) (informers.GenericInformer, error) Start(stopCh <-chan struct{}) }
InformerFactory creates informers for each group version resource.
func NewInformerFactory ¶
func NewInformerFactory(typedInformerFactory informers.SharedInformerFactory, metadataInformerFactory metadatainformer.SharedInformerFactory) InformerFactory
NewInformerFactory creates a new InformerFactory which works with both typed resources and metadata-only resources
type PrometheusAdapterConfig ¶
type PrometheusAdapterConfig struct { Rules []Rule `yaml:"rules"` ExternalRules []ExternalRule `yaml:"externalRules"` }
type ResourceMap ¶
type ResourceMap struct {
Overrides map[string]ResourceOverride `yaml:"overrides"`
}
type ResourceOverride ¶
type ResourceOverride struct {
Resource string `yaml:"resource"`
}
type Rule ¶
type Rule struct { MetricsQuery string `yaml:"metricsQuery"` Name RuleName `yaml:"name"` Resources ResourceMap `yaml:"resources"` SeriesQuery string `yaml:"seriesQuery"` }
type SimpleControllerClientBuilder ¶
type SimpleControllerClientBuilder struct { // ClientConfig is a skeleton config to clone and use as the basis for each controller client ClientConfig *restclient.Config }
SimpleControllerClientBuilder returns a fixed client with different user agents
func (SimpleControllerClientBuilder) Client ¶
func (b SimpleControllerClientBuilder) Client(name string) (clientset.Interface, error)
func (SimpleControllerClientBuilder) ClientOrDie ¶
func (b SimpleControllerClientBuilder) ClientOrDie(name string) clientset.Interface
func (SimpleControllerClientBuilder) Config ¶
func (b SimpleControllerClientBuilder) Config(name string) (*restclient.Config, error)
func (SimpleControllerClientBuilder) ConfigOrDie ¶
func (b SimpleControllerClientBuilder) ConfigOrDie(name string) *restclient.Config
Click to show internal directories.
Click to hide internal directories.