kube

package
v0.0.0-...-722d0c0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PodExecuteCommand

func PodExecuteCommand(req ExecCommandRequest) (int, error)

func PodUploadFile

func PodUploadFile(req UploadFileRequest) (int, error)

func WrapAsTar

func WrapAsTar(fileNameOnTar string, fileContent []byte) ([]byte, error)

Types

type ExecCommandRequest

type ExecCommandRequest struct {
	KubeRequest
	Command []string
	StdIn   io.Reader
	StdOut  io.Writer
	StdErr  io.Writer
}

type KubeRequest

type KubeRequest struct {
	Clientset  *kubernetes.Clientset
	RestConfig *rest.Config
	Namespace  string
	Pod        string
	Container  string
}

type KubernetesApiService

type KubernetesApiService interface {
	ExecuteCommand(podName string, containerName string, command []string, stdOut io.Writer) (int, error)

	DeletePod(podName string) error

	CreatePrivilegedPod(nodeName string, containerName string, image string, socketPath string, timeout time.Duration) (*corev1.Pod, error)

	UploadFile(localPath string, remotePath string, podName string, containerName string) error
}

func NewKubernetesApiService

func NewKubernetesApiService(clientset *kubernetes.Clientset,
	restConfig *rest.Config, targetNamespace string) KubernetesApiService

type KubernetesApiServiceImpl

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

func (*KubernetesApiServiceImpl) CreatePrivilegedPod

func (k *KubernetesApiServiceImpl) CreatePrivilegedPod(nodeName string, containerName string, image string, socketPath string, timeout time.Duration) (*corev1.Pod, error)

func (*KubernetesApiServiceImpl) DeletePod

func (k *KubernetesApiServiceImpl) DeletePod(podName string) error

func (*KubernetesApiServiceImpl) ExecuteCommand

func (k *KubernetesApiServiceImpl) ExecuteCommand(podName string, containerName string, command []string, stdOut io.Writer) (int, error)

func (*KubernetesApiServiceImpl) IsSupportedContainerRuntime

func (k *KubernetesApiServiceImpl) IsSupportedContainerRuntime(nodeName string) (bool, error)

func (*KubernetesApiServiceImpl) UploadFile

func (k *KubernetesApiServiceImpl) UploadFile(localPath string, remotePath string, podName string, containerName string) error

type NopWriter

type NopWriter struct {
}

func (*NopWriter) Write

func (w *NopWriter) Write(p []byte) (n int, err error)

type UploadFileRequest

type UploadFileRequest struct {
	KubeRequest
	Src string
	Dst string
}

type Writer

type Writer struct {
	Output string
}

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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