kubernetes: k8s.io/kubernetes/pkg/kubelet/types Index | Files

package types

import "k8s.io/kubernetes/pkg/kubelet/types"

Common types in the Kubelet.

Index

Package Files

constants.go doc.go labels.go pod_status.go pod_update.go types.go

Constants

const (
    // system default DNS resolver configuration
    ResolvConfDefault = "/etc/resolv.conf"

    // different container runtimes
    DockerContainerRuntime = "docker"
    RemoteContainerRuntime = "remote"

    // User visible keys for managing node allocatable enforcement on the node.
    NodeAllocatableEnforcementKey = "pods"
    SystemReservedEnforcementKey  = "system-reserved"
    KubeReservedEnforcementKey    = "kube-reserved"
    NodeAllocatableNoneKey        = "none"
)
const (
    KubernetesPodNameLabel       = "io.kubernetes.pod.name"
    KubernetesPodNamespaceLabel  = "io.kubernetes.pod.namespace"
    KubernetesPodUIDLabel        = "io.kubernetes.pod.uid"
    KubernetesContainerNameLabel = "io.kubernetes.container.name"
)
const (
    ConfigSourceAnnotationKey    = "kubernetes.io/config.source"
    ConfigMirrorAnnotationKey    = v1.MirrorPodAnnotationKey
    ConfigFirstSeenAnnotationKey = "kubernetes.io/config.seen"
    ConfigHashAnnotationKey      = "kubernetes.io/config.hash"
    CriticalPodAnnotationKey     = "scheduler.alpha.kubernetes.io/critical-pod"
)
const (
    // This is the current pod configuration
    SET PodOperation = iota
    // Pods with the given ids are new to this source
    ADD
    // Pods with the given ids are gracefully deleted from this source
    DELETE
    // Pods with the given ids have been removed from this source
    REMOVE
    // Pods with the given ids have been updated in this source
    UPDATE
    // Pods with the given ids have unexpected status in this source,
    // kubelet should reconcile status with this source
    RECONCILE
    // Pods with the given ids have been restored from a checkpoint.
    RESTORE

    // These constants identify the sources of pods
    // Updates from a file
    FileSource = "file"
    // Updates from querying a web page
    HTTPSource = "http"
    // Updates from Kubernetes API Server
    ApiserverSource = "api"
    // Updates from all sources
    AllSource = "*"

    NamespaceDefault = metav1.NamespaceDefault
)

Variables

var PodConditionsByKubelet = []v1.PodConditionType{
    v1.PodScheduled,
    v1.PodReady,
    v1.PodInitialized,
    v1.PodReasonUnschedulable,
    v1.ContainersReady,
}

PodConditionsByKubelet is the list of pod conditions owned by kubelet

func GetContainerName Uses

func GetContainerName(labels map[string]string) string

func GetPodName Uses

func GetPodName(labels map[string]string) string

func GetPodNamespace Uses

func GetPodNamespace(labels map[string]string) string

func GetPodSource Uses

func GetPodSource(pod *v1.Pod) (string, error)

GetPodSource returns the source of the pod based on the annotation.

func GetPodUID Uses

func GetPodUID(labels map[string]string) string

func GetValidatedSources Uses

func GetValidatedSources(sources []string) ([]string, error)

Gets all validated sources from the specified sources.

func IsCritical Uses

func IsCritical(ns string, annotations map[string]string) bool

IsCritical returns true if parameters bear the critical pod annotation key. The DaemonSetController use this key directly to make scheduling decisions. TODO: @ravig - Deprecated. Remove this when we move to resolving critical pods based on priorityClassName.

func IsCriticalPod Uses

func IsCriticalPod(pod *v1.Pod) bool

IsCriticalPod returns true if the pod bears the critical pod annotation key or if pod's priority is greater than or equal to SystemCriticalPriority. Both the default scheduler and the kubelet use this function to make admission and scheduling decisions.

func IsCriticalPodBasedOnPriority Uses

func IsCriticalPodBasedOnPriority(priority int32) bool

IsCriticalPodBasedOnPriority checks if the given pod is a critical pod based on priority resolved from pod Spec.

func PodConditionByKubelet Uses

func PodConditionByKubelet(conditionType v1.PodConditionType) bool

PodConditionByKubelet returns if the pod condition type is owned by kubelet

func Preemptable Uses

func Preemptable(preemptor, preemptee *v1.Pod) bool

Preemptable returns true if preemptor pod can preempt preemptee pod if preemptee is not critical or if preemptor's priority is greater than preemptee's priority

func SortInitContainerStatuses Uses

func SortInitContainerStatuses(p *v1.Pod, statuses []v1.ContainerStatus)

SortInitContainerStatuses ensures that statuses are in the order that their init container appears in the pod spec

type HttpGetter Uses

type HttpGetter interface {
    Get(url string) (*http.Response, error)
}

type MirrorPodUID Uses

type MirrorPodUID types.UID

A pod UID for a mirror pod.

type PodOperation Uses

type PodOperation int

PodOperation defines what changes will be made on a pod configuration.

type PodUpdate Uses

type PodUpdate struct {
    Pods   []*v1.Pod
    Op     PodOperation
    Source string
}

PodUpdate defines an operation sent on the channel. You can add or remove single services by sending an array of size one and Op == ADD|REMOVE (with REMOVE, only the ID is required). For setting the state of the system to a given state for this source configuration, set Pods as desired and Op to SET, which will reset the system state to that specified in this operation for this source channel. To remove all pods, set Pods to empty object and Op to SET.

Additionally, Pods should never be nil - it should always point to an empty slice. While functionally similar, this helps our unit tests properly check that the correct PodUpdates are generated.

type Reservation Uses

type Reservation struct {
    // System represents resources reserved for non-kubernetes components.
    System v1.ResourceList
    // Kubernetes represents resources reserved for kubernetes system components.
    Kubernetes v1.ResourceList
}

Reservation represents reserved resources for non-pod components.

type ResolvedPodUID Uses

type ResolvedPodUID types.UID

A pod UID which has been translated/resolved to the representation known to kubelets.

type SortedContainerStatuses Uses

type SortedContainerStatuses []v1.ContainerStatus

A type to help sort container statuses based on container names.

func (SortedContainerStatuses) Len Uses

func (s SortedContainerStatuses) Len() int

func (SortedContainerStatuses) Less Uses

func (s SortedContainerStatuses) Less(i, j int) bool

func (SortedContainerStatuses) Swap Uses

func (s SortedContainerStatuses) Swap(i, j int)

type SyncPodType Uses

type SyncPodType int

SyncPodType classifies pod updates, eg: create, update.

const (
    // SyncPodSync is when the pod is synced to ensure desired state
    SyncPodSync SyncPodType = iota
    // SyncPodUpdate is when the pod is updated from source
    SyncPodUpdate
    // SyncPodCreate is when the pod is created from source
    SyncPodCreate
    // SyncPodKill is when the pod is killed based on a trigger internal to the kubelet for eviction.
    // If a SyncPodKill request is made to pod workers, the request is never dropped, and will always be processed.
    SyncPodKill
)

func (SyncPodType) String Uses

func (sp SyncPodType) String() string

type Timestamp Uses

type Timestamp struct {
    // contains filtered or unexported fields
}

Timestamp wraps around time.Time and offers utilities to format and parse the time using RFC3339Nano

func ConvertToTimestamp Uses

func ConvertToTimestamp(timeString string) *Timestamp

ConvertToTimestamp takes a string, parses it using the RFC3339Nano layout, and converts it to a Timestamp object.

func NewTimestamp Uses

func NewTimestamp() *Timestamp

NewTimestamp returns a Timestamp object using the current time.

func (*Timestamp) Get Uses

func (t *Timestamp) Get() time.Time

Get returns the time as time.Time.

func (*Timestamp) GetString Uses

func (t *Timestamp) GetString() string

GetString returns the time in the string format using the RFC3339Nano layout.

Package types imports 10 packages (graph) and is imported by 1399 packages. Updated 2019-07-19. Refresh now. Tools for package owners.