kubernetes

package
v0.1.3-dev Latest Latest
Warning

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

Go to latest
Published: Oct 18, 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) GetNodeMetrics

func (c *Client) GetNodeMetrics(nodeName string) (cpuUsage string, memoryUsage string, err error)

func (*Client) GetNodes

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

func (*Client) GetPodDetails

func (c *Client) GetPodDetails(pod Pod) (string, error)

func (*Client) GetPodLogs

func (c *Client) GetPodLogs(pod Pod) (string, error)

func (*Client) GetPodMetrics

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

func (*Client) GetPods

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

func (*Client) GetPodsByNode

func (c *Client) GetPodsByNode(nodeName string) ([]Pod, error)

func (*Client) ListNamespaces

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

func (*Client) SetNamespace

func (c *Client) SetNamespace(namespace string)

type KubernetesClient

type KubernetesClient interface {
	GetNodes() ([]string, error)
	GetNodeMetrics(nodeName string) (cpuUsage string, memoryUsage string, err error)
	GetPods() ([]Pod, error)
	GetPodsByNode(nodeName string) ([]Pod, error)
	GetPodMetrics(pod Pod) (cpuUsage string, memoryUsage string, err error)
	GetPodDetails(pod Pod) (string, error)
	GetPodLogs(pod Pod) (string, error)
	SetNamespace(namespace string)
	ListNamespaces() ([]string, error)
}

type Pod

type Pod struct {
	Name      string
	Namespace string
	NodeName  string
}

Jump to

Keyboard shortcuts

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