k8s

package
v0.0.0-...-d844598 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright 2023 Operant AI

Copyright 2023 Operant AI

Index

Constants

This section is empty.

Variables

View Source
var ErrContainerNotFound = errors.New("container not found")

ErrContainerNotFound is returned when a container is not found

Functions

This section is empty.

Types

type Client

type Client struct {
	Clientset  *kubernetes.Clientset
	RestConfig *rest.Config
}

func NewClient

func NewClient() (*Client, error)

func NewClientInContainer

func NewClientInContainer() (*Client, error)

func (*Client) ExecuteRemoteCommand

func (c *Client) ExecuteRemoteCommand(ctx context.Context, namespace, podName, container string, commands []string) (string, string, error)

func (*Client) FindContainerByName

func (c *Client) FindContainerByName(containers []corev1.Container, containerName string) (corev1.Container, error)

FindContainerByName returns a container by name from a list of containers

func (*Client) GetDeploymentsPods

func (c *Client) GetDeploymentsPods(ctx context.Context, namespace string, deployment *appsv1.Deployment) ([]corev1.Pod, error)

GetDeploymentsPods gets the pods belonging to the provided deployment

func (*Client) GetK8sVersion

func (c *Client) GetK8sVersion() (*k8sVersion.Info, error)

func (*Client) NewPortForwarder

func (c *Client) NewPortForwarder(ctx context.Context) *portForwarder

Jump to

Keyboard shortcuts

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