provider

package
v1.5.1 Latest Latest
Warning

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

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

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Copyright (c) Microsoft Corporation. Licensed under the Apache 2.0 license.

Index

Constants

View Source
const (

	// AzureFileDriverName is the name of the CSI driver for Azure File
	AzureFileDriverName = "file.csi.azure.com"
)

Variables

This section is empty.

Functions

func NewAKSCredential

func NewAKSCredential(p string) (*aksCredential, error)

NewAKSCredential returns an aksCredential struct from file path

Types

type ACIProvider

type ACIProvider struct {
	*metrics.ACIPodMetricsProvider
	// contains filtered or unexported fields
}

ACIProvider implements the virtual-kubelet provider interface and communicates with Azure's ACI APIs.

func NewACIProvider

func NewACIProvider(ctx context.Context, config string, azConfig auth.Config, azAPIs client.AzClientsInterface, rm *manager.ResourceManager, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32, clusterDomain string) (*ACIProvider, error)

NewACIProvider creates a new ACIProvider.

func (*ACIProvider) CleanupPod

func (p *ACIProvider) CleanupPod(ctx context.Context, ns, name string) error

CleanupPod interface impl

func (*ACIProvider) ConfigureNode

func (p *ACIProvider) ConfigureNode(ctx context.Context, node *v1.Node)

ConfigureNode enables a provider to configure the node object that will be used for Kubernetes.

func (*ACIProvider) CreatePod

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

CreatePod accepts a Pod definition and creates an ACI deployment

func (*ACIProvider) DeletePod

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

DeletePod deletes the specified pod out of ACI.

func (*ACIProvider) FetchPodStatus

func (p *ACIProvider) FetchPodStatus(ctx context.Context, ns, name string) (*v1.PodStatus, error)

FetchPodStatus interface impl

func (*ACIProvider) GetContainerLogs

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

GetContainerLogs returns the logs of a pod by name that is running inside ACI.

func (*ACIProvider) GetPod

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

GetPod returns a pod by name that is running inside ACI returns nil if a pod by that name is not found.

func (*ACIProvider) GetPodFullName

func (p *ACIProvider) GetPodFullName(namespace string, pod string) string

GetPodFullName as defined in the provider context

func (*ACIProvider) GetPodStatus

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

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

func (*ACIProvider) GetPods

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

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

func (*ACIProvider) ListActivePods

func (p *ACIProvider) ListActivePods(ctx context.Context) ([]PodIdentifier, error)

ListActivePods interface impl.

func (*ACIProvider) NotifyPods

func (p *ACIProvider) NotifyPods(ctx context.Context, notifierCb func(*v1.Pod))

NotifyPods instructs the notifier to call the passed in function when the pod status changes. The provided pointer to a Pod is guaranteed to be used in a read-only fashion.

func (*ACIProvider) Ping

func (p *ACIProvider) Ping(ctx context.Context) error

Ping checks if the node is still active/ready.

func (*ACIProvider) RunInContainer

func (p *ACIProvider) 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 (*ACIProvider) UpdatePod

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

UpdatePod is a noop, ACI currently does not support live updates of a pod.

type AuthConfig

type AuthConfig struct {
	Username      string `json:"username,omitempty"`
	Password      string `json:"password,omitempty"`
	Auth          string `json:"auth,omitempty"`
	Email         string `json:"email,omitempty"`
	ServerAddress string `json:"serveraddress,omitempty"`
	IdentityToken string `json:"identitytoken,omitempty"`
	RegistryToken string `json:"registrytoken,omitempty"`
}

AuthConfig is the secret returned from an ImageRegistryCredential

type DockerConfig

type DockerConfig map[string]DockerConfigEntry

DockerConfig represents the config file used by the docker CLI. This config that represents the credentials that should be used when pulling images from specific image repositories.

type DockerConfigEntry

type DockerConfigEntry struct {
	Username string
	Password string
	Email    string
}

DockerConfigEntry wraps a docker config as a entry

func (DockerConfigEntry) MarshalJSON

func (ident DockerConfigEntry) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*DockerConfigEntry) UnmarshalJSON

func (ident *DockerConfigEntry) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths DockerConfig `json:"auths"`
	// +optional
	HTTPHeaders map[string]string `json:"HttpHeaders,omitempty"`
}

DockerConfigJSON represents ~/.docker/config.json file info see https://github.com/docker/docker/pull/12009

type PodIdentifier

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

type PodsTracker

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

func (*PodsTracker) StartTracking

func (pt *PodsTracker) StartTracking(ctx context.Context)

StartTracking starts the background tracking for created pods.

func (*PodsTracker) UpdatePodStatus

func (pt *PodsTracker) UpdatePodStatus(ctx context.Context, ns, name string, updateHandler func(*v1.PodStatus), forceUpdate bool) error

UpdatePodStatus updates the status of a pod, by posting to update callback.

type PodsTrackerHandler

type PodsTrackerHandler interface {
	ListActivePods(ctx context.Context) ([]PodIdentifier, error)
	FetchPodStatus(ctx context.Context, ns, name string) (*v1.PodStatus, error)
	CleanupPod(ctx context.Context, ns, name string) error
}

Jump to

Keyboard shortcuts

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