provider

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AADMock

type AADMock struct {
	OnAcquireToken func(http.ResponseWriter, *http.Request)
	// contains filtered or unexported fields
}

AADMock implements a AAD mock server .

func NewAADMock

func NewAADMock() *AADMock

NewAADMock creates a new AAD server mocker.

func (*AADMock) Close

func (mock *AADMock) Close()

Close terminates the AAD server mocker.

func (*AADMock) GetServerURL

func (mock *AADMock) GetServerURL() string

GetServerURL returns the mock server URL.

type ACIMock

type ACIMock struct {
	OnCreate             func(string, string, string, *aci.ContainerGroup) (int, interface{})
	OnGetContainerGroups func(string, string) (int, interface{})
	OnGetContainerGroup  func(string, string, string) (int, interface{})
	OnGetRPManifest      func() (int, interface{})
	// contains filtered or unexported fields
}

ACIMock implements a Azure Container Instance mock server.

func NewACIMock

func NewACIMock() *ACIMock

NewACIMock creates a new Azure Container Instance mock server.

func (*ACIMock) Close

func (mock *ACIMock) Close()

Close terminates the Azure Container Instance mock server.

func (*ACIMock) GetServerURL

func (mock *ACIMock) GetServerURL() string

GetServerURL returns the mock server URL.

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(config string, 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

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)

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)

PodsTrackerHandler 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 AcsCredential

type AcsCredential struct {
	Cloud                  string `json:"cloud"`
	TenantID               string `json:"tenantId"`
	SubscriptionID         string `json:"subscriptionId"`
	ClientID               string `json:"aadClientId"`
	ClientSecret           string `json:"aadClientSecret"`
	ResourceGroup          string `json:"resourceGroup"`
	Region                 string `json:"location"`
	VNetName               string `json:"vnetName"`
	VNetResourceGroup      string `json:"vnetResourceGroup"`
	UserAssignedIdentityID string `json:"userAssignedIdentityID"`
}

AcsCredential represents the credential file for ACS

func NewAcsCredential

func NewAcsCredential(p string) (*AcsCredential, error)

NewAcsCredential returns an AcsCredential struct from file path

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 added in v1.4.0

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 added in v1.4.0

type DockerConfigEntry struct {
	Username string
	Password string
	Email    string
}

DockerConfigEntry wraps a docker config as a entry

func (DockerConfigEntry) MarshalJSON added in v1.4.1

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

MarshalJSON implements the json.Marshaler interface.

func (*DockerConfigEntry) UnmarshalJSON added in v1.4.1

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

UnmarshalJSON implements the json.Unmarshaler interface.

type DockerConfigJSON added in v1.4.0

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(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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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