hyper

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2016 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HYPER_PROTO       = "unix"
	HYPER_ADDR        = "/var/run/hyper.sock"
	HYPER_SCHEME      = "http"
	DEFAULT_IMAGE_TAG = "latest"

	KEY_COMMAND        = "command"
	KEY_CONTAINER_PORT = "containerPort"
	KEY_CONTAINERS     = "containers"
	KEY_DNS            = "dns"
	KEY_ENTRYPOINT     = "entrypoint"
	KEY_ENVS           = "envs"
	KEY_HOST_PORT      = "hostPort"
	KEY_HOSTNAME       = "hostname"
	KEY_ID             = "id"
	KEY_IMAGE          = "image"
	KEY_IMAGEID        = "imageId"
	KEY_IMAGENAME      = "imageName"
	KEY_ITEM           = "item"
	KEY_LABELS         = "labels"
	KEY_MEMORY         = "memory"
	KEY_MOUNTPATH      = "path"
	KEY_NAME           = "name"
	KEY_POD_ID         = "podId"
	KEY_POD_NAME       = "podName"
	KEY_PORTS          = "ports"
	KEY_PROTOCOL       = "protocol"
	KEY_READONLY       = "readOnly"
	KEY_RESOURCE       = "resource"
	KEY_TAG            = "tag"
	KEY_TTY            = "tty"
	KEY_TYPE           = "type"
	KEY_VALUE          = "value"
	KEY_VCPU           = "vcpu"
	KEY_VOLUME         = "volume"
	KEY_VOLUME_DRIVE   = "driver"
	KEY_VOLUME_SOURCE  = "source"
	KEY_VOLUMES        = "volumes"
	KEY_WORKDIR        = "workdir"

	KEY_API_POD_UID = "k8s.hyper.sh/uid"

	TYPE_CONTAINER = "container"
	TYPE_POD       = "pod"

	VOLUME_TYPE_VFS = "vfs"
)
View Source
const (
	StatusRunning = "running"
	StatusPending = "pending"
	StatusFailed  = "failed"
	StatusSuccess = "succeeded"
)

Variables

View Source
var (
	ErrConnectionRefused = errors.New("Cannot connect to the Hyper daemon. Is 'hyperd' running on this host?")
)

Functions

func LogSymlink(containerLogsDir, podFullName, containerName, containerID string) string

LogSymlink generates symlink file path for specified container

func New

func New(runtimeHelper kubecontainer.RuntimeHelper,
	recorder record.EventRecorder,
	networkPlugin network.NetworkPlugin,
	containerRefManager *kubecontainer.RefManager,
	livenessManager proberesults.Manager,
	volumeGetter volumeGetter,
	kubeClient clientset.Interface,
	imageBackOff *util.Backoff,
	serializeImagePulls bool,
	httpClient kubetypes.HttpGetter,
	disableHyperInternalService bool,
	containerLogsDir string,
	os kubecontainer.OSInterface,
) (kubecontainer.Runtime, error)

New creates the hyper container runtime which implements the container runtime interface.

Types

type AttachToContainerOptions

type AttachToContainerOptions struct {
	Container    string
	InputStream  io.Reader
	OutputStream io.Writer
	ErrorStream  io.Writer
	TTY          bool
}

type Container

type Container struct {
	Name            string           `json:"name"`
	ContainerID     string           `json:"containerID"`
	PodID           string           `json:"podID"`
	Image           string           `json:"image"`
	ImageID         string           `json:"imageID"`
	Commands        []string         `json:"commands"`
	Args            []string         `json:"args"`
	Workdir         string           `json:"workingDir"`
	Ports           []ContainerPort  `json:"ports"`
	Environment     []EnvironmentVar `json:"env"`
	Volume          []VolumeMount    `json:"volumeMounts"`
	ImagePullPolicy string           `json:"imagePullPolicy"`
}

Pod JSON Data Structure

type ContainerLogsOptions added in v0.3.0

type ContainerLogsOptions struct {
	Container    string
	OutputStream io.Writer
	ErrorStream  io.Writer

	Follow     bool
	Since      int64
	Timestamps bool
	TailLines  int64
}

type ContainerPort

type ContainerPort struct {
	Name          string `json:"name"`
	HostPort      int    `json:"hostPort"`
	ContainerPort int    `json:"containerPort"`
	Protocol      string `json:"protocol"`
	HostIP        string `json:"hostIP"`
}

Container JSON Data Structure

type ContainerStatus

type ContainerStatus struct {
	Name        string        `json:"name"`
	ContainerID string        `json:"containerID"`
	Phase       string        `json:"phase"`
	Waiting     WaitingStatus `json:"waiting"`
	Running     RunningStatus `json:"running"`
	Terminated  TermStatus    `json:"terminated"`
}

type EnvironmentVar

type EnvironmentVar struct {
	Env   string `json:"env"`
	Value string `json:"value"`
}

type ExecInContainerOptions added in v0.3.0

type ExecInContainerOptions struct {
	Container    string
	InputStream  io.Reader
	OutputStream io.Writer
	ErrorStream  io.Writer
	Commands     []string
	TTY          bool
}

type HyperClient

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

func NewHyperClient

func NewHyperClient() *HyperClient

func (*HyperClient) Attach

func (client *HyperClient) Attach(opts AttachToContainerOptions) error

func (*HyperClient) ContainerLogs added in v0.3.0

func (client *HyperClient) ContainerLogs(opts ContainerLogsOptions) error

func (*HyperClient) CreatePod

func (client *HyperClient) CreatePod(podArgs string) (map[string]interface{}, error)

func (*HyperClient) Exec added in v0.3.0

func (client *HyperClient) Exec(opts ExecInContainerOptions) error

func (*HyperClient) GetExitCode added in v0.3.0

func (c *HyperClient) GetExitCode(container, tag string) error

func (*HyperClient) GetPodIDByName added in v0.3.0

func (client *HyperClient) GetPodIDByName(podName string) (string, error)

func (*HyperClient) GetTag added in v0.3.0

func (c *HyperClient) GetTag() string

func (*HyperClient) Info

func (client *HyperClient) Info() (map[string]interface{}, error)

func (*HyperClient) IsImagePresent

func (client *HyperClient) IsImagePresent(repo, tag string) (bool, error)

func (*HyperClient) ListContainers

func (client *HyperClient) ListContainers() ([]HyperContainer, error)

func (*HyperClient) ListImages

func (client *HyperClient) ListImages() ([]HyperImage, error)

func (*HyperClient) ListPods

func (client *HyperClient) ListPods() ([]HyperPod, error)

func (*HyperClient) ListServices

func (client *HyperClient) ListServices(podId string) ([]HyperService, error)

func (*HyperClient) PullImage

func (client *HyperClient) PullImage(image string, credential string) error

func (*HyperClient) RemoveImage

func (client *HyperClient) RemoveImage(imageID string) error

func (*HyperClient) RemovePod

func (client *HyperClient) RemovePod(podID string) error

func (*HyperClient) StartPod

func (client *HyperClient) StartPod(podID string) error

func (*HyperClient) StopPod

func (client *HyperClient) StopPod(podID string) error

func (*HyperClient) UpdatePodLabels added in v0.3.0

func (client *HyperClient) UpdatePodLabels(podId string, labels map[string]string) error

func (*HyperClient) UpdateServices

func (client *HyperClient) UpdateServices(podId string, services []HyperService) error

func (*HyperClient) Version

func (client *HyperClient) Version() (string, error)

type HyperContainer

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

type HyperImage

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

type HyperPod

type HyperPod struct {
	PodID   string
	PodName string
	VmName  string
	Status  string
	PodInfo PodInfo
}

type HyperService

type HyperService struct {
	ServiceIP   string                `json:"serviceIP"`
	ServicePort int                   `json:"servicePort"`
	Protocol    string                `json:"protocol"`
	Hosts       []HyperServiceBackend `json:"hosts"`
}

type HyperServiceBackend

type HyperServiceBackend struct {
	HostIP   string `json:"hostIP"`
	HostPort int    `json:"hostPort"`
}

type PodInfo

type PodInfo struct {
	Kind       string    `json:"kind"`
	ApiVersion string    `json:"apiVersion"`
	Vm         string    `json:"vm"`
	Spec       PodSpec   `json:"spec"`
	Status     PodStatus `json:"status"`
}

type PodSpec

type PodSpec struct {
	Volumes    []PodVolume       `json:"volumes"`
	Containers []Container       `json:"containers"`
	Labels     map[string]string `json:"labels"`
	Vcpu       int               `json:"vcpu"`
	Memory     int               `json:"memory"`
}

type PodStatus

type PodStatus struct {
	Phase      string            `json:"phase"`
	Message    string            `json:"message"`
	Reason     string            `json:"reason"`
	HostIP     string            `json:"hostIP"`
	PodIP      []string          `json:"podIP"`
	StartTime  string            `json:"startTime"`
	FinishTime string            `json:"finishTime"`
	Status     []ContainerStatus `json:"containerStatus"`
}

type PodVolume

type PodVolume struct {
	Name     string          `json:"name"`
	HostPath string          `json:"source"`
	Driver   string          `json:"driver"`
	Rbd      RBDVolumeSource `json:"rbd"`
}

type RBDVolumeSource

type RBDVolumeSource struct {
	Monitors []string `json:"monitors"`
	Image    string   `json:"image"`
	FsType   string   `json:"fsType"`
	Pool     string   `json:"pool"`
	User     string   `json:"user"`
	Keyring  string   `json:"keyring"`
	ReadOnly bool     `json:"readOnly"`
}

type RunningStatus

type RunningStatus struct {
	StartedAt string `json:"startedAt"`
}

type TermStatus

type TermStatus struct {
	ExitCode   int    `json:"exitCode"`
	Reason     string `json:"reason"`
	Message    string `json:"message"`
	StartedAt  string `json:"startedAt"`
	FinishedAt string `json:"finishedAt"`
}

type VolumeMount

type VolumeMount struct {
	Name      string `json:"name"`
	ReadOnly  bool   `json:"readOnly"`
	MountPath string `json:"mountPath"`
}

type WaitingStatus

type WaitingStatus struct {
	Reason string `json:"reason"`
}

Jump to

Keyboard shortcuts

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