Documentation ¶
Index ¶
- Constants
- func ConvertEnvVersion(envs []v1.EnvVar) []container.EnvVar
- func EnableHostUserNamespace(pod *v1.Pod) bool
- func GenerateEnvList(envs []v1.EnvVar) (result []string)
- func GenerateMountBindings(mounts []*container.Mount) []string
- func GetContainerStatus(statuses []v1.ContainerStatus, name string) (v1.ContainerStatus, bool)
- func GetPhase(spec *v1.PodSpec, info []v1.ContainerStatus) v1.PodPhase
- func NewContainerRunner() container.ContainerCommandRunner
- func NewKubeContainerRuntime(cm ContainerManager) container.Runtime
- type ContainerManager
- type KubeSourcesReady
Constants ¶
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 ¶
ConvertEnvVersion converts environment version TODO: need consider EnvVar.ValueFrom
func EnableHostUserNamespace ¶
EnableHostUserNamespace checks security to enable host user namespace
func GenerateEnvList ¶
GenerateEnvList generates environments list
func GenerateMountBindings ¶
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 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