Documentation ¶
Overview ¶
Package k8s contains utilities for Antrea interactions with Kubernetes.
Index ¶
- Variables
- func CreateClients(config componentbaseconfig.ClientConnectionConfiguration, ...) (clientset.Interface, aggregatorclientset.Interface, crdclientset.Interface, ...)
- func CreateRestConfig(config componentbaseconfig.ClientConnectionConfiguration, ...) (*rest.Config, error)
- func EndpointSliceAPIAvailable(k8sClient clientset.Interface) (bool, error)
- func GetNodeAddrs(node *v1.Node) (*ip.DualStackIPs, error)
- func GetNodeAddrsFromAnnotations(node *v1.Node, annotationKey string) (*ip.DualStackIPs, error)
- func GetNodeAddrsWithType(node *v1.Node, types []v1.NodeAddressType) (*ip.DualStackIPs, error)
- func GetNodeAllAddrs(node *v1.Node) (ips sets.Set[string], err error)
- func GetNodeGatewayAddrs(node *v1.Node) (*ip.DualStackIPs, error)
- func GetNodeTransportAddrs(node *v1.Node) (*ip.DualStackIPs, error)
- func NamespacedName(namespace, name string) string
- func OverrideKubeAPIServer(kubeAPIServerOverride string)
- func ParseStatefulSetName(name string) (statefulSetName string, index int, err error)
- func SplitNamespacedName(name string) (string, string)
Constants ¶
This section is empty.
Variables ¶
var SemanticIgnoringTime = conversion.EqualitiesOrDie( func(a, b metav1.Time) bool { return true }, )
Functions ¶
func CreateClients ¶
func CreateClients(config componentbaseconfig.ClientConnectionConfiguration, kubeAPIServerOverride string) ( clientset.Interface, aggregatorclientset.Interface, crdclientset.Interface, apiextensionclientset.Interface, mcclientset.Interface, policyclient.Interface, error)
CreateClients creates kube clients from the given config.
func CreateRestConfig ¶ added in v1.14.0
func CreateRestConfig(config componentbaseconfig.ClientConnectionConfiguration, kubeAPIServerOverride string) (*rest.Config, error)
func EndpointSliceAPIAvailable ¶ added in v1.12.0
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
GetNodeAddrsFromAnnotations gets available IPs from the Node Annotation. The annotations are set by Antrea.
func GetNodeAddrsWithType ¶ added in v1.13.0
func GetNodeAddrsWithType(node *v1.Node, types []v1.NodeAddressType) (*ip.DualStackIPs, error)
GetNodeAddrsWithType gets the available IP addresses of a Node. It will consider address types specified in the types slice, in the provided order. If no error is returned, the returned DualStackIPs includes at least one IPv4 or IPv6 address.
func GetNodeAllAddrs ¶ added in v1.6.0
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 ¶
NamespacedName generates the conventional K8s resource name, which connects namespace and name with "/".
func OverrideKubeAPIServer ¶ added in v1.13.0
func OverrideKubeAPIServer(kubeAPIServerOverride string)
OverrideKubeAPIServer overrides the env vars related to the kubernetes service used by InClusterConfig. It's required because some K8s libraries like DelegatingAuthenticationOptions and DelegatingAuthorizationOptions read the information from env vars and don't support overriding via parameters.
func ParseStatefulSetName ¶ added in v1.5.0
func SplitNamespacedName ¶ added in v1.5.0
SplitNamespacedName splits conventional K8s resource name to Namespace and Resource Name
Types ¶
This section is empty.