pod

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2017 License: Apache-2.0 Imports: 19 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.

func GetEventsForPod added in v1.6.0

func GetEventsForPod(client client.Interface, dsQuery *dataselect.DataSelectQuery, namespace, podName string) (
	*common.EventList, error)

GetEventsForPod gets events that are associated with this pod.

Types

type Container added in v1.1.1

type Container struct {
	// Name of the container.
	Name string `json:"name"`

	// Image URI of the container.
	Image string `json:"image"`

	// List of environment variables.
	Env []EnvVar `json:"env"`

	// Commands of the container
	Commands []string `json:"commands"`

	// Command arguments
	Args []string `json:"args"`
}

Container represents a docker/rkt/etc. container that lives in a pod.

type Controller added in v1.5.0

type Controller struct {
	// Kind of the Controller, will also define wich of the other members will be non nil
	Kind string `json:"kind"`

	JobList                   *joblist.JobList                                     `json:"joblist,omitempty"`
	ReplicaSetList            *replicasetlist.ReplicaSetList                       `json:"replicasetlist,omitempty"`
	ReplicationControllerList *replicationcontrollerlist.ReplicationControllerList `json:"replicationcontrollerlist,omitempty"`
	DaemonSetList             *daemonsetlist.DaemonSetList                         `json:"daemonsetlist,omitempty"`
	StatefulSetList           *statefulsetlist.StatefulSetList                     `json:"statefulsetlist,omitempty"`
}

Creator is a view of the creator of a given pod, in List for for ease of use in the frontend logic.

Has 'oneof' semantics on the non-Kind fields decided by which Kind is there TODO(maciaszczykm): Refactor.

type EnvVar added in v1.1.1

type EnvVar struct {
	// Name of the variable.
	Name string `json:"name"`

	// Value of the variable. May be empty if value from is defined.
	Value string `json:"value"`

	// Defined for derived variables. If non-null, the value is get from the reference.
	// Note that this is an API struct. This is intentional, as EnvVarSources are plain struct
	// references.
	ValueFrom *api.EnvVarSource `json:"valueFrom"`
}

EnvVar represents an environment variable of a container.

type Pod

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

	// More info on pod status
	PodStatus PodStatus `json:"podStatus"`

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

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

	// Pod warning events
	Warnings []common.Event `json:"warnings"`
}

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

func ToPod

func ToPod(pod *api.Pod, metrics *common.MetricsByPod, warnings []common.Event) Pod

ToPod transforms Kubernetes pod object into object returned by API.

type PodCell added in v1.4.0

type PodCell api.Pod

func (PodCell) GetProperty added in v1.4.0

func (self PodCell) GetProperty(name dataselect.PropertyName) dataselect.ComparableValue

func (PodCell) GetResourceSelector added in v1.4.0

func (self PodCell) GetResourceSelector() *metric.ResourceSelector

type PodDetail

type PodDetail 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"`

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

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

	// Reference to the Controller
	Controller Controller `json:"controller"`

	// List of container of this pod.
	Containers []Container `json:"containers"`

	// Metrics collected for this resource
	Metrics []metric.Metric `json:"metrics"`

	// Conditions of this pod.
	Conditions []common.Condition `json:"conditions"`

	// Events is list of events associated with a pod.
	EventList common.EventList `json:"eventList"`
}

PodDetail is a presentation layer view of Kubernetes PodDetail resource. This means it is PodDetail plus additional augmented 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.

type PodList

type PodList struct {
	ListMeta common.ListMeta `json:"listMeta"`

	// Unordered list of Pods.
	Pods              []Pod           `json:"pods"`
	CumulativeMetrics []metric.Metric `json:"cumulativeMetrics"`
}

ReplicationSetList contains a list of Pods in the cluster.

func CreatePodList

func CreatePodList(pods []api.Pod, events []api.Event, dsQuery *dataselect.DataSelectQuery,
	heapsterClient client.HeapsterClient) PodList

func GetPodList

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

GetPodList returns a list of all Pods in the cluster.

func GetPodListFromChannels

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

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

type PodStatus added in v1.4.1

type PodStatus struct {
	// Status of the Pod. See Kubernetes API for reference.
	Status          string               `json:"status"`
	PodPhase        api.PodPhase         `json:"podPhase"`
	ContainerStates []api.ContainerState `json:"containerStates"`
}

Jump to

Keyboard shortcuts

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