hostinfo

package
v0.0.0-...-d9d232d Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Overview

Package hostinfo provides functions to get annotations, labels, etc. from Kubernetes nodes.

Index

Constants

View Source
const (
	// NormalizedRoleLabel is original Kubernetes label for role, we normalize the new one to this one
	NormalizedRoleLabel string = "kubernetes.io/role"
)

Variables

This section is empty.

Functions

func GetTags

func GetTags(ctx context.Context) ([]string, error)

GetTags gets the tags from the kubernetes apiserver

func LabelPreprocessor

func LabelPreprocessor(labelName string, labelValue string) (string, string)

LabelPreprocessor ensure different role labels are parsed correctly

Types

type NodeInfo

type NodeInfo struct {
}

NodeInfo is use to get Kubernetes Node metadata information

func NewNodeInfo

func NewNodeInfo() (*NodeInfo, error)

NewNodeInfo return a new NodeInfo instance return an error if it fails to access the kubelet client.

func (*NodeInfo) GetNodeClusterNameLabel

func (n *NodeInfo) GetNodeClusterNameLabel(ctx context.Context, clusterName string) (string, error)

GetNodeClusterNameLabel returns clustername by fetching a node label

func (*NodeInfo) GetNodeLabels

func (n *NodeInfo) GetNodeLabels(ctx context.Context) (map[string]string, error)

GetNodeLabels returns node labels for this host

Jump to

Keyboard shortcuts

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