agent

package
v0.0.0-...-721f655 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package agent introduces the agent which would communicate with node's container runtime, and the client for it.

Index

Constants

View Source
const URLHealth = "/healthz"

URLHealth is the HTTP endpoint for health check.

View Source
const URLImageLoad = "/image/load"

URLImageLoad is the default HTTP endpoint for loading the container image. TODO: move HTTP server from cmd/kubectl-image-agent to here.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application is the core component for command kubectl-image-agent.

func NewApplication

func NewApplication(listenAddress string, remote containerruntime.Remote, logger logr.Logger) *Application

NewApplication is the constructor for Application.

func (*Application) Start

func (it *Application) Start(ctx context.Context) error

Start would start the application with given context.

type Client

type Client interface {
	// Health execute the health check for target kubectl-image-agent.
	Health(ctx context.Context) (bool, error)

	// LoadImage loads the image into the nodes which running kubectl-image-agent.
	LoadImage(ctx context.Context, imageContent io.Reader) error

	// ListImage return all the existed container images
	ListImage(ctx context.Context) ([]ContainerImage, error)
}

Client is the interface to interact with each kubectl-image-agent.

type ContainerImage

type ContainerImage struct {
	Repository string
	Tag        string
	Digest     string
	ImageID    string
	Created    time.Time
	Size       int64
}

type HTTPClient

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

HTTPClient is the default implementation of the Client interface.

func NewHTTPClient

func NewHTTPClient(address string, logger logr.Logger) *HTTPClient

NewHTTPClient is the constructor for the HTTPClient.

func (*HTTPClient) Health

func (it *HTTPClient) Health(ctx context.Context) (bool, error)

Health implements the agent.Client interface.

func (*HTTPClient) LoadImage

func (it *HTTPClient) LoadImage(ctx context.Context, imageContent io.Reader) error

LoadImage implements the agent.Client interface.

Directories

Path Synopsis
container
runtime
Package runtime provides basic interfaces to interact with the different container runtimes.
Package runtime provides basic interfaces to interact with the different container runtimes.
Package provisioner provides the tools to setup the `kubectl-image-agent` on the target kubernetes cluster.
Package provisioner provides the tools to setup the `kubectl-image-agent` on the target kubernetes cluster.

Jump to

Keyboard shortcuts

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