discovery

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

+kubebuilder:object:generate=true

Index

Constants

View Source
const (
	RegionLabel = "topology.kubernetes.io/region"
)

Variables

Functions

This section is empty.

Types

type ClusterDiscoverer

type ClusterDiscoverer interface {
	Info(context.Context) (*ClusterInfo, error)
	Resources(ctx context.Context) (ClusterResources, error)
	Version() (string, error)
}

+kubebuilder:object:generate=false

func NewForConfig

func NewForConfig(c *rest.Config) (ClusterDiscoverer, error)

type ClusterInfo

type ClusterInfo struct {
	// total of Nodes
	TotalNodes *int `json:"totalNodes,omitempty"`

	// CreationTimestamp is a timestamp representing the server time when the kube-system namespace was created.
	// It is represented in RFC3339 form and is in UTC.
	CreationTimestamp metav1.Time `json:"creationTimestamp,omitempty"`

	// Provider stores the cluster's source.
	Provider string `json:"provider,omitempty"`

	// Region holds the geographic location with most nodes.
	Region string `json:"region,omitempty"`
}

func (*ClusterInfo) DeepCopy

func (in *ClusterInfo) DeepCopy() *ClusterInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterInfo.

func (*ClusterInfo) DeepCopyInto

func (in *ClusterInfo) DeepCopyInto(out *ClusterInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ClusterResources

type ClusterResources map[corev1.ResourceName]Resources

func (ClusterResources) DeepCopy

func (in ClusterResources) DeepCopy() ClusterResources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResources.

func (ClusterResources) DeepCopyInto

func (in ClusterResources) DeepCopyInto(out *ClusterResources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeInfo

type NodeInfo struct {
	// Node name
	Name string `json:"name,omitempty"`

	// Node labels
	Labels map[string]string `json:"labels,omitempty"`

	// Usage and available resources
	Resources map[corev1.ResourceName]Resources `json:"resources,omitempty"`

	// True if node is in ready condition
	Ready bool `json:"ready,omitempty"`

	// CreationTimestamp is a timestamp representing the server time when this object was created.
	// It is represented in RFC3339 form and is in UTC.
	CreationTimestamp metav1.Time `json:"-"`
}

func (*NodeInfo) DeepCopy added in v0.6.0

func (in *NodeInfo) DeepCopy() *NodeInfo

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInfo.

func (*NodeInfo) DeepCopyInto added in v0.6.0

func (in *NodeInfo) DeepCopyInto(out *NodeInfo)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Resources

type Resources struct {
	// Quantity of resources available for scheduling
	Available resource.Quantity `json:"available,omitempty"`

	// Quantity of resources in use
	Usage resource.Quantity `json:"usage,omitempty"`

	// Percentage of resources in use
	UsagePercentage int32 `json:"usagePercentage,omitempty"`
}

func NewResources

func NewResources(available, usage resource.Quantity) Resources

func (*Resources) DeepCopy

func (in *Resources) DeepCopy() *Resources

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.

func (*Resources) DeepCopyInto

func (in *Resources) DeepCopyInto(out *Resources)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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