Documentation
¶
Index ¶
- func NewNamespacePredicate(namespace string) predicate.Predicate
- type ResourceManager
- func (rm *ResourceManager) DeleteNode(name string) error
- func (rm *ResourceManager) DrainPods(nodeName string, unhealthyAfter time.Duration) (finished bool, errs []error)
- func (rm *ResourceManager) GetDrainablePodsOnNode(nodeName string) (pods []v1.Pod, err error)
- func (rm *ResourceManager) GetNode(name string) (*v1.Node, error)
- func (rm *ResourceManager) GetPodsOnNode(nodeName string) (pods []v1.Pod, err error)
- func (rm *ResourceManager) ListNodes(selector labels.Selector) ([]v1.Node, error)
- func (rm *ResourceManager) LogEvent(obj runtime.Object, reason, messageFmt string, args ...interface{})
- func (rm *ResourceManager) LogWarningEvent(obj runtime.Object, reason, messageFmt string, args ...interface{})
- func (rm *ResourceManager) UpdateObject(obj client.Object) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNamespacePredicate ¶
NewNamespacePredicate returns a filtering predicate that will filter out events that do not belong to the provided namespace.
Types ¶
type ResourceManager ¶
type ResourceManager struct { Client client.Client RawClient kubernetes.Interface HttpClient *http.Client Recorder record.EventRecorder Logger logr.Logger Notifier notifications.Notifier CloudProvider cloudprovider.CloudProvider Namespace string }
ResourceManager is a struct which provides some consistency across controllers. It contains all of the common fields that controllers will need to use. It provides helpers that use the controller-runtime client.Client interface to interact with Kubernetes.
func NewResourceManager ¶
func NewResourceManager( client client.Client, rawClient kubernetes.Interface, httpClient *http.Client, recorder record.EventRecorder, logger logr.Logger, notifier notifications.Notifier, cloudProvider cloudprovider.CloudProvider, ) *ResourceManager
NewResourceManager creates a new ResourceManager
func (*ResourceManager) DeleteNode ¶
func (rm *ResourceManager) DeleteNode(name string) error
DeleteNode deletes a node from Kubernetes by name.
func (*ResourceManager) DrainPods ¶
func (rm *ResourceManager) DrainPods(nodeName string, unhealthyAfter time.Duration) (finished bool, errs []error)
DrainPods drains the pods off the named node.
func (*ResourceManager) GetDrainablePodsOnNode ¶
func (rm *ResourceManager) GetDrainablePodsOnNode(nodeName string) (pods []v1.Pod, err error)
GetDrainablePodsOnNode gets a list of pods on a named node that we can evict or delete from the node.
func (*ResourceManager) GetNode ¶
func (rm *ResourceManager) GetNode(name string) (*v1.Node, error)
GetNode gets a node object from Kubernetes by name.
func (*ResourceManager) GetPodsOnNode ¶
func (rm *ResourceManager) GetPodsOnNode(nodeName string) (pods []v1.Pod, err error)
GetPodsOnNode gets a list of the pods running on the given node, optionally filtered by the given label selector.
func (*ResourceManager) ListNodes ¶
ListNodes lists nodes from Kubernetes, optionally filtered by a selector.
func (*ResourceManager) LogEvent ¶
func (rm *ResourceManager) LogEvent(obj runtime.Object, reason, messageFmt string, args ...interface{})
LogEvent creates an event on the current object
func (*ResourceManager) LogWarningEvent ¶
func (rm *ResourceManager) LogWarningEvent(obj runtime.Object, reason, messageFmt string, args ...interface{})
LogWarningEvent creates a warning event on the current object
func (*ResourceManager) UpdateObject ¶
func (rm *ResourceManager) UpdateObject(obj client.Object) error
UpdateObject updates the given object in the API