kubernetes

package
v0.1.1-dev Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(kubeconfigPath string, namespace string) (*Client, error)

NewClient initializes a new Kubernetes client

func (*Client) GetPodDetails

func (c *Client) GetPodDetails(podName string) (string, error)

GetPodDetails retrieves the details of a specific pod by name

func (*Client) GetPodLogs

func (c *Client) GetPodLogs(podName string) (string, error)

GetPodLogs retrieves the logs for a specific pod

func (*Client) GetPodMetrics

func (c *Client) GetPodMetrics(podName string) (cpuUsage string, memoryUsage string, err error)

func (*Client) GetPods

func (c *Client) GetPods() ([]string, error)

GetPods retrieves the list of pods from the cluster in the specified namespace

func (*Client) ListNamespaces

func (c *Client) ListNamespaces() ([]string, error)

ListNamespaces retrieves all namespaces available in the cluster

func (*Client) SetNamespace

func (c *Client) SetNamespace(namespace string)

SetNamespace allows changing the namespace for the client

type KubernetesClient

type KubernetesClient interface {
	GetPods() ([]string, error)
	GetPodDetails(podName string) (string, error)
	GetPodLogs(podName string) (string, error)
	SetNamespace(namespace string)
	GetPodMetrics(podName string) (cpuUsage string, memoryUsage string, err error)
	ListNamespaces() ([]string, error)
}

Jump to

Keyboard shortcuts

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