k8smonitor

package
v0.0.0-...-6cfc1b2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ResyncPeriod = 1 * time.Minute

Variables

This section is empty.

Functions

func CreateK8sClientset

func CreateK8sClientset() (kubernetes.Interface, error)

func CreateLocalK8sClientset

func CreateLocalK8sClientset() (kubernetes.Interface, error)

Types

type IPNet

type IPNet struct {
	Network             *net.IPNet
	NetworkIdentifierIP net.IP
	BroadcastIP         net.IP
}

func CreateIPNet

func CreateIPNet(ipnet *net.IPNet) *IPNet

type Monitor

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

func CreateMonitor

func CreateMonitor(clientset kubernetes.Interface) (*Monitor, error)

func (*Monitor) IsInternalCIDR

func (m *Monitor) IsInternalCIDR(ip string) bool

func (*Monitor) Start

func (m *Monitor) Start()

func (*Monitor) Stop

func (m *Monitor) Stop()

type NodeMonitor

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

func CreateNodeMonitor

func CreateNodeMonitor(clientset kubernetes.Interface) (*NodeMonitor, error)

func (*NodeMonitor) IsPodCIDR

func (m *NodeMonitor) IsPodCIDR(ipStr string) bool

IsPodCIDR returns true if the given pod meeting the following conditions: 1. Included in one of the node's pod CIDRs 2. Not a broadcast IP (the last IP in the CIDR range) 3. Not a network identifier IP (the first IP in the CIDR range).

func (*NodeMonitor) Start

func (m *NodeMonitor) Start()

func (*NodeMonitor) Stop

func (m *NodeMonitor) Stop()

type ServiceMonitor

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

func CreateServiceMonitor

func CreateServiceMonitor(clientset kubernetes.Interface) (*ServiceMonitor, error)

func (*ServiceMonitor) IsServiceIP

func (m *ServiceMonitor) IsServiceIP(ipStr string) bool

func (*ServiceMonitor) Start

func (m *ServiceMonitor) Start()

func (*ServiceMonitor) Stop

func (m *ServiceMonitor) Stop()

Jump to

Keyboard shortcuts

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