Documentation
¶
Overview ¶
+kubebuilder:object:generate=true
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) }
+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
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeInfo.
func (*NodeInfo) DeepCopyInto ¶ added in v0.6.0
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 (*Resources) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources.
func (*Resources) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.