watcher

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher implements WatcherInterface.

func NewWatcher

func NewWatcher(cluster string, clientset kubernetes.Interface) (*Watcher, error)

NewWatcher creates a new Watcher and checks that it has connectivity to the cluster API.

func (*Watcher) GetNodeByInternalIP

func (watcher *Watcher) GetNodeByInternalIP(ip string) (*corev1.Node, error)

GetNodeByInternalIP takes an IP and finds the node which is represented with the IP. err is nil if there is no such node.

func (*Watcher) GetNodeByName

func (watcher *Watcher) GetNodeByName(name string) (*corev1.Node, error)

GetNodeByName takes a name and finds the node with that name. err is nil if there is no such node.

func (*Watcher) GetPodsByIP

func (watcher *Watcher) GetPodsByIP(ip string) ([]*corev1.Pod, error)

GetPodsByIP takes an IP and finds pods on that IP. err is nil if there are no such pods.

func (*Watcher) GetServiceByClusterIP

func (watcher *Watcher) GetServiceByClusterIP(ip string) (*corev1.Service, error)

GetServiceByClusterIP takes an IP and finds the service on the IP. err is nil if there is no such service.

type WatcherInterface

type WatcherInterface interface {
	GetPodsByIP(ip string) ([]*corev1.Pod, error)
	GetNodeByInternalIP(ip string) (*corev1.Node, error)
	GetNodeByName(name string) (*corev1.Node, error)
	GetServiceByClusterIP(ip string) (*corev1.Service, error)
}

WatcherInterface watches Kubernetes cluster for update.

Directories

Path Synopsis
Package mock_watcher is a generated GoMock package.
Package mock_watcher is a generated GoMock package.

Jump to

Keyboard shortcuts

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