Documentation ¶
Index ¶
- type CCIMock
- type CCIProvider
- func (p *CCIProvider) Capacity() v1.ResourceList
- func (p *CCIProvider) CreatePod(pod *v1.Pod) error
- func (p *CCIProvider) DeletePod(pod *v1.Pod) error
- func (p *CCIProvider) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, ...) error
- func (p *CCIProvider) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)
- func (p *CCIProvider) GetPod(namespace, name string) (*v1.Pod, error)
- func (p *CCIProvider) GetPodFullName(namespace string, pod string) string
- func (p *CCIProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)
- func (p *CCIProvider) GetPods() ([]*v1.Pod, error)
- func (p *CCIProvider) NodeAddresses() []v1.NodeAddress
- func (p *CCIProvider) NodeConditions() []v1.NodeCondition
- func (p *CCIProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints
- func (p *CCIProvider) OperatingSystem() string
- func (p *CCIProvider) UpdatePod(pod *v1.Pod) error
- type Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CCIMock ¶
type CCIMock struct { OnCreateProject func(*v1.Namespace) (int, interface{}) OnCreatePod func(*v1.Pod) (int, interface{}) OnGetPods func() (int, interface{}) OnGetPod func(string, string) (int, interface{}) // contains filtered or unexported fields }
CCIMock implements a CCI service mock server.
func (*CCIMock) GetServerURL ¶
GetServerURL returns the mock server URL.
type CCIProvider ¶
type CCIProvider struct {
// contains filtered or unexported fields
}
CCIProvider implements the virtual-kubelet provider interface and communicates with Huawei's CCI APIs.
func NewCCIProvider ¶
func NewCCIProvider(config string, rm *manager.ResourceManager, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*CCIProvider, error)
NewCCIProvider creates a new CCI provider.
func (*CCIProvider) Capacity ¶
func (p *CCIProvider) Capacity() v1.ResourceList
Capacity returns a resource list with the capacity constraints of the huawei CCI provider.
func (*CCIProvider) CreatePod ¶
func (p *CCIProvider) CreatePod(pod *v1.Pod) error
CreatePod takes a Kubernetes Pod and deploys it within the huawei CCI provider.
func (*CCIProvider) DeletePod ¶
func (p *CCIProvider) DeletePod(pod *v1.Pod) error
DeletePod takes a Kubernetes Pod and deletes it from the huawei CCI provider.
func (*CCIProvider) ExecInContainer ¶
func (p *CCIProvider) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error
ExecInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr. TODO: Implementation
func (*CCIProvider) GetContainerLogs ¶
func (p *CCIProvider) GetContainerLogs(namespace, podName, containerName string, tail int) (string, error)
GetContainerLogs retrieves the logs of a container by name from the huawei CCI provider.
func (*CCIProvider) GetPod ¶
func (p *CCIProvider) GetPod(namespace, name string) (*v1.Pod, error)
GetPod retrieves a pod by name from the huawei CCI provider.
func (*CCIProvider) GetPodFullName ¶
func (p *CCIProvider) GetPodFullName(namespace string, pod string) string
Get full pod name as defined in the provider context TODO: Implementation
func (*CCIProvider) GetPodStatus ¶
func (p *CCIProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)
GetPodStatus retrieves the status of a pod by name from the huawei CCI provider.
func (*CCIProvider) GetPods ¶
func (p *CCIProvider) GetPods() ([]*v1.Pod, error)
GetPods retrieves a list of all pods running on the huawei CCI provider.
func (*CCIProvider) NodeAddresses ¶
func (p *CCIProvider) NodeAddresses() []v1.NodeAddress
NodeAddresses returns a list of addresses for the node status within Kubernetes.
func (*CCIProvider) NodeConditions ¶
func (p *CCIProvider) NodeConditions() []v1.NodeCondition
NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), which is polled periodically to update the node status within Kubernetes.
func (*CCIProvider) NodeDaemonEndpoints ¶
func (p *CCIProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints
NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status within Kubernetes.
func (*CCIProvider) OperatingSystem ¶
func (p *CCIProvider) OperatingSystem() string
OperatingSystem returns the operating system the huawei CCI provider is for.