kube

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPVCManifest

func BuildPVCManifest(namespace, name, size, storageClass string, labels map[string]string, annotations map[string]string) ([]byte, error)

func BuildPodManifest

func BuildPodManifest(namespace, name string, labels map[string]string, annotations map[string]string, podSpec corev1.PodSpec) ([]byte, error)

func PreparePodSpec

func PreparePodSpec(podSpec corev1.PodSpec, volumes []corev1.Volume, workspaceMountPath, sidecarImage string, tmux bool, embeddedSSH bool, preStop string) (corev1.PodSpec, error)

Types

type Client

type Client struct {
	Context string
	// contains filtered or unexported fields
}

func (*Client) AnnotatePod added in v0.2.0

func (c *Client) AnnotatePod(ctx context.Context, namespace, pod, key, value string) error

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, namespace string, manifest []byte) error

func (*Client) CopyFromPod

func (c *Client) CopyFromPod(ctx context.Context, namespace, podName, remotePath, localPath string) error

func (*Client) CopyToPod

func (c *Client) CopyToPod(ctx context.Context, namespace, localPath, podName, remotePath string) error

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, namespace string, kind string, name string, ignoreNotFound bool) error

func (*Client) DescribePod

func (c *Client) DescribePod(ctx context.Context, namespace, pod string) (string, error)

func (*Client) ExecInteractive

func (c *Client) ExecInteractive(ctx context.Context, namespace, pod string, tty bool, command []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

func (*Client) ExecSh

func (c *Client) ExecSh(ctx context.Context, namespace, pod string, script string) ([]byte, error)

func (*Client) ExecShInContainer

func (c *Client) ExecShInContainer(ctx context.Context, namespace, pod, container, script string) ([]byte, error)

func (*Client) ExtractTarToPod

func (c *Client) ExtractTarToPod(ctx context.Context, namespace, podName, remoteDir string, tarStream io.Reader) error

func (*Client) GetPodAnnotation added in v0.2.0

func (c *Client) GetPodAnnotation(ctx context.Context, namespace, pod, key string) (string, error)

func (*Client) GetPodSummary

func (c *Client) GetPodSummary(ctx context.Context, namespace, name string) (*PodSummary, error)

func (*Client) ListPods

func (c *Client) ListPods(ctx context.Context, namespace string, allNamespaces bool, labelSelector string) ([]PodSummary, error)

func (*Client) PersistentVolumeClaimExists added in v0.2.6

func (c *Client) PersistentVolumeClaimExists(ctx context.Context, namespace, name string) (bool, error)

func (*Client) PortForward

func (c *Client) PortForward(ctx context.Context, namespace, pod string, forwards []string, stdout io.Writer, stderr io.Writer) error

func (*Client) StreamFromPod

func (c *Client) StreamFromPod(ctx context.Context, namespace, podName, script string, stdout io.Writer) error

func (*Client) StreamShInContainer added in v0.2.11

func (c *Client) StreamShInContainer(ctx context.Context, namespace, pod, container, script string, stdout, stderr io.Writer) error

func (*Client) TouchPodActivity

func (c *Client) TouchPodActivity(ctx context.Context, namespace, pod string) error

func (*Client) WaitReady

func (c *Client) WaitReady(ctx context.Context, namespace, pod string, timeout time.Duration) error

func (*Client) WaitReadyWithProgress

func (c *Client) WaitReadyWithProgress(ctx context.Context, namespace, pod string, timeout time.Duration, onProgress func(PodReadinessProgress)) error

type PodReadinessProgress

type PodReadinessProgress struct {
	Phase           corev1.PodPhase
	ReadyContainers int
	TotalContainers int
	Reason          string
}

type PodSummary

type PodSummary struct {
	Namespace   string
	Name        string
	Phase       string
	CreatedAt   time.Time
	Labels      map[string]string
	Annotations map[string]string
	Ready       string
	Restarts    int32
	Reason      string
}

Jump to

Keyboard shortcuts

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