kubectl

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Credentials for creating an ImagePullSecret
	EnvDockerUsername = "M_DOCKER_USERNAME"
	EnvDockerPassword = "M_DOCKER_PASSWORD"
	EnvDockerServer   = "M_DOCKER_SERVER"
)

Variables

This section is empty.

Functions

func DockerCredentialsDefined added in v1.5.0

func DockerCredentialsDefined() bool

func GetKubeconfig

func GetKubeconfig(createDefault bool) string

func WaitForOutput

func WaitForOutput(k KCmd, expected string, seconds int) error

func WaitForOutputContains

func WaitForOutputContains(k KCmd, expected string, seconds int) error

func WaitForOutputPattern

func WaitForOutputPattern(k KCmd, pattern string, seconds int) error

func WatchPods

func WatchPods()

func WatchPodsInNs

func WatchPodsInNs(namespace string)

Types

type KCmd

type KCmd struct {
	Command string
	Args    []string
	Flags   map[string]string
}

============================================== KCmd represents an executable kubectl command ==============================================

func Annotate added in v1.5.0

func Annotate(resource string, name string, key string, value string) KCmd

func ApplyFiles

func ApplyFiles(paths ...string) KCmd

func ClusterInfoForContext

func ClusterInfoForContext(ctxt string) KCmd

func CreateFromFiles

func CreateFromFiles(paths ...string) KCmd

func CreateNamespace

func CreateNamespace(namespace string) KCmd

func CreateSecretLiteral

func CreateSecretLiteral(name string, user string, pw string) KCmd

func Delete

func Delete(args ...string) KCmd

func DeleteByTypeAndName

func DeleteByTypeAndName(resourceType string, names ...string) KCmd

func DeleteFromFiles

func DeleteFromFiles(paths ...string) KCmd

func DeleteNamespace added in v1.4.0

func DeleteNamespace(namespace string) KCmd

func DumpAllLogs

func DumpAllLogs(path string) KCmd

func DumpLogs

func DumpLogs(path string, namespace string) KCmd

func ExecOnPod

func ExecOnPod(podName string, args ...string) KCmd

func Get

func Get(args ...string) KCmd

func GetByFiles

func GetByFiles(paths ...string) KCmd

func GetByTypeAndName

func GetByTypeAndName(resourceType string, names ...string) KCmd

func GetNodeNameForPod added in v1.5.0

func GetNodeNameForPod(podName string) KCmd

func GetNodes added in v1.5.1

func GetNodes() KCmd

func Label added in v1.5.1

func Label(nodes string, key string, value string) KCmd

func Logs added in v1.5.0

func Logs(args ...string) KCmd

func PatchJson

func PatchJson(resource string, data string) KCmd

func PatchMerge

func PatchMerge(resource string, data string) KCmd

func Taint added in v1.5.0

func Taint(node string, key string, value string, effect string) KCmd

func (KCmd) ExecV

func (k KCmd) ExecV() error

func (KCmd) ExecVCapture

func (k KCmd) ExecVCapture() (string, string, error)

func (KCmd) ExecVPanic

func (k KCmd) ExecVPanic()

func (KCmd) FormatOutput

func (k KCmd) FormatOutput(outputType string) KCmd

func (KCmd) InNamespace

func (k KCmd) InNamespace(namespace string) KCmd

============================================== Helper functions to build up a KCmd object for common actions ==============================================

func (KCmd) Output

func (k KCmd) Output() (string, error)

func (KCmd) OutputPanic

func (k KCmd) OutputPanic() string

func (KCmd) ToCliArgs

func (k KCmd) ToCliArgs() []string

============================================== Execute KCmd by running kubectl ==============================================

func (KCmd) WithFlag

func (k KCmd) WithFlag(name string, value string) KCmd

func (KCmd) WithLabel

func (k KCmd) WithLabel(label string) KCmd

Jump to

Keyboard shortcuts

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