Documentation ¶
Index ¶
- Variables
- func GetEventsForPod(client client.Interface, dsQuery *dataselect.DataSelectQuery, ...) (*common.EventList, error)
- type Container
- type EnvVar
- type MetricsByPod
- type Pod
- type PodCell
- type PodDetail
- type PodList
- func GetPodList(client k8sClient.Interface, metricClient metricapi.MetricClient, ...) (*PodList, error)
- func GetPodListFromChannels(channels *common.ResourceChannels, dsQuery *dataselect.DataSelectQuery, ...) (*PodList, error)
- func ToPodList(pods []v1.Pod, events []v1.Event, nonCriticalErrors []error, ...) PodList
- type PodMetrics
- type PodStatus
Constants ¶
This section is empty.
Variables ¶
Functions ¶
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 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 *v1.EnvVarSource `json:"valueFrom"` }
EnvVar represents an environment variable of a container.
type MetricsByPod ¶
type MetricsByPod struct { // Metrics by namespace and name of a pod. MetricsMap map[types.UID]PodMetrics `json:"metricsMap"` }
MetricsByPod is a metrics map by pod name.
type Pod ¶
type Pod struct { ObjectMeta api.ObjectMeta `json:"objectMeta"` TypeMeta api.TypeMeta `json:"typeMeta"` // More info on pod status PodStatus PodStatus `json:"podStatus"` // Count of containers restarts. RestartCount int32 `json:"restartCount"` // Pod metrics. Metrics *PodMetrics `json:"metrics"` // Pod warning events Warnings []common.Event `json:"warnings"` // Name of the Node this Pod runs on. NodeName string `json:"nodeName"` }
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).
type PodCell ¶ added in v1.4.0
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() *metricapi.ResourceSelector
type PodDetail ¶
type PodDetail struct { ObjectMeta api.ObjectMeta `json:"objectMeta"` TypeMeta api.TypeMeta `json:"typeMeta"` // Status of the Pod. See Kubernetes API for reference. PodPhase v1.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.ResourceOwner `json:"controller"` // List of container of this pod. Containers []Container `json:"containers"` // List of initContainer of this pod. InitContainers []Container `json:"initContainers"` // Metrics collected for this resource Metrics []metricapi.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"` // List of non-critical errors, that occurred during resource retrieval. Errors []error `json:"errors"` }
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 kubernetes.Interface, metricClient metricapi.MetricClient, namespace, name string) (*PodDetail, error)
GetPodDetail returns the details (PodDetail) of a named Pod from a particular namespace. TODO(maciaszczykm): Owner reference should be used instead of created by annotation.
type PodList ¶
type PodList struct { ListMeta api.ListMeta `json:"listMeta"` CumulativeMetrics []metricapi.Metric `json:"cumulativeMetrics"` // Unordered list of Pods. Pods []Pod `json:"pods"` // List of non-critical errors, that occurred during resource retrieval. Errors []error `json:"errors"` }
PodList contains a list of Pods in the cluster.
func GetPodList ¶
func GetPodList(client k8sClient.Interface, metricClient metricapi.MetricClient, 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, metricClient metricapi.MetricClient) (*PodList, error)
GetPodListFromChannels returns a list of all Pods in the cluster reading required resource list once from the channels.
func ToPodList ¶ added in v1.6.2
func ToPodList(pods []v1.Pod, events []v1.Event, nonCriticalErrors []error, dsQuery *dataselect.DataSelectQuery, metricClient metricapi.MetricClient) PodList
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 []metricapi.MetricPoint `json:"cpuUsageHistory"` // Timestamped samples of pod memory usage over some short period of history MemoryUsageHistory []metricapi.MetricPoint `json:"memoryUsageHistory"` }
PodMetrics is a structure representing pods metrics, contains information about CPU and memory usage.