Documentation

Index

Constants

View Source
const (
	KubernetesPodNameLabel       = "io.kubernetes.pod.name"
	KubernetesPodNamespaceLabel  = "io.kubernetes.pod.namespace"
	KubernetesPodUIDLabel        = "io.kubernetes.pod.uid"
	KubernetesContainerNameLabel = "io.kubernetes.container.name"

	UnknownContainerStatuses = "UnknownContainerStatuses"
	PodCompleted             = "PodCompleted"
	ContainersNotReady       = "ContainersNotReady"
	ContainersNotInitialized = "ContainersNotInitialized"
)

    Pod details constants

    Variables

    This section is empty.

    Functions

    func ConvertEnvVersion

    func ConvertEnvVersion(envs []v1.EnvVar) []container.EnvVar

      ConvertEnvVersion converts environment version TODO: need consider EnvVar.ValueFrom

      func EnableHostUserNamespace

      func EnableHostUserNamespace(pod *v1.Pod) bool

        EnableHostUserNamespace checks security to enable host user namespace

        func GenerateEnvList

        func GenerateEnvList(envs []v1.EnvVar) (result []string)

          GenerateEnvList generates environments list

          func GenerateMountBindings

          func GenerateMountBindings(mounts []*container.Mount) []string

            GenerateMountBindings converts the mount list to a list of strings that can be understood by docker. '<HostPath>:<ContainerPath>[:options]', where 'options' is a comma-separated list of the following strings: 'ro', if the path is read only 'Z', if the volume requires SELinux relabeling propagation mode such as 'rslave'

            func GetContainerStatus

            func GetContainerStatus(statuses []v1.ContainerStatus, name string) (v1.ContainerStatus, bool)

              GetContainerStatus returns container status

              func GetPhase

              func GetPhase(spec *v1.PodSpec, info []v1.ContainerStatus) v1.PodPhase

                GetPhase returns pod phase

                func NewContainerRunner

                func NewContainerRunner() container.ContainerCommandRunner

                  NewContainerRunner returns container manager object TODO: we didn't realized Run In container interface yet

                  func NewKubeContainerRuntime

                  func NewKubeContainerRuntime(cm ContainerManager) container.Runtime

                    NewKubeContainerRuntime returns runtime object of container manager

                    Types

                    type ContainerManager

                    type ContainerManager interface {
                    	Start(activePods deviceplugin.ActivePodsFunc) error
                    	GetDevicePluginResourceCapacity() (v1.ResourceList, []string)
                    	UpdatePluginResources(*schedulercache.NodeInfo, *lifecycle.PodAdmitAttributes) error
                    	InitPodContainer() error
                    	StartPod(pod *v1.Pod, runOpt *kubecontainer.RunContainerOptions) error
                    	UpdatePod(pod *v1.Pod) error
                    	TerminatePod(uid types.UID) error
                    	RunInContainer(id kubecontainer.ContainerID, cmd []string, timeout time.Duration) ([]byte, error)
                    	GetPodStatusOwn(pod *v1.Pod) (*v1.PodStatus, error)
                    	GetPods(all bool) ([]*kubecontainer.Pod, error)
                    	GarbageCollect(gcPolicy kubecontainer.ContainerGCPolicy, ready bool, evictNonDeletedPods bool) error
                    	GeneratePodReadyCondition(statuses []v1.ContainerStatus) v1.PodCondition
                    	CleanupOrphanedPod(activePods []*v1.Pod)
                    }

                      ContainerManager partially derived from kubernetes/pkg/kubelet/cm.ContainerManager pruned extra interface and append our own method

                      func NewContainerManager

                      func NewContainerManager(runtimeService cri.RuntimeService, livenessManager proberesults.Manager, containerBackOff *flowcontrol.Backoff, devicePluginEnabled bool, gpuManager gpu.GPUManager, interfaceName string) (ContainerManager, error)

                        NewContainerManager initialises and returns a container manager object

                        type KubeSourcesReady

                        type KubeSourcesReady struct{}

                          KubeSourcesReady is blank structure just for function referencing

                          func (*KubeSourcesReady) AllReady

                          func (s *KubeSourcesReady) AllReady() bool

                            AllReady give ready state of Kube Sources