Documentation ¶
Index ¶
- Variables
- func GenClusterList(clientSet karmadaclientset.Interface, clusters []string) ([]string, error)
- func GetMemberAndMetricsClientSet(f util.Factory, cluster string, useProtocolBuffers bool) (*kubernetes.Clientset, *metricsclientset.Clientset, error)
- func NewCmdTop(f util.Factory, parentCommand string, streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdTopPod(f util.Factory, parentCommand string, o *TopPodOptions, ...) *cobra.Command
- func SupportedMetricsAPIVersionAvailable(discoveredAPIGroups *metav1.APIGroupList) bool
- type PodMetricsSorter
- type ResourceAdder
- type ResourceMetricsInfo
- type TopCmdPrinter
- type TopPodOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MeasuredResources = []corev1.ResourceName{ corev1.ResourceCPU, corev1.ResourceMemory, } PodColumns = []string{"NAME", "CLUSTER", "CPU(cores)", "MEMORY(bytes)"} NamespaceColumn = "NAMESPACE" PodColumn = "POD" )
Functions ¶
func GenClusterList ¶ added in v1.8.0
func GenClusterList(clientSet karmadaclientset.Interface, clusters []string) ([]string, error)
func GetMemberAndMetricsClientSet ¶ added in v1.8.0
func GetMemberAndMetricsClientSet(f util.Factory, cluster string, useProtocolBuffers bool) (*kubernetes.Clientset, *metricsclientset.Clientset, error)
func NewCmdTopPod ¶
func NewCmdTopPod(f util.Factory, parentCommand string, o *TopPodOptions, streams genericclioptions.IOStreams) *cobra.Command
func SupportedMetricsAPIVersionAvailable ¶
func SupportedMetricsAPIVersionAvailable(discoveredAPIGroups *metav1.APIGroupList) bool
Types ¶
type PodMetricsSorter ¶
type PodMetricsSorter struct {
// contains filtered or unexported fields
}
func NewPodMetricsSorter ¶
func NewPodMetricsSorter(metrics []metricsapi.PodMetrics, withNamespace bool, sortBy string) *PodMetricsSorter
func (*PodMetricsSorter) Len ¶
func (p *PodMetricsSorter) Len() int
func (*PodMetricsSorter) Less ¶
func (p *PodMetricsSorter) Less(i, j int) bool
func (*PodMetricsSorter) Swap ¶
func (p *PodMetricsSorter) Swap(i, j int)
type ResourceAdder ¶
type ResourceAdder struct {
// contains filtered or unexported fields
}
func NewResourceAdder ¶
func NewResourceAdder(resources []corev1.ResourceName) *ResourceAdder
func (*ResourceAdder) AddPodMetrics ¶
func (adder *ResourceAdder) AddPodMetrics(m *metricsapi.PodMetrics)
AddPodMetrics adds each pod metric to the total
type ResourceMetricsInfo ¶
type ResourceMetricsInfo struct { Cluster string Name string Metrics corev1.ResourceList Available corev1.ResourceList }
type TopCmdPrinter ¶
type TopCmdPrinter struct {
// contains filtered or unexported fields
}
func NewTopCmdPrinter ¶
func NewTopCmdPrinter(out io.Writer) *TopCmdPrinter
func (*TopCmdPrinter) PrintPodMetrics ¶
func (printer *TopCmdPrinter) PrintPodMetrics(metrics []metricsapi.PodMetrics, printContainers, withNamespace, noHeaders bool, sortBy string, sum bool) error
type TopPodOptions ¶
type TopPodOptions struct { ResourceName string Namespace string Clusters []string LabelSelector string FieldSelector string SortBy string AllNamespaces bool PrintContainers bool NoHeaders bool UseProtocolBuffers bool Sum bool Printer *TopCmdPrinter genericclioptions.IOStreams // contains filtered or unexported fields }
func (*TopPodOptions) Validate ¶
func (o *TopPodOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.