cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ResourceNodeLong = templates.LongDesc(i18n.T(`
		Display resource (cpu/memory/gpu/podcount) usage of nodes.

		The resource node command allows you to see the resource consumption of nodes.`))

	ResourceNodeExample = templates.Examples(i18n.T(`
		  # Show metrics for all nodes
		  kubectl resource-view node

		  # Show metrics for a given node
		  kubectl resource-view node NODE_NAME

		  # Show metrics for the node defined by type name=cpu,memory,gpu,pod
		  kubectl resource-view node -t cpu,memory,gpu,pod

		  `))
)

Functions

func MapKeyInIntSlice added in v0.2.0

func MapKeyInIntSlice(haystack []string, needle string) bool

MapKeyInIntSlice

func NewCmdResource

func NewCmdResource() *cobra.Command

NewCmdResource

func SupportedMetricsAPIVersionAvailable

func SupportedMetricsAPIVersionAvailable(discoveredAPIGroups *metav1.APIGroupList) bool

SupportedMetricsAPIVersionAvailable

Types

type ResourceNodeOptions

type ResourceNodeOptions struct {
	ResourceName       string
	ResourceType       string
	ResourceTypeslice  []string
	Selector           string
	SortBy             string
	NoFormat           bool
	UseProtocolBuffers bool

	NodeClient      corev1client.CoreV1Interface
	Printer         *metricsutil.TopCmdPrinter
	DiscoveryClient discovery.DiscoveryInterface
	MetricsClient   metricsclientset.Interface
	Client          *kube.KubeClient

	genericclioptions.IOStreams
}

func (*ResourceNodeOptions) Complete

func (o *ResourceNodeOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

func (ResourceNodeOptions) RunResourceNode

func (o ResourceNodeOptions) RunResourceNode() error

func (*ResourceNodeOptions) Validate

func (o *ResourceNodeOptions) Validate(cmd *cobra.Command, args []string) error

type ResourcePodOptions

type ResourcePodOptions struct {
	ResourceName       string
	Namespace          string
	ResourceType       string
	ResourceTypeslice  []string
	LabelSelector      string
	FieldSelector      string
	SortBy             string
	NoFormat           bool
	AllNamespaces      bool
	PrintContainers    bool
	NoHeaders          bool
	UseProtocolBuffers bool

	PodClient       corev1client.PodsGetter
	Printer         *metricsutil.TopCmdPrinter
	DiscoveryClient discovery.DiscoveryInterface
	MetricsClient   metricsclientset.Interface
	Client          *kube.KubeClient

	genericclioptions.IOStreams
}

func (*ResourcePodOptions) Complete

func (o *ResourcePodOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []string) error

func (ResourcePodOptions) RunResourcePod

func (o ResourcePodOptions) RunResourcePod() error

func (*ResourcePodOptions) Validate

func (o *ResourcePodOptions) Validate() error

Jump to

Keyboard shortcuts

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