Documentation ¶
Overview ¶
Package web provides an implementation of the virtual kubelet provider interface by forwarding all calls to a web endpoint. The web endpoint to which requests must be forwarded must be specified through an environment variable called `WEB_ENDPOINT_URL`. This endpoint must implement the following HTTP APIs:
- POST /createPod
- PUT /updatePod
- DELETE /deletePod
- GET /getPod?namespace=[namespace]&name=[pod name]
- GE /getContainerLogs?namespace=[namespace]&podName=[pod name]&containerName=[container name]&tail=[tail value]
- GET /getPodStatus?namespace=[namespace]&name=[pod name]
- GET /getPods
- GET /capacity
- GET /nodeConditions
- GET /nodeAddresses
Index ¶
- type BrokerProvider
- func (p *BrokerProvider) Capacity(ctx context.Context) v1.ResourceList
- func (p *BrokerProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *BrokerProvider) DeletePod(ctx context.Context, pod *v1.Pod) error
- func (p *BrokerProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *BrokerProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)
- func (p *BrokerProvider) GetPodFullName(namespace string, pod string) string
- func (p *BrokerProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *BrokerProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *BrokerProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
- func (p *BrokerProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
- func (p *BrokerProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
- func (p *BrokerProvider) OperatingSystem() string
- func (p *BrokerProvider) RunInContainer(ctx context.Context, namespace, name, container string, cmd []string, ...) error
- func (p *BrokerProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerProvider ¶
type BrokerProvider struct {
// contains filtered or unexported fields
}
BrokerProvider implements the virtual-kubelet provider interface by forwarding kubelet calls to a web endpoint.
func NewBrokerProvider ¶
func NewBrokerProvider(nodeName, operatingSystem string, daemonEndpointPort int32) (*BrokerProvider, error)
NewBrokerProvider creates a new BrokerProvider
func (*BrokerProvider) Capacity ¶
func (p *BrokerProvider) Capacity(ctx context.Context) v1.ResourceList
Capacity returns a resource list containing the capacity limits
func (*BrokerProvider) CreatePod ¶
CreatePod accepts a Pod definition and forwards the call to the web endpoint
func (*BrokerProvider) DeletePod ¶
DeletePod accepts a Pod definition and forwards the call to the web endpoint
func (*BrokerProvider) GetContainerLogs ¶
func (p *BrokerProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts providers.ContainerLogOpts) (io.ReadCloser, error)
GetContainerLogs returns the logs of a container running in a pod by name.
func (*BrokerProvider) GetPod ¶
GetPod returns a pod by name that is being managed by the web server
func (*BrokerProvider) GetPodFullName ¶
func (p *BrokerProvider) GetPodFullName(namespace string, pod string) string
Get full pod name as defined in the provider context TODO: Implementation
func (*BrokerProvider) GetPodStatus ¶
func (p *BrokerProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
GetPodStatus retrieves the status of a given pod by name.
func (*BrokerProvider) NodeAddresses ¶
func (p *BrokerProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
NodeAddresses returns a list of addresses for the node status within Kubernetes.
func (*BrokerProvider) NodeConditions ¶
func (p *BrokerProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), for updates to the node status
func (*BrokerProvider) NodeDaemonEndpoints ¶
func (p *BrokerProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status within Kubernetes.
func (*BrokerProvider) OperatingSystem ¶
func (p *BrokerProvider) OperatingSystem() string
OperatingSystem returns the operating system for this provider.
func (*BrokerProvider) RunInContainer ¶
func (p *BrokerProvider) 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