Documentation
¶
Index ¶
Constants ¶
const (
RegionLabel = "topology.kubernetes.io/region"
)
Variables ¶
var ClusterSourcePrefixes = map[string]string{
"cloud.google.com/gke": "gcp",
"eks.amazonaws.com/": "aws",
"kubernetes.azure.com/": "azure",
"doks.digitalocean.com/": "digitalocean",
"oke.oraclecloud.com/": "oraclecloud",
}
var MeasuredResources = []corev1.ResourceName{corev1.ResourceCPU, corev1.ResourceMemory}
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)
}
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"`
}
+k8s:deepcopy-gen=true
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
+k8s:deepcopy-gen=true
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:"-"`
}
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"`
}
+k8s:deepcopy-gen=true
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.