kubernetes

package
v0.0.0-...-7c47631 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeploymentEventHandler

type DeploymentEventHandler interface {
	DeploymentValid(deployment *DeploymentInfo) bool
	DeploymentAdded(deployment *DeploymentInfo)
	DeploymentDeleted(deployment *DeploymentInfo)
	DeploymentUpdated(oldDeployment, newDeployment *DeploymentInfo)
}

type DeploymentInfo

type DeploymentInfo struct {
	Labels      map[string]string
	Ports       []uint32
	HostNetwork bool
	// contains filtered or unexported fields
}

func NewDeploymentInfo

func NewDeploymentInfo(obj interface{}) *DeploymentInfo

func (*DeploymentInfo) GetSelector

func (deployment *DeploymentInfo) GetSelector() map[string]string

func (*DeploymentInfo) Name

func (deployment *DeploymentInfo) Name() string

func (*DeploymentInfo) Namespace

func (deployment *DeploymentInfo) Namespace() string

func (*DeploymentInfo) String

func (deployment *DeploymentInfo) String() string

func (*DeploymentInfo) Type

func (deployment *DeploymentInfo) Type() ResourceType

type K8sResourceManager

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

func NewK8sResourceManager

func NewK8sResourceManager() (*K8sResourceManager, error)

func (*K8sResourceManager) DeploymentAdded

func (manager *K8sResourceManager) DeploymentAdded(deployment *DeploymentInfo)

func (*K8sResourceManager) DeploymentDeleted

func (manager *K8sResourceManager) DeploymentDeleted(deployment *DeploymentInfo)

func (*K8sResourceManager) DeploymentUpdated

func (manager *K8sResourceManager) DeploymentUpdated(oldDeployment, newDeployment *DeploymentInfo)

func (*K8sResourceManager) DeploymentValid

func (manager *K8sResourceManager) DeploymentValid(deployment *DeploymentInfo) bool

func (*K8sResourceManager) GetK8sIP

func (manager *K8sResourceManager) GetK8sIP() string

func (*K8sResourceManager) GetMatchedResources

func (manager *K8sResourceManager) GetMatchedResources(resource ResourceInfoPointer, matchType ResourceType) []ResourceInfoPointer

func (*K8sResourceManager) GetPodDeployment

func (manager *K8sResourceManager) GetPodDeployment(pod *PodInfo) *DeploymentInfo

func (*K8sResourceManager) GetPodFromIp

func (manager *K8sResourceManager) GetPodFromIp(ip string) *PodInfo

func (*K8sResourceManager) GetPodIpInThisNode

func (manager *K8sResourceManager) GetPodIpInThisNode() string

func (*K8sResourceManager) GetPodsForService

func (manager *K8sResourceManager) GetPodsForService(service *ServiceInfo) []*PodInfo

func (*K8sResourceManager) GetServiceFromClusterIp

func (manager *K8sResourceManager) GetServiceFromClusterIp(ip string) *ServiceInfo

func (*K8sResourceManager) IsLocked

func (manager *K8sResourceManager) IsLocked() bool

func (*K8sResourceManager) Lock

func (manager *K8sResourceManager) Lock()

func (*K8sResourceManager) NewCond

func (manager *K8sResourceManager) NewCond() *sync.Cond

func (*K8sResourceManager) PodAdded

func (manager *K8sResourceManager) PodAdded(info *PodInfo)

func (*K8sResourceManager) PodDeleted

func (manager *K8sResourceManager) PodDeleted(info *PodInfo)

func (*K8sResourceManager) PodUpdated

func (manager *K8sResourceManager) PodUpdated(oldPod, newPod *PodInfo)

func (*K8sResourceManager) PodValid

func (manager *K8sResourceManager) PodValid(info *PodInfo) bool

func (*K8sResourceManager) ServiceAdded

func (manager *K8sResourceManager) ServiceAdded(info *ServiceInfo)

func (*K8sResourceManager) ServiceDeleted

func (manager *K8sResourceManager) ServiceDeleted(info *ServiceInfo)

func (*K8sResourceManager) ServiceUpdated

func (manager *K8sResourceManager) ServiceUpdated(oldService, newService *ServiceInfo)

func (*K8sResourceManager) ServiceValid

func (manager *K8sResourceManager) ServiceValid(info *ServiceInfo) bool

func (*K8sResourceManager) Unlock

func (manager *K8sResourceManager) Unlock()

func (*K8sResourceManager) WatchDaemonSets

func (manager *K8sResourceManager) WatchDaemonSets(stopper chan struct{}, handlers ...DeploymentEventHandler)

func (*K8sResourceManager) WatchDeployments

func (manager *K8sResourceManager) WatchDeployments(stopper chan struct{}, handlers ...DeploymentEventHandler)

func (*K8sResourceManager) WatchPods

func (manager *K8sResourceManager) WatchPods(stopper chan struct{}, handlers ...PodEventHandler)

func (*K8sResourceManager) WatchServices

func (manager *K8sResourceManager) WatchServices(stopper chan struct{}, handlers ...ServiceEventHandler)

func (*K8sResourceManager) WatchStatefulSets

func (manager *K8sResourceManager) WatchStatefulSets(stopper chan struct{}, handlers ...DeploymentEventHandler)

type PodEventHandler

type PodEventHandler interface {
	PodValid(pod *PodInfo) bool
	PodAdded(pod *PodInfo)
	PodDeleted(pod *PodInfo)
	PodUpdated(oldPod, newPod *PodInfo)
}

type PodInfo

type PodInfo struct {
	ResourceVersion string

	PodIP       string
	HostIP      string
	HostNetwork bool
	Labels      map[string]string
	// contains filtered or unexported fields
}

func NewPodInfo

func NewPodInfo(pod *v1.Pod) *PodInfo

func (*PodInfo) GetSelector

func (pod *PodInfo) GetSelector() map[string]string

func (*PodInfo) IsSkip

func (pod *PodInfo) IsSkip() bool

func (*PodInfo) Name

func (pod *PodInfo) Name() string

func (*PodInfo) Namespace

func (pod *PodInfo) Namespace() string

func (*PodInfo) String

func (pod *PodInfo) String() string

func (*PodInfo) Type

func (pod *PodInfo) Type() ResourceType

type ResourceInfoPointer

type ResourceInfoPointer interface {
	GetSelector() map[string]string
	Namespace() string
	Name() string
	Type() ResourceType
	String() string
}

type ResourceType

type ResourceType int
const (
	SERVICE_TYPE    ResourceType = 1
	DEPLOYMENT_TYPE ResourceType = 2
	POD_TYPE        ResourceType = 3
)

func (ResourceType) String

func (e ResourceType) String() string

type ResourcesOnLabel

type ResourcesOnLabel map[ResourceType][]ResourceInfoPointer

type ServiceEventHandler

type ServiceEventHandler interface {
	ServiceValid(info *ServiceInfo) bool
	ServiceAdded(svc *ServiceInfo)
	ServiceDeleted(svc *ServiceInfo)
	ServiceUpdated(oldService, newService *ServiceInfo)
}

type ServiceInfo

type ServiceInfo struct {
	ResourceVersion string

	ClusterIP string

	Ports []*ServicePortInfo
	// contains filtered or unexported fields
}

func NewServiceInfo

func NewServiceInfo(service *v1.Service) *ServiceInfo

func (*ServiceInfo) GetSelector

func (service *ServiceInfo) GetSelector() map[string]string

func (*ServiceInfo) IsKubeAPIService

func (service *ServiceInfo) IsKubeAPIService() bool

func (*ServiceInfo) Name

func (service *ServiceInfo) Name() string

func (*ServiceInfo) Namespace

func (service *ServiceInfo) Namespace() string

func (*ServiceInfo) String

func (service *ServiceInfo) String() string

func (*ServiceInfo) Type

func (service *ServiceInfo) Type() ResourceType

type ServicePortInfo

type ServicePortInfo struct {
	Port       uint32
	TargetPort uint32
	Name       string
}

Jump to

Keyboard shortcuts

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