KubectlExecSettings Class

Summary

Execute a command in a container.
Assembly
Cake.Kubectl.dll
Namespace
Cake.Kubectl
Base Types
graph BT Type-->Base0["AutoToolSettings"] click Base0 "/api/Cake.Kubectl/AutoToolSettings" Base0-->Base1["ToolSettings"] Type["KubectlExecSettings"] class Type type-node

Syntax

public sealed class KubectlExecSettings : AutoToolSettings

Examples

# Get output from running 'date' from pod 123456-7890, using the first container by default kubectl exec 123456-7890 date # Get output from running 'date' in ruby-container from pod 123456-7890 kubectl exec 123456-7890 -c ruby-container date # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-7890 # and sends stdout/stderr from 'bash' back to the client kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il # List contents of /usr from the first container of pod 123456-7890 and sort by modification time. # If the command you want to execute in the pod has any flags in common (e.g. -i), # you must use two dashes (--) to separate your command's flags/arguments. # Also note, do not surround your command and its flags/arguments with quotes # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr"). kubectl exec 123456-7890 -i -t -- ls -t /usr

Attributes

Type Description
CompilerGeneratedAttribute

Constructors

Name Summary
KubectlExecSettings()

Properties

Name Value Summary
Container string
-c, --container Container name. If omitted, the first container in the pod will be chosen
Stdin Nullable<bool>
-i, --stdin Pass stdin to the container
Tty Nullable<bool>
-t, --tty Stdin is a TTY

Extension Methods

Name Value Summary
Dump<KubectlExecSettings>() string
Get a basic string representation of specified object.
Requires the Cake.Incubator addin
IsIn<KubectlExecSettings>(KubectlExecSettings[]) bool
Checks if the source is contained in a list
Requires the Cake.Incubator addin
NotNull<KubectlExecSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Ftp addin
NotNull<KubectlExecSettings>(string) void
Throws an exception if the specified parameter's value is null.
Requires the Cake.Issues addin
ThrowIfNull<KubectlExecSettings>(string) T
Throws a System.ArgumentNullException if the value is null, otherwise returns the value
Requires the Cake.Incubator addin
ThrowIfNull<KubectlExecSettings>(string, string) T
Throws a System.ArgumentNullException with a specific message if the value is null, otherwise returns the value
Requires the Cake.Incubator addin