Documentation ¶
Index ¶
- Constants
- type CRIPod
- type CRIProvider
- func (p *CRIProvider) Capacity(ctx context.Context) v1.ResourceList
- func (p *CRIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *CRIProvider) DeletePod(ctx context.Context, pod *v1.Pod) error
- func (p *CRIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *CRIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)
- func (p *CRIProvider) GetPodFullName(namespace string, pod string) string
- func (p *CRIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *CRIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *CRIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
- func (p *CRIProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
- func (p *CRIProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
- func (p *CRIProvider) OperatingSystem() string
- func (p *CRIProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, ...) error
- func (p *CRIProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error
Constants ¶
const CriSocketPath = "/run/containerd/containerd.sock"
TODO: Make these configurable
const PodConfigMapFilePerms = 0644
const PodConfigMapVolDir = "/configmaps"
const PodConfigMapVolPerms = 0755
const PodLogRoot = "/var/log/vk-cri/"
const PodLogRootPerms = 0755
const PodSecretFilePerms = 0644
const PodSecretVolDir = "/secrets"
const PodSecretVolPerms = 0755
const PodVolPerms = 0755
const PodVolRoot = "/run/vk-cri/volumes/"
const PodVolRootPerms = 0755
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRIProvider ¶
type CRIProvider struct {
// contains filtered or unexported fields
}
CRIProvider implements the virtual-kubelet provider interface and manages pods in a CRI runtime NOTE: CRIProvider is not inteded as an alternative to Kubelet, rather it's intended for testing and POC purposes
As such, it is far from functionally complete and never will be. It provides the minimum function necessary
func NewCRIProvider ¶
func NewCRIProvider(nodeName, operatingSystem string, internalIP string, resourceManager *manager.ResourceManager, daemonEndpointPort int32) (*CRIProvider, error)
Create a new CRIProvider
func (*CRIProvider) Capacity ¶
func (p *CRIProvider) Capacity(ctx context.Context) v1.ResourceList
Provider function to return the capacity of the node
func (*CRIProvider) GetContainerLogs ¶
func (p *CRIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts providers.ContainerLogOpts) (io.ReadCloser, error)
Provider function to read the logs of a container
func (*CRIProvider) GetPodFullName ¶
func (p *CRIProvider) GetPodFullName(namespace string, pod string) string
Get full pod name as defined in the provider context TODO: Implementation
func (*CRIProvider) GetPodStatus ¶
func (p *CRIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
Provider function to return the status of a Pod
func (*CRIProvider) GetPods ¶
Provider function to return all known pods TODO: Should this be all pods or just running pods?
func (*CRIProvider) NodeAddresses ¶
func (p *CRIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
Provider function to return a list of node addresses
func (*CRIProvider) NodeConditions ¶
func (p *CRIProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
Provider function to return node conditions TODO: For now, use the same node conditions as the MockProvider
func (*CRIProvider) NodeDaemonEndpoints ¶
func (p *CRIProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
Provider function to return the daemon endpoint
func (*CRIProvider) OperatingSystem ¶
func (p *CRIProvider) OperatingSystem() string
Provider function to return the guest OS
func (*CRIProvider) RunInContainer ¶
func (p *CRIProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, attach providers.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