Introduction into Virtual Kubelet

26896287bc831a13e768cea7efe29632?s=47 Anubhav Mishra
April 04, 2019
73

Introduction into Virtual Kubelet

Virtual Kubelet has most recently been accepted into the CNCF as a sandboxed project. In this session, we will give an overview of Virtual Kubelet project. We will highlight the HashiCorp Nomad provider and the Azure provider for Azure Container Instances. Folks can expect to learn about how Virtual Kubelet works and how they can use to for use cases such as bursting capacity, abstraction of infrastructure, and translating any APIs into Kubernetes APIs. Hopefully, this talk helps to spark new ideas, and conversation by bringing up a new way to connect Kubernetes to “any” service or technology.

26896287bc831a13e768cea7efe29632?s=128

Anubhav Mishra

April 04, 2019
Tweet

Transcript

  1. Introduction to Virtual Kubelet Anubhav Mishra Team Lead, Developer Advocacy

    @anubhavm
  2. None
  3. None
  4. Virtual Kubelet • Open Sourced by Microsoft in 2017 •

    Extend the Kubernetes API to serverless container platforms like ACI, Fargate, Google Containers. 4
  5. 5

  6. 6

  7. 7

  8. 8

  9. 9

  10. 10

  11. 11

  12. VK 1.0 Coming this May!

  13. 13

  14. EDITOR // Provider contains the methods required to implement a

    Virtual Kubelet provider type Provider interface { // Takes a Kubernetes Pod and deploys it within the provider CreatePod(ctx context.Context, pod *v1.Pod) error // Takes a Kubernetes Pod and updates it within the provider UpdatePod(ctx context.Context, pod *v1.Pod) error // Takes a Kubernetes Pod and deletes it from the provider DeletePod(ctx context.Context, pod *v1.Pod) error // Retrieves a pod by name from the provider (can be cached) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error) // Retrieves the logs of a container by name from the provider GetContainerLogs(ctx context.Context, namespace, podName, containerName string, tail int) (string, error) // Executes a command in a container in the pod, copying data between // in/out/err and the container's stdin/stdout/stderr 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 // Retrieves the status of a pod by name from the provider GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error) // Retrieves a list of all pods running on the provider (can be cached) GetPods(context.Context) ([]*v1.Pod, error) // Returns a resource list with the capacity constraints of the provider Capacity(context.Context) v1.ResourceList // Returns a list of conditions (Ready, OutOfDisk, etc), which is polled // periodically to update the node status within Kubernetes NodeConditions(context.Context) []v1.NodeCondition // Returns a list of addresses for the node status within Kubernetes NodeAddresses(context.Context) []v1.NodeAddress // Returns NodeDaemonEndpoints for the node status within Kubernetes. NodeDaemonEndpoints(context.Context) *v1.NodeDaemonEndpoints // Returns the operating system the provider is for OperatingSystem() string } 14 Provider Interface Use your imagination
  15. Provider Definition • Provide the back-end plumbing necessary to support

    the lifecycle management of pods, containers and supporting resources in the context of Kubernetes. • Conform to the current API provided by Virtual Kubelet. • Not have access to the Kubernetes API Server and has a well-defined callback mechanism for getting data like secrets or configmaps. 15
  16. Extend Kubernetes workloads to any service you like! 16

  17. 17

  18. Providers • Alibaba Cloud Elastic Container Instance (ECI) • AWS

    Fargate • Azure Batch • Azure Container Instances (ACI) • Kubernetes Container Runtime Interface (CRI) • Huawei Cloud Container Instance (CCI) • HashiCorp Nomad • vSphere Integrated Containers 18
  19. Demo

  20. www.hashicorp.com hello@hashicorp.com Thank you @anubhavm