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) ExecInContainer(name string, uid types.UID, container string, cmd []string, in io.Reader, ...) error
- func (p *CRIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, tail int) (string, 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) 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) ExecInContainer ¶ added in v0.4.1
func (p *CRIProvider) 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 (*CRIProvider) GetContainerLogs ¶
func (p *CRIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, tail int) (string, error)
Provider function to read the logs of a container
func (*CRIProvider) GetPodFullName ¶ added in v0.4.1
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