k8s

package
v0.0.0-...-40176bd Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 13 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(namespace string) (*Client, error)

func NewLocalClient

func NewLocalClient(namespace string) (*Client, error)

func (*Client) Events

func (c *Client) Events(ctx context.Context, id string) ([]*Event, error)

func (*Client) GetPods

func (c *Client) GetPods(ctx context.Context, id string) ([]v1.Pod, error)

func (*Client) Logs

func (c *Client) Logs(ctx context.Context, id string, tailLines int64, each func(l *LogEntry)) error

func (*Client) WatchEvents

func (c *Client) WatchEvents(ctx context.Context, f func(ev *Event)) error

func (*Client) WatchPods

func (c *Client) WatchPods(ctx context.Context, f func(eventType string, p *Pod)) error

type ContainerStatus

type ContainerStatus struct {
	// State                string `json:"state"`
	// LastTerminationState string `json:"lastState"`
	Ready        bool   `json:"ready"`
	RestartCount int    `json:"restartCount"`
	Image        string `json:"image"`
	ImageID      string `json:"imageId"`
	Started      bool   `json:"started"`
}

type Event

type Event struct {
	LastSeen time.Time `json:"lastSeen"`
	Type     string    `json:"type"`
	Reason   string    `json:"reason"`
	Message  string    `json:"message"`

	InvolvedObject EventObjectReference `json:"-"`
}

type EventObjectReference

type EventObjectReference struct {
	Kind string
	Name string
}

type LogEntry

type LogEntry struct {
	Pod       string    `json:"pod"`
	Timestamp time.Time `json:"timestamp"`
	Log       string    `json:"log"`
}

type Pod

type Pod struct {
	Name   string    `json:"name"`
	Status PodStatus `json:"status"`
}

type PodCondition

type PodCondition struct {
	Type               string    `json:"type"`
	Status             string    `json:"status"`
	LastProbeTime      time.Time `json:"lastProbeTime"`
	LastTransitionTime time.Time `json:"lastTransitionTime"`
	Reason             string    `json:"reason"`
	Message            string    `json:"message"`
}

type PodStatus

type PodStatus struct {
	Phase           string          `json:"phase"`
	Conditions      []PodCondition  `json:"conditions"`
	Message         string          `json:"message"`
	Reason          string          `json:"reason"`
	NodeName        string          `json:"nodeName"`
	PodIP           string          `json:"podIp"`
	StartTime       time.Time       `json:"startTime"`
	ContainerStatus ContainerStatus `json:"containerStatus"`
}

Jump to

Keyboard shortcuts

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