controller

package
v0.0.0-...-1518e46 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

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"
)
View Source
const (
	AppsAPIVersion        string = "apps/v1"
	AutoscalingAPIVersion string = "autoscaling/v2beta2"

	Deployment              string = "Deployment"
	StatefulSet             string = "StatefulSet"
	HorizontalPodAutoscaler string = "HorizontalPodAutoscaler"
)

Variables

Functions

func CreateHorizontalPodAutoscaler

func CreateHorizontalPodAutoscaler(
	name string,
	namespace string,
	uid types.UID,
	apiVersion string,
	kind string,
	annotations map[string]string) (*autoscalingv2.HorizontalPodAutoscaler, error)

func IsOwnerReference

func IsOwnerReference(uid types.UID, ownerReferences []metav1.OwnerReference) bool

func ManageByPixiuController

func ManageByPixiuController(hpa *autoscalingv2.HorizontalPodAutoscaler) bool

func NewItems

func NewItems() map[string]Empty

Types

type AutoscalerContext

type AutoscalerContext struct {
	Name        string            `json:"name"`
	Namespace   string            `json:"namespace"`
	APIVersion  string            `json:"api_version"`
	Kind        string            `json:"kind"`
	UID         types.UID         `json:"uid"`
	Annotations map[string]string `json:"annotations"`
}

AutoscalerContext is responsible for kubernetes resources stored.

type ControllerClientBuilder

type ControllerClientBuilder interface {
	Config(name string) (*restclient.Config, error)
	ConfigOrDie(name string) *restclient.Config
	Client(name string) (clientset.Interface, error)
	ClientOrDie(name string) clientset.Interface
}

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 Event

type Event string
const (
	Add    Event = "add"
	Update Event = "update"
	Delete Event = "delete"
)

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 PixiuHpaSpec

type PixiuHpaSpec struct {
	Event Event
	Hpa   *autoscalingv2.HorizontalPodAutoscaler
}

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 (SimpleControllerClientBuilder) ClientOrDie

func (SimpleControllerClientBuilder) Config

func (SimpleControllerClientBuilder) ConfigOrDie

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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