k8s

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 21 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 CreateClients

CreateClients creates kube clients from the given config.

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) ([]net.IP, error)

func GetServiceLocalEndpoints

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

GetServiceLocalEndpoints - Get HostIPs of pods belonging to the given service

func GetServicePortIntValue

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

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