Documentation ¶
Index ¶
- func ChangePodIp(newPodCidr string, oldPodIp string) (newPodIp string)
- func F2HTranslate(podForeignIn *v1.Pod, newCidr, namespace string) (podHomeOut *v1.Pod)
- func FilterVolumeMounts(volumes []v1.Volume, volumeMountsIn []v1.VolumeMount) []v1.VolumeMount
- func FilterVolumes(volumesIn []v1.Volume) []v1.Volume
- func H2FTranslate(pod *v1.Pod, nattedNS string) *v1.Pod
- type KubernetesProvider
- func (p *KubernetesProvider) AddPodWatcher(namespace string, stop chan struct{}) error
- func (p *KubernetesProvider) ConfigureNode(ctx context.Context, n *v1.Node)
- func (p *KubernetesProvider) ConfigureReflection() error
- func (p *KubernetesProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *KubernetesProvider) DeNatNamespace(namespace string) (string, error)
- func (p *KubernetesProvider) DeletePod(ctx context.Context, pod *v1.Pod) (err error)
- func (p *KubernetesProvider) GetContainerLogs(ctx context.Context, namespace string, podName string, containerName string, ...) (io.ReadCloser, error)
- func (p *KubernetesProvider) GetPod(ctx context.Context, namespace, name string) (pod *v1.Pod, err error)
- func (p *KubernetesProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *KubernetesProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *KubernetesProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)
- func (p *KubernetesProvider) NatNamespace(namespace string, create bool) (string, error)
- func (p *KubernetesProvider) NotifyPods(ctx context.Context, notifier func(*v1.Pod))
- func (p *KubernetesProvider) ReconcileNodeFromAdv(event watch.Event)
- func (p *KubernetesProvider) ReconcileNodeFromTep(event watch.Event)
- func (p *KubernetesProvider) RunInContainer(ctx context.Context, namespace string, podName string, containerName string, ...) error
- func (p *KubernetesProvider) StartNodeUpdater(nodeRunner *node.NodeController) (chan struct{}, chan struct{}, error)
- func (p *KubernetesProvider) StartReflector()
- func (p *KubernetesProvider) StopReflector()
- func (p *KubernetesProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error
- type Reflector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePodIp ¶
func F2HTranslate ¶
func FilterVolumeMounts ¶
func FilterVolumeMounts(volumes []v1.Volume, volumeMountsIn []v1.VolumeMount) []v1.VolumeMount
remove from volumeMountsIn all the volumeMounts with name not contained in volumes
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) DeNatNamespace ¶
func (p *KubernetesProvider) DeNatNamespace(namespace string) (string, error)
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) GetStatsSummary ¶
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