Documentation
¶
Index ¶
- Constants
- func NewPod(name, ip string, status PodStatus) (*v1.Pod, error)
- type MiniKube
- func (m *MiniKube) AddPod(namespace string, pod *v1.Pod, cni bool) error
- func (m *MiniKube) DelPod(namespace string, podName string, cni bool) error
- func (m *MiniKube) GetAllPod() ([]*v1.Pod, error)
- func (m *MiniKube) GetPod(namespace, podName string) (*v1.Pod, error)
- func (m *MiniKube) GetPodByNamespace(namespace string) ([]*v1.Pod, error)
- type Option
- type PodStatus
Constants ¶
View Source
const ( PodPending PodStatus = "Pending" PodRunning = "Running" PodSucceeded = "Succeeded" PodFailed = "Failed" PodUnknown = "Unknown" )
pod Pod.Status.Phase
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MiniKube ¶
type MiniKube struct {
// contains filtered or unexported fields
}
MiniKube miniKube主要功能: 1. 创建 pod 可以 调用 cni 插件 add 并打印相关信息 2. 删除 pod 可以调用 cni 插件 del 3. 获取 pod 列表
func NewMiniKube ¶
NewMiniKube 声明新的kube client.
Use demo: miniKube,err:=NewMiniKube(etcdCli,WithDBKeyPrefix("/test/db/prefix"))
func (*MiniKube) AddPod ¶
AddPod 添加一个 pod 并且 支持 同时调用cni add. namespace: 命名空间 pod: pod 信息 cni: 是否调用cni
Click to show internal directories.
Click to hide internal directories.