Documentation ¶
Index ¶
- Constants
- func AddSubscribe(ch chan ProcessEvent)
- func ExistDir(dirname string) bool
- func ImageLatest(image string) bool
- func UnTar(src string, dest string) error
- type BaseProcessEvent
- type ContainerProcess
- type ContainerProcessFinish
- type ContainerProcessRun
- type DownloadResource
- type ImageManager
- type ImagePulling
- type NodeEventHandler
- type PodEventHandler
- func (p *PodEventHandler) OnContainerRun(event ContainerProcessRun, pod *v1.Pod)
- func (p *PodEventHandler) OnDownloadResource(event DownloadResource, pod *v1.Pod)
- func (p *PodEventHandler) OnFinish(event ContainerProcessFinish, pod *v1.Pod)
- func (p *PodEventHandler) OnPodStart(event PodProcessStart, pod *v1.Pod)
- type PodProcess
- type PodProcessStart
- type ProcessEvent
- type ProcessManager
- func (m *ProcessManager) Delete(store ProcessStore) error
- func (m *ProcessManager) DeletePod(ctx context.Context, pod *corev1.Pod) error
- func (m *ProcessManager) Get(key []byte) (*PodProcess, error)
- func (m *ProcessManager) Put(store ProcessStore) error
- func (m *ProcessManager) RunPod(ctx context.Context, p *corev1.Pod) error
- func (m *ProcessManager) Start(ctx context.Context) error
- func (m *ProcessManager) UpdatePod(pod *corev1.Pod) error
- type ProcessStore
- type Provider
- func (p *Provider) ConfigureNode(ctx context.Context, node *v1.Node)
- func (p *Provider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *Provider) DeletePod(ctx context.Context, pod *v1.Pod) error
- func (p *Provider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *Provider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)
- func (p *Provider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *Provider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *Provider) GetStatsSummary(ctx context.Context) (*stats.Summary, error)
- func (p *Provider) NotifyNodeStatus(ctx context.Context, f func(*v1.Node))
- func (p *Provider) NotifyPods(ctx context.Context, f func(*v1.Pod))
- func (p *Provider) Ping(ctx context.Context) error
- func (p *Provider) RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, ...) error
- func (p *Provider) UpdatePod(ctx context.Context, pod *v1.Pod) error
- type PullImageOpts
Constants ¶
View Source
const ( DbPath = "data" ImagePath = "images" ContainerPath = "containers" )
View Source
const ImageLatestSuffix = ":LATEST"
View Source
const PodPrefix = "pod://"
View Source
const STDOUT = "STDOUT"
Variables ¶
This section is empty.
Functions ¶
func AddSubscribe ¶
func AddSubscribe(ch chan ProcessEvent)
func ImageLatest ¶
Types ¶
type BaseProcessEvent ¶
type BaseProcessEvent struct {
// contains filtered or unexported fields
}
type ContainerProcess ¶
type ContainerProcess struct { Workdir string `json:"workdir"` PodName string `json:"pod_name"` Namespace string `json:"namespace"` Container corev1.Container `json:"container"` Sync bool `json:"sync"` RestartPolicy corev1.RestartPolicy `json:"restart_policy"` //状态信息 Pid int `json:"pid"` ImagePulled bool `json:"image_pulled"` ImageUnzipped bool `json:"image_unzipped"` ConfigMapDownload bool `json:"config_map_download"` SecretDownload bool `json:"secret_download"` // contains filtered or unexported fields }
序列化tag
func NewProcess ¶
func NewProcess(pod *corev1.Pod, c corev1.Container, workdir string, im *ImageManager, pm *ProcessManager, sync bool) *ContainerProcess
type ContainerProcessFinish ¶
type ContainerProcessFinish struct { ProcessEvent // contains filtered or unexported fields }
type ContainerProcessRun ¶
type ContainerProcessRun struct { ProcessEvent // contains filtered or unexported fields }
type DownloadResource ¶
type DownloadResource struct {
BaseProcessEvent
}
type ImageManager ¶
type ImageManager struct {
// contains filtered or unexported fields
}
func NewImageManager ¶
func NewImageManager(imagePath string, db *bitcask.Bitcask, max int) *ImageManager
func (*ImageManager) PullImage ¶
func (m *ImageManager) PullImage(parentCtx context.Context, opts PullImageOpts) error
func (*ImageManager) UnzipImage ¶
type ImagePulling ¶
type ImagePulling struct {
// contains filtered or unexported fields
}
func NewImagePulling ¶
func NewImagePulling(imageName string) *ImagePulling
type NodeEventHandler ¶
type NodeEventHandler struct {
// contains filtered or unexported fields
}
type PodEventHandler ¶
type PodEventHandler struct { HostIp string // contains filtered or unexported fields }
func (*PodEventHandler) OnContainerRun ¶
func (p *PodEventHandler) OnContainerRun(event ContainerProcessRun, pod *v1.Pod)
func (*PodEventHandler) OnDownloadResource ¶
func (p *PodEventHandler) OnDownloadResource(event DownloadResource, pod *v1.Pod)
func (*PodEventHandler) OnFinish ¶
func (p *PodEventHandler) OnFinish(event ContainerProcessFinish, pod *v1.Pod)
func (*PodEventHandler) OnPodStart ¶
func (p *PodEventHandler) OnPodStart(event PodProcessStart, pod *v1.Pod)
type PodProcess ¶
type PodProcess struct { Workdir string `json:"workdir"` PodName string `json:"pod_name"` Namespace string `json:"namespace"` ProcessChain []*ContainerProcess `json:"process_chain"` Pod *corev1.Pod `json:"pod"` Index int `json:"index"` // contains filtered or unexported fields }
func (*PodProcess) Key ¶
func (p *PodProcess) Key() []byte
type PodProcessStart ¶
type PodProcessStart struct { ProcessEvent // contains filtered or unexported fields }
type ProcessEvent ¶
type ProcessEvent interface {
// contains filtered or unexported methods
}
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func NewProcessManager ¶
func NewProcessManager(workdir string, processDb *bitcask.Bitcask, im *ImageManager, record record.EventRecorder, nodeIp string, manager *manager.ResourceManager) *ProcessManager
func (*ProcessManager) Delete ¶
func (m *ProcessManager) Delete(store ProcessStore) error
func (*ProcessManager) Get ¶
func (m *ProcessManager) Get(key []byte) (*PodProcess, error)
func (*ProcessManager) Put ¶
func (m *ProcessManager) Put(store ProcessStore) error
type ProcessStore ¶
type ProcessStore interface {
Key() []byte
}
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func NewProvider ¶
func (*Provider) ConfigureNode ¶
func (*Provider) GetContainerLogs ¶
func (p *Provider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)
func (*Provider) GetPodStatus ¶
func (*Provider) GetStatsSummary ¶
func (*Provider) NotifyNodeStatus ¶
func (*Provider) RunInContainer ¶
type PullImageOpts ¶
type PullImageOpts struct { SrcImage string // docker://ccr.ccs.tencentyun.com/k8s-test/test:oci-test-v1 DockerAuthConfig *types.DockerAuthConfig DockerBearerRegistryToken string DockerRegistryUserAgent string DockerInsecureSkipTLSVerify types.OptionalBool Timeout time.Duration RetryCount int }
Click to show internal directories.
Click to hide internal directories.