knoc

package module
v0.0.0-...-e1c17e3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

README

KNoC - A Kubernetes Node to manage container lifecycle on HPC clusters

KNoC is a Virtual Kubelet Provider implementation that manages real pods and containers in a remote container runtime by supporting the lifecycle management of pods, containers and other resources in the context of Kubernetes.

Virtual Kubelet is an open source Kubernetes kubelet implementation that masquerades as a kubelet for the purposes of connecting Kubernetes to other APIs.

Remote environments include Singularity container runtime utilizing Slurm's resource management and job scheduling

Features

  • Create, delete and update pods
  • Container logs and exec
  • Get pod, pods and pod status
  • Support for EmptyDirs, Secrets and ConfigMaps

diagram

Installation

You can find all relative information in INSTALL.

Acknowledgements

We thankfully acknowledge the support of the European Commission and the Greek General Secretariat for Research and Innovation under the European High-Performance Computing Joint Undertaking (JU) through projects EUROCC (GA-951732), DEEP-SEA (GA-955606), and EUPEX (GA-101033975). The JU receives support from the European Union's Horizon 2020 research and innovation programme and France, Germany, Italy, Greece, United Kingdom, the Czech Republic, and Croatia. National contributions from the involved state members (including the Greek General Secretariat for Research and Innovation) match the JU's funding.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRemoteExecutionInstanceName

func BuildRemoteExecutionInstanceName(container v1.Container, pod *v1.Pod) string

func BuildRemoteExecutionPodName

func BuildRemoteExecutionPodName(pod *v1.Pod) string

func PrepareContainerData

func PrepareContainerData(p *KNOCProvider, ctx context.Context, client *simplessh.Client, instance_name string, container v1.Container, pod *v1.Pod) error

func RemoteExecution

func RemoteExecution(p *KNOCProvider, ctx context.Context, mode int8, imageLocation string, pod *v1.Pod, container v1.Container) error

Types

type KNOCConfig

type KNOCConfig struct {
	CPU    string `json:"cpu,omitempty"`
	Memory string `json:"memory,omitempty"`
	Pods   string `json:"pods,omitempty"`
}

type KNOCProvider

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

KNOCProvider implements the virtual-kubelet provider interface and stores pods in memory.

func NewProvider

func NewProvider(providerConfig, nodeName, operatingSystem string, internalIP string, rm *manager.ResourceManager, daemonEndpointPort int32) (*KNOCProvider, error)

NewProvider creates a new Provider, which implements the PodNotifier interface

func NewProviderConfig

func NewProviderConfig(config KNOCConfig, nodeName, operatingSystem string, internalIP string, rm *manager.ResourceManager, daemonEndpointPort int32) (*KNOCProvider, error)

NewProviderConfig creates a new KNOCV0Provider. KNOC legacy provider does not implement the new asynchronous podnotifier interface

func (*KNOCProvider) ConfigureNode

func (p *KNOCProvider) ConfigureNode(ctx context.Context, n *v1.Node)

func (*KNOCProvider) CreatePod

func (p *KNOCProvider) CreatePod(ctx context.Context, pod *v1.Pod) error

CreatePod accepts a Pod definition and stores it in memory.

func (*KNOCProvider) DeletePod

func (p *KNOCProvider) DeletePod(ctx context.Context, pod *v1.Pod) (err error)

DeletePod deletes the specified pod out of memory.

func (*KNOCProvider) GetContainerLogs

func (p *KNOCProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)

GetContainerLogs retrieves the logs of a container by name from the provider.

func (*KNOCProvider) GetPod

func (p *KNOCProvider) GetPod(ctx context.Context, namespace, name string) (pod *v1.Pod, err error)

GetPod returns a pod by name that is stored in memory.

func (*KNOCProvider) GetPodStatus

func (p *KNOCProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)

GetPodStatus returns the status of a pod by name that is "running". returns nil if a pod by that name is not found.

func (*KNOCProvider) GetPods

func (p *KNOCProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)

GetPods returns a list of all pods known to be "running".

func (*KNOCProvider) GetStatsSummary

func (p *KNOCProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)

GetStatsSummary returns dummy stats for all pods known by this provider.

func (*KNOCProvider) NotifyPods

func (p *KNOCProvider) NotifyPods(ctx context.Context, f func(*v1.Pod))

NotifyPods is called to set a pod notifier callback function. This should be called before any operations are done within the provider.

func (*KNOCProvider) RunInContainer

func (p *KNOCProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, attach api.AttachIO) error

RunInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.

func (*KNOCProvider) UpdatePod

func (p *KNOCProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error

UpdatePod accepts a Pod definition and updates its reference.

Directories

Path Synopsis
cmd
internal
manager
Package manager provides access to kubernetes resources for providers.
Package manager provides access to kubernetes resources for providers.
test
e2e

Jump to

Keyboard shortcuts

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