kubernetes

package
v0.0.0-...-5a253b8 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePodIp

func ChangePodIp(newPodCidr string, oldPodIp string) (newPodIp string)

func F2HTranslate

func F2HTranslate(podForeignIn *v1.Pod, newCidr, namespace string) (podHomeOut *v1.Pod)

func FilterVolumeMounts

func FilterVolumeMounts(volumes []v1.Volume, volumeMountsIn []v1.VolumeMount) []v1.VolumeMount

remove from volumeMountsIn all the volumeMounts with name not contained in volumes

func FilterVolumes

func FilterVolumes(volumesIn []v1.Volume) []v1.Volume

func H2FTranslate

func H2FTranslate(pod *v1.Pod, nattedNS string) *v1.Pod

Types

type KubernetesProvider

type KubernetesProvider struct {
	*Reflector

	RemoteRemappedPodCidr string
	LocalRemappedPodCidr  string
	// contains filtered or unexported fields
}

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

func NewKubernetesProvider

func NewKubernetesProvider(nodeName, clusterId, homeClusterId, operatingSystem string, internalIP string, daemonEndpointPort int32, kubeconfig, remoteKubeConfig string) (*KubernetesProvider, error)

NewKubernetesProviderKubernetesConfig creates a new KubernetesV0Provider. Kubernetes legacy provider does not implement the new asynchronous podnotifier interface

func (*KubernetesProvider) AddPodWatcher

func (p *KubernetesProvider) AddPodWatcher(namespace string, stop chan struct{}) error

func (*KubernetesProvider) ConfigureNode

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

func (*KubernetesProvider) ConfigureReflection

func (p *KubernetesProvider) ConfigureReflection() error

func (*KubernetesProvider) CreatePod

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

CreatePod accepts a Pod definition and stores it in memory.

func (*KubernetesProvider) DeNatNamespace

func (p *KubernetesProvider) DeNatNamespace(namespace string) (string, error)

func (*KubernetesProvider) DeletePod

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

DeletePod deletes the specified pod out of memory.

func (*KubernetesProvider) GetContainerLogs

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

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

func (*KubernetesProvider) GetPod

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

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

func (*KubernetesProvider) GetPodStatus

func (p *KubernetesProvider) 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 (*KubernetesProvider) GetPods

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

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

func (*KubernetesProvider) GetStatsSummary

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

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

func (*KubernetesProvider) NatNamespace

func (p *KubernetesProvider) NatNamespace(namespace string, create bool) (string, error)

func (*KubernetesProvider) NotifyPods

func (p *KubernetesProvider) NotifyPods(ctx context.Context, notifier func(*v1.Pod))

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

func (*KubernetesProvider) ReconcileNodeFromAdv

func (p *KubernetesProvider) ReconcileNodeFromAdv(event watch.Event)

The reconciliation function; every time this function is called, the node status is updated by means of r.updateFromAdv

func (*KubernetesProvider) ReconcileNodeFromTep

func (p *KubernetesProvider) ReconcileNodeFromTep(event watch.Event)

func (*KubernetesProvider) RunInContainer

func (p *KubernetesProvider) RunInContainer(ctx context.Context, namespace string, podName string, containerName 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 (*KubernetesProvider) StartNodeUpdater

func (p *KubernetesProvider) StartNodeUpdater(nodeRunner *node.NodeController) (chan struct{}, chan struct{}, error)

func (*KubernetesProvider) StartReflector

func (p *KubernetesProvider) StartReflector()

StartReflector initializes all the data structures and creates a new goroutine running the reflector control loop

func (*KubernetesProvider) StopReflector

func (p *KubernetesProvider) StopReflector()

StopReflector must be called when the virtual kubelet end up: all the channels are correctly closed and the eventsAggregator goroutines closing are waited

func (*KubernetesProvider) UpdatePod

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

UpdatePod accepts a Pod definition and updates its reference.

type Reflector

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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