kubecli

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPodCompleted = fmt.Errorf("pod ran to completion")

ErrPodCompleted is returned by PodRunning or PodContainerRunning to indicate that the pod has already reached completed state.

Functions

func GetAllResourceUsages

func GetAllResourceUsages(metrics *metricsutil.ResourceMetricsInfo) map[v1.ResourceName]int64

func GetPodMetrics

func GetPodMetrics(m *metricsapi.PodMetrics) v1.ResourceList

func GetSingleResourceUsage

func GetSingleResourceUsage(resourceType v1.ResourceName, quantity resource.Quantity) int64

func NewCmdExec added in v0.7.0

func NewCmdExec(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

func NewCmdRun added in v0.8.0

func NewCmdRun(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Command

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

func NewCmd added in v0.1.2

func NewCmd(cmd *cobra.Command, args []string, streams genericclioptions.IOStreams) *Cmd

func (*Cmd) Run

func (c *Cmd) Run()

func (*Cmd) SetFlag

func (c *Cmd) SetFlag(name, value string) *Cmd

type KLogger added in v0.7.0

type KLogger struct {
	// contains filtered or unexported fields
}

func NewKLogger added in v0.7.0

func NewKLogger(logger *logrus.Logger) *KLogger

func (KLogger) Enabled added in v0.7.0

func (K KLogger) Enabled() bool

func (KLogger) Error added in v0.7.0

func (K KLogger) Error(_ error, msg string, _ ...interface{})

func (KLogger) Info added in v0.7.0

func (K KLogger) Info(msg string, _ ...interface{})

func (KLogger) V added in v0.7.0

func (K KLogger) V(_ int) logr.Logger

func (KLogger) WithName added in v0.7.0

func (K KLogger) WithName(_ string) logr.Logger

func (KLogger) WithValues added in v0.7.0

func (K KLogger) WithValues(_ ...interface{}) logr.Logger

type KubeCLI

type KubeCLI struct {
	// contains filtered or unexported fields
}
var Cli *KubeCLI

func NewKubeCLI

func NewKubeCLI() *KubeCLI

func (*KubeCLI) APIResources added in v0.4.1

func (cli *KubeCLI) APIResources(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) ClusterInfo

func (cli *KubeCLI) ClusterInfo() (string, error)

func (*KubeCLI) CurrentContext

func (cli *KubeCLI) CurrentContext() string

func (*KubeCLI) Describe

func (cli *KubeCLI) Describe(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) Edit added in v0.3.0

func (cli *KubeCLI) Edit(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) Exec added in v0.7.0

func (cli *KubeCLI) Exec(streams genericclioptions.IOStreams, args ...string) *Cmd

Exec Exec

func (*KubeCLI) Get

func (cli *KubeCLI) Get(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) GetNamespaces added in v0.10.2

func (cli *KubeCLI) GetNamespaces(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error)

func (*KubeCLI) GetPodMetrics

func (cli *KubeCLI) GetPodMetrics(namespace, name string, allNamespaces bool, selector Selector) ([]map[v1.ResourceName]int64, error)

func (*KubeCLI) GetPodRawMetrics

func (cli *KubeCLI) GetPodRawMetrics(
	namespace, name string,
	allNamespaces bool,
	selector Selector,
) (*metricsapi.PodMetricsList, error)

func (*KubeCLI) GetResourceGroupVersionKind added in v0.5.0

func (cli *KubeCLI) GetResourceGroupVersionKind(resourceOrKindArg string) schema.GroupVersionKind

func (*KubeCLI) HasNamespacePermission added in v0.10.2

func (cli *KubeCLI) HasNamespacePermission(ctx context.Context) bool

func (*KubeCLI) ListContexts added in v0.8.0

func (cli *KubeCLI) ListContexts() []string

func (*KubeCLI) Logs

func (cli *KubeCLI) Logs(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) Namespace

func (cli *KubeCLI) Namespace() string

func (*KubeCLI) RolloutRestart added in v0.4.0

func (cli *KubeCLI) RolloutRestart(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) Run added in v0.8.0

func (cli *KubeCLI) Run(streams genericclioptions.IOStreams, args ...string) *Cmd

func (*KubeCLI) SetCurrentContext added in v0.8.0

func (cli *KubeCLI) SetCurrentContext(context string)

func (*KubeCLI) SetNamespace

func (cli *KubeCLI) SetNamespace(namespace string)

func (*KubeCLI) TopNode

func (cli *KubeCLI) TopNode(streams genericclioptions.IOStreams, o *top.TopNodeOptions, args ...string) *Cmd

func (*KubeCLI) TopPod

func (cli *KubeCLI) TopPod(streams genericclioptions.IOStreams, o *top.TopPodOptions, args ...string) *Cmd

func (*KubeCLI) WithNamespace

func (cli *KubeCLI) WithNamespace(namespace string) *KubeCLI

type RunObject added in v0.8.0

type RunObject struct {
	Object  runtime.Object
	Mapping *meta.RESTMapping
}

type RunOptions added in v0.8.0

type RunOptions struct {
	PrintFlags  *genericclioptions.PrintFlags
	RecordFlags *genericclioptions.RecordFlags

	DeleteFlags   *delete.DeleteFlags
	DeleteOptions *delete.DeleteOptions

	DryRunStrategy cmdutil.DryRunStrategy
	DryRunVerifier *resource.DryRunVerifier

	PrintObj func(runtime.Object) error
	Recorder genericclioptions.Recorder

	ArgsLenAtDash  int
	Attach         bool
	Expose         bool
	Generator      string
	Image          string
	Interactive    bool
	LeaveStdinOpen bool
	Port           string
	Privileged     bool
	Quiet          bool
	Schedule       string
	TTY            bool

	Namespace        string
	EnforceNamespace bool

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

func NewRunOptions added in v0.8.0

func NewRunOptions(streams genericclioptions.IOStreams) *RunOptions

func (*RunOptions) Complete added in v0.8.0

func (o *RunOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error

func (*RunOptions) Run added in v0.8.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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