k8s

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 9 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 {
	*kubernetes.Clientset
}

func NewClient

func NewClient(cfg *rest.Config) (*Client, error)

func (*Client) GetNode

func (c *Client) GetNode(ctx context.Context, nodename string) (*corev1.Node, error)

func (*Client) ListPodsOnNode

func (c *Client) ListPodsOnNode(ctx context.Context, nodename string) ([]corev1.Pod, error)

func (*Client) Metrics

func (c *Client) Metrics(ctx context.Context, nodename string) ([]byte, error)

Metrics is API for kubelet API /metrics

func (*Client) MetricsResource

func (c *Client) MetricsResource(ctx context.Context, nodename string) ([]byte, error)

MetricsResource is API for kubelet API /metrics/resource

func (*Client) StatsSummary

func (c *Client) StatsSummary(ctx context.Context, nodename string) (*kubelet_stats.Summary, error)

MetricsResource is API for kubelet API /stats/summary, returning k8s.io/kubelet/pkg/apis/stats/v1alpha1.Summary

func (*Client) StatsSummaryRaw

func (c *Client) StatsSummaryRaw(ctx context.Context, nodename string) ([]byte, error)

MetricsResource is API for kubelet API /stats/summary, returning json response

type PodsMap

type PodsMap map[types.NamespacedName]corev1.Pod

func ToPodsMap

func ToPodsMap(pods []corev1.Pod) PodsMap

func (PodsMap) GetPod

func (p PodsMap) GetPod(namespace, name string) corev1.Pod

func (PodsMap) PodAccountName

func (p PodsMap) PodAccountName(namespace, name string) string

func (PodsMap) PodClusterName

func (p PodsMap) PodClusterName(namespace, name string) string

func (PodsMap) PodTrackingId

func (p PodsMap) PodTrackingId(namespace, name string) string

Jump to

Keyboard shortcuts

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