pod

package
v1.1.0-beta3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetContainerImages

func GetContainerImages(podTemplate *api.PodSpec) []string

GetContainerImages returns container image strings from the given pod spec.

Types

type MetricResult

type MetricResult struct {
	Timestamp time.Time `json:"timestamp"`
	Value     uint64    `json:"value"`
}

MetricResult is a some sample measurement of a non-negative, integer quantity (for example, memory usage in bytes observed at some moment)

type MetricsByPod

type MetricsByPod struct {
	// Metrics by namespace and name of a pod.
	MetricsMap map[string]map[string]PodMetrics `json:"metricsMap"`
}

MetricsByPod is a metrics map by pod name.

type Pod

type Pod struct {
	ObjectMeta common.ObjectMeta `json:"objectMeta"`
	TypeMeta   common.TypeMeta   `json:"typeMeta"`

	// Status of the Pod. See Kubernetes API for reference.
	PodPhase api.PodPhase `json:"podPhase"`

	// IP address of the Pod.
	PodIP string `json:"podIP"`

	// Count of containers restarts.
	RestartCount int32 `json:"restartCount"`

	// Pod metrics.
	Metrics *PodMetrics `json:"metrics"`
}

Pod is a presentation layer view of Kubernetes Pod resource. This means it is Pod plus additional augumented data we can get from other sources (like services that target it).

func ToPod

func ToPod(pod *api.Pod, metrics *MetricsByPod) Pod

type PodDetail

type PodDetail struct {
	ObjectMeta common.ObjectMeta `json:"objectMeta"`
	TypeMeta   common.TypeMeta   `json:"typeMeta"`

	// Container images of the Pod.
	ContainerImages []string `json:"containerImages"`

	// Status of the Pod. See Kubernetes API for reference.
	PodPhase api.PodPhase `json:"podPhase"`

	// IP address of the Pod.
	PodIP string `json:"podIP"`

	// Name of the Node this Pod runs on.
	NodeName string `json:"nodeName"`

	// Count of containers restarts.
	RestartCount int32 `json:"restartCount"`

	// Pod metrics.
	Metrics *PodMetrics `json:"metrics"`
}

PodDetail is a presentation layer view of Kubernetes PodDetail resource. This means it is PodDetail plus additional augumented data we can get from other sources (like services that target it).

func GetPodDetail

func GetPodDetail(client k8sClient.Interface, heapsterClient client.HeapsterClient,
	namespace, name string) (*PodDetail, error)

GetPodDetail returns the details (PodDetail) of a named Pod from a particular namespace.

func ToPodDetail

func ToPodDetail(pod *api.Pod, metrics *MetricsByPod) PodDetail

type PodList

type PodList struct {
	// Unordered list of Pods.
	Pods []Pod `json:"pods"`
}

ReplicationSetList contains a list of Pods in the cluster.

func CreatePodList

func CreatePodList(pods []api.Pod, heapsterClient client.HeapsterClient) PodList

func GetPodList

func GetPodList(client k8sClient.Interface, heapsterClient client.HeapsterClient,
	nsQuery *common.NamespaceQuery) (*PodList, error)

GetPodList returns a list of all Pods in the cluster.

func GetPodListFromChannels

func GetPodListFromChannels(channels *common.ResourceChannels, heapsterClient client.HeapsterClient) (
	*PodList, error)

GetPodList returns a list of all Pods in the cluster reading required resource list once from the channels.

type PodMetrics

type PodMetrics struct {
	// Most recent measure of CPU usage on all cores in nanoseconds.
	CpuUsage *uint64 `json:"cpuUsage"`
	// Pod memory usage in bytes.
	MemoryUsage *uint64 `json:"memoryUsage"`
	// Timestamped samples of CpuUsage over some short period of history
	CpuUsageHistory []MetricResult `json:"cpuUsageHistory"`
	// Timestamped samples of pod memory usage over some short period of history
	MemoryUsageHistory []MetricResult `json:"memoryUsageHistory"`
}

PodMetrics is a structure representing pods metrics, contains information about CPU and memory usage.

Jump to

Keyboard shortcuts

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