k8s

package
v1.11.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package k8s contains utilities for Antrea interactions with Kubernetes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClients

CreateClients creates kube clients from the given config.

func CreateNetworkAttachDefClient added in v1.5.0

func CreateNetworkAttachDefClient(config componentbaseconfig.ClientConnectionConfiguration, kubeAPIServerOverride string) (netdefclient.K8sCniCncfIoV1Interface, error)

CreateNetworkAttachDefClient creates net-attach-def client handle from the given config.

func GetNodeAddrs added in v1.3.0

func GetNodeAddrs(node *v1.Node) (*ip.DualStackIPs, error)

GetNodeAddrs gets the available IP addresses of a Node. GetNodeAddrs will first try to get the NodeInternalIP, then try to get the NodeExternalIP. If no error is returned, the returned DualStackIPs includes at least one IPv4 or IPv6 address.

func GetNodeAddrsFromAnnotations added in v1.6.0

func GetNodeAddrsFromAnnotations(node *v1.Node, annotationKey string) (*ip.DualStackIPs, error)

GetNodeAddrsFromAnnotations gets available IPs from the Node Annotation. The annotations are set by Antrea.

func GetNodeAllAddrs added in v1.6.0

func GetNodeAllAddrs(node *v1.Node) (ips sets.String, err error)

GetNodeAllAddrs gets all Node IPs from the Node.

func GetNodeGatewayAddrs added in v1.6.0

func GetNodeGatewayAddrs(node *v1.Node) (*ip.DualStackIPs, error)

GetNodeGatewayAddrs gets Node Antrea gateway IPs from the Node Spec.

func GetNodeTransportAddrs added in v1.8.0

func GetNodeTransportAddrs(node *v1.Node) (*ip.DualStackIPs, error)

func NamespacedName

func NamespacedName(namespace, name string) string

NamespacedName generates the conventional K8s resource name, which connects namespace and name with "/".

func ParseStatefulSetName added in v1.5.0

func ParseStatefulSetName(name string) (statefulSetName string, index int, err error)

func SplitNamespacedName added in v1.5.0

func SplitNamespacedName(name string) (string, string)

SplitNamespacedName splits conventional K8s resource name to Namespace and Resource Name

Types

This section is empty.

Jump to

Keyboard shortcuts

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