k8s

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NodeNameEnvKey = "NODE_NAME"
)

This const are environment variable of k8s pod

Variables

This section is empty.

Functions

func AddrInFamily

func AddrInFamily(addrType string, addr string) bool

Check address belongs to desired family

func GetMultusEndpoints

func GetMultusEndpoints(kubeClient clientset.Interface, svc *corev1.Service, netList []string, addrType string) ([]string, error)

func GetMultusNetworkName

func GetMultusNetworkName(ns, name string) string

func GetMultusNetworkStatus

func GetMultusNetworkStatus(ns, name string) (networkStatus, error)

func GetNodeAddr

func GetNodeAddr(node *v1.Node) (net.IP, error)

GetNodeAddr gets the available IP address of a Node. GetNodeAddr will first try to get the NodeInternalIP, then try to get the NodeExternalIP.

func GetNodeName

func GetNodeName() (string, error)

func GetServiceEndPoints added in v0.9.0

func GetServiceEndPoints(kubeClient clientset.Interface, name string, ns string, nodeMatchList []string) ([]net.IP, error)

func GetServiceLocalEndpoints

func GetServiceLocalEndpoints(kubeClient clientset.Interface, svc *corev1.Service, addrType string, nodeMatchList []string) ([]string, error)

GetServiceLocalEndpoints - Get HostIPs of pods belonging to the given service

func GetServicePodEndpoints added in v0.9.7

func GetServicePodEndpoints(kubeClient clientset.Interface, svc *corev1.Service, addrType string, nodeMatchList []string) ([]string, error)

GetServicePodEndpoints - Get PodIPs of pods belonging to the given service

func GetServicePortIntValue

func GetServicePortIntValue(kubeClient clientset.Interface, svc *corev1.Service, port corev1.ServicePort) (int, error)

func MatchNodeinNodeList added in v0.9.5

func MatchNodeinNodeList(node string, nodeMatchList []string) bool

func UnmarshalNetworkList added in v0.9.2

func UnmarshalNetworkList(ns string) ([]networkList, error)

func UnmarshalNetworkStatus

func UnmarshalNetworkStatus(ns string) ([]networkStatus, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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