provider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ComponentName = "macos-vz-kubelet"

	// Timeout for deleting VZ group on failure.
	DefaultDeleteVZGroupGracePeriodSeconds int64 = 10
)
View Source
const (
	// DefaultPods is the default number of pods that can be run on a node.
	// Limiting number of pods to Apple Virtualization.framework internal limit
	DefaultPods = resourcemanager.MaxVirtualMachines

	// LabelCPUModelName is the label name for the CPU model name
	LabelCPUModelName = "feature.node.kubernetes.io/cpu-model.name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MacOSVZProvider

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

func NewMacOSVZProvider

func NewMacOSVZProvider(ctx context.Context, vzClient client.VzClientInterface, config MacOSVZProviderConfig) (p *MacOSVZProvider, err error)

NewMacOSVZProvider creates a new MacOSVZ provider.

func (*MacOSVZProvider) AttachToContainer

func (p *MacOSVZProvider) AttachToContainer(ctx context.Context, namespace, podName, containerName string, attach api.AttachIO) (err error)

AttachToContainer attaches to the executing process of a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.

func (*MacOSVZProvider) ConfigureNode

func (p *MacOSVZProvider) ConfigureNode(ctx context.Context, n *corev1.Node) error

ConfigureNode takes a Kubernetes node object and applies provider specific configurations to the object.

func (*MacOSVZProvider) CreatePod

func (p *MacOSVZProvider) CreatePod(ctx context.Context, pod *corev1.Pod) (err error)

CreatePod takes a Kubernetes Pod and deploys it within the MacOS provider.

func (*MacOSVZProvider) DeletePod

func (p *MacOSVZProvider) DeletePod(ctx context.Context, pod *corev1.Pod) (err error)

DeletePod takes a Kubernetes Pod and deletes it from the provider.

func (*MacOSVZProvider) GetContainerLogs

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

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

func (*MacOSVZProvider) GetMetricsResource

func (p *MacOSVZProvider) GetMetricsResource(ctx context.Context) (mf []*dto.MetricFamily, err error)

GetMetricsResource gets the metrics for the node, including running pods

func (*MacOSVZProvider) GetPod

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

GetPod retrieves a pod by name from the provider (can be cached).

func (*MacOSVZProvider) GetPodStatus

func (p *MacOSVZProvider) GetPodStatus(ctx context.Context, namespace, name string) (ps *corev1.PodStatus, err error)

GetPodStatus retrieves the status of a pod by name from the provider.

func (*MacOSVZProvider) GetPods

func (p *MacOSVZProvider) GetPods(ctx context.Context) (pods []*corev1.Pod, err error)

GetPods retrieves a list of all pods running on the provider (can be cached).

func (*MacOSVZProvider) GetStatsSummary

func (p *MacOSVZProvider) GetStatsSummary(ctx context.Context) (s *statsv1alpha1.Summary, err error)

GetStatsSummary gets the stats for the node, including running pods

func (*MacOSVZProvider) PortForward

func (p *MacOSVZProvider) PortForward(ctx context.Context, namespace, pod string, port int32, stream io.ReadWriteCloser) (err error)

PortForward forwards a local port to a port on the pod

func (*MacOSVZProvider) RunInContainer

func (p *MacOSVZProvider) RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, attach api.AttachIO) (err 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 (*MacOSVZProvider) UpdatePod

func (p *MacOSVZProvider) UpdatePod(ctx context.Context, pod *corev1.Pod) (err error)

UpdatePod takes a Kubernetes Pod and updates it within the provider.

type MacOSVZProviderConfig

type MacOSVZProviderConfig struct {
	NodeName           string
	Platform           string
	InternalIP         string
	DaemonEndpointPort int32

	K8sClient     kubernetes.Interface
	EventRecorder event.EventRecorder
	PodsLister    corev1listers.PodLister
}

Jump to

Keyboard shortcuts

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