Documentation ¶
Index ¶
- Constants
- Variables
- func LogSymlink(containerLogsDir, podFullName, containerName, containerID string) string
- func New(runtimeHelper kubecontainer.RuntimeHelper, recorder record.EventRecorder, ...) (kubecontainer.Runtime, error)
- type AttachToContainerOptions
- type Container
- type ContainerLogsOptions
- type ContainerPort
- type ContainerStatus
- type EnvironmentVar
- type ExecInContainerOptions
- type HyperClient
- func (client *HyperClient) Attach(opts AttachToContainerOptions) error
- func (client *HyperClient) ContainerLogs(opts ContainerLogsOptions) error
- func (client *HyperClient) CreatePod(podArgs string) (map[string]interface{}, error)
- func (client *HyperClient) Exec(opts ExecInContainerOptions) error
- func (c *HyperClient) GetExitCode(container, tag string) error
- func (client *HyperClient) GetPodIDByName(podName string) (string, error)
- func (c *HyperClient) GetTag() string
- func (client *HyperClient) Info() (map[string]interface{}, error)
- func (client *HyperClient) IsImagePresent(repo, tag string) (bool, error)
- func (client *HyperClient) ListContainers() ([]HyperContainer, error)
- func (client *HyperClient) ListImages() ([]HyperImage, error)
- func (client *HyperClient) ListPods() ([]HyperPod, error)
- func (client *HyperClient) ListServices(podId string) ([]HyperService, error)
- func (client *HyperClient) PullImage(image string, credential string) error
- func (client *HyperClient) RemoveImage(imageID string) error
- func (client *HyperClient) RemovePod(podID string) error
- func (client *HyperClient) StartPod(podID string) error
- func (client *HyperClient) StopPod(podID string) error
- func (client *HyperClient) UpdatePodLabels(podId string, labels map[string]string) error
- func (client *HyperClient) UpdateServices(podId string, services []HyperService) error
- func (client *HyperClient) Version() (string, error)
- type HyperContainer
- type HyperImage
- type HyperPod
- type HyperService
- type HyperServiceBackend
- type PodInfo
- type PodSpec
- type PodStatus
- type PodVolume
- type RBDVolumeSource
- type RunningStatus
- type TermStatus
- type VolumeMount
- type WaitingStatus
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 ¶ added in v0.3.0
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 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 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 ExecInContainerOptions ¶ added in v0.3.0
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 HyperService ¶
type HyperService struct { ServiceIP string `json:"serviceIP"` ServicePort int `json:"servicePort"` Protocol string `json:"protocol"` Hosts []HyperServiceBackend `json:"hosts"` }
type HyperServiceBackend ¶
type PodVolume ¶
type PodVolume struct { Name string `json:"name"` HostPath string `json:"source"` Driver string `json:"driver"` Rbd RBDVolumeSource `json:"rbd"` }
type RBDVolumeSource ¶
type RunningStatus ¶
type RunningStatus struct {
StartedAt string `json:"startedAt"`
}
type TermStatus ¶
type VolumeMount ¶
type WaitingStatus ¶
type WaitingStatus struct {
Reason string `json:"reason"`
}
Click to show internal directories.
Click to hide internal directories.