Documentation ¶
Index ¶
- Variables
- type ControllerFinder
- func (r *ControllerFinder) Finders() []PodControllerFinder
- func (r *ControllerFinder) GetExpectedScaleForPods(pods []*corev1.Pod) (int32, error)
- func (r *ControllerFinder) GetPodsForRef(apiVersion, kind, name, ns string, active bool) ([]*corev1.Pod, int32, error)
- func (r *ControllerFinder) GetScaleAndSelectorForRef(apiVersion, kind, ns, name string, uid types.UID) (*ScaleAndSelector, error)
- type ControllerReference
- type PodControllerFinder
- type ScaleAndSelector
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ControllerKindRS = apps.SchemeGroupVersion.WithKind("ReplicaSet") ControllerKindSS = apps.SchemeGroupVersion.WithKind("StatefulSet") ControllerKindRC = corev1.SchemeGroupVersion.WithKind("ReplicationController") ControllerKindDep = apps.SchemeGroupVersion.WithKind("Deployment") ControllerKruiseKindCS = appsv1alpha1.SchemeGroupVersion.WithKind("CloneSet") ControllerKruiseKindSS = appsv1beta1.SchemeGroupVersion.WithKind("StatefulSet") )
Functions ¶
This section is empty.
Types ¶
type ControllerFinder ¶
func NewControllerFinder ¶
func NewControllerFinder(c client.Client) *ControllerFinder
func (*ControllerFinder) Finders ¶
func (r *ControllerFinder) Finders() []PodControllerFinder
func (*ControllerFinder) GetExpectedScaleForPods ¶ added in v1.0.0
func (r *ControllerFinder) GetExpectedScaleForPods(pods []*corev1.Pod) (int32, error)
func (*ControllerFinder) GetPodsForRef ¶
func (r *ControllerFinder) GetPodsForRef(apiVersion, kind, name, ns string, active bool) ([]*corev1.Pod, int32, error)
GetPodsForRef return target workload's podList and spec.replicas.
func (*ControllerFinder) GetScaleAndSelectorForRef ¶
func (r *ControllerFinder) GetScaleAndSelectorForRef(apiVersion, kind, ns, name string, uid types.UID) (*ScaleAndSelector, error)
type ControllerReference ¶
type ControllerReference struct { // API version of the referent. APIVersion string `json:"apiVersion" protobuf:"bytes,5,opt,name=apiVersion"` // Kind of the referent. Kind string `json:"kind" protobuf:"bytes,1,opt,name=kind"` // Name of the referent. Name string `json:"name" protobuf:"bytes,3,opt,name=name"` // UID of the referent. UID types.UID `json:"uid" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` }
type PodControllerFinder ¶
type PodControllerFinder func(ref ControllerReference, namespace string) (*ScaleAndSelector, error)
PodControllerFinder is a function type that maps a pod to a list of controllers and their scale.
type ScaleAndSelector ¶
type ScaleAndSelector struct { ControllerReference // controller.spec.Replicas Scale int32 // controller.spec.Selector Selector *metav1.LabelSelector // metadata Metadata metav1.ObjectMeta }
ScaleAndSelector is used to return (controller, scale, selector) fields from the controller finder functions.
Click to show internal directories.
Click to hide internal directories.