Documentation ¶
Index ¶
- type CCIMock
- type CCIProvider
- func (p *CCIProvider) Capacity(ctx context.Context) v1.ResourceList
- func (p *CCIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *CCIProvider) DeletePod(ctx context.Context, pod *v1.Pod) error
- func (p *CCIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *CCIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)
- func (p *CCIProvider) GetPodFullName(namespace string, pod string) string
- func (p *CCIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *CCIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *CCIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
- func (p *CCIProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
- func (p *CCIProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
- func (p *CCIProvider) OperatingSystem() string
- func (p *CCIProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, ...) error
- func (p *CCIProvider) UpdatePod(ctx context.Context, 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(ctx context.Context) v1.ResourceList
Capacity returns a resource list with the capacity constraints of the huawei CCI provider.
func (*CCIProvider) CreatePod ¶
CreatePod takes a Kubernetes Pod and deploys it within the huawei CCI provider.
func (*CCIProvider) DeletePod ¶
DeletePod takes a Kubernetes Pod and deletes it from the huawei CCI provider.
func (*CCIProvider) GetContainerLogs ¶
func (p *CCIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)
GetContainerLogs retrieves the logs of a container 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(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
GetPodStatus retrieves the status of a pod by name from the huawei CCI provider.
func (*CCIProvider) GetPods ¶
GetPods retrieves a list of all pods running on the huawei CCI provider.
func (*CCIProvider) NodeAddresses ¶
func (p *CCIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
NodeAddresses returns a list of addresses for the node status within Kubernetes.
func (*CCIProvider) NodeConditions ¶
func (p *CCIProvider) NodeConditions(ctx context.Context) []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(ctx context.Context) *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.
func (*CCIProvider) RunInContainer ¶ added in v0.10.0
func (p *CCIProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, attach api.AttachIO) error
RunInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr. TODO: Implementation