Documentation ¶
Index ¶
- Constants
- type CRIPod
- type CRIProvider
- func (p *CRIProvider) Capacity() v1.ResourceList
- func (p *CRIProvider) CreatePod(pod *v1.Pod) error
- func (p *CRIProvider) DeletePod(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(namespace, podName, containerName string, tail int) (string, error)
- func (p *CRIProvider) GetPod(namespace, name string) (*v1.Pod, error)
- func (p *CRIProvider) GetPodFullName(namespace string, pod string) string
- func (p *CRIProvider) GetPodStatus(namespace, name string) (*v1.PodStatus, error)
- func (p *CRIProvider) GetPods() ([]*v1.Pod, error)
- func (p *CRIProvider) NodeAddresses() []v1.NodeAddress
- func (p *CRIProvider) NodeConditions() []v1.NodeCondition
- func (p *CRIProvider) NodeDaemonEndpoints() *v1.NodeDaemonEndpoints
- func (p *CRIProvider) OperatingSystem() string
- func (p *CRIProvider) UpdatePod(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() v1.ResourceList
Provider function to return the capacity of the node
func (*CRIProvider) CreatePod ¶
func (p *CRIProvider) CreatePod(pod *v1.Pod) error
Provider function to create a Pod
func (*CRIProvider) DeletePod ¶
func (p *CRIProvider) DeletePod(pod *v1.Pod) error
Provider function to delete a pod and its containers
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(namespace, podName, containerName string, tail int) (string, error)
Provider function to read the logs of a container
func (*CRIProvider) GetPod ¶
func (p *CRIProvider) GetPod(namespace, name string) (*v1.Pod, error)
Provider function to return a Pod spec - mostly used for its status
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(namespace, name string) (*v1.PodStatus, error)
Provider function to return the status of a Pod
func (*CRIProvider) GetPods ¶
func (p *CRIProvider) GetPods() ([]*v1.Pod, error)
Provider function to return all known pods TODO: Should this be all pods or just running pods?
func (*CRIProvider) NodeAddresses ¶
func (p *CRIProvider) NodeAddresses() []v1.NodeAddress
Provider function to return a list of node addresses
func (*CRIProvider) NodeConditions ¶
func (p *CRIProvider) NodeConditions() []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() *v1.NodeDaemonEndpoints
Provider function to return the daemon endpoint
func (*CRIProvider) OperatingSystem ¶
func (p *CRIProvider) OperatingSystem() string
Provider function to return the guest OS