Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro: Virtual Kubelet

Intro: Virtual Kubelet

Intro: Virtual Kubelet - Ria Bhatia, Microsoft & Anubhav Mishra, HashiCorp

Virtual Kubelet has most recently been accepted into the CNCF as a sandboxed project. In this session we will go through the benefits of the project and the landscape of providers that contribute to VK in the open. We will highlight the HashiCorp Nomad provider and the Azure provider for Azure Container Instances. Folks can expect to learn about three different use-cases for Virtual Kubelet including, burst capacity, abstraction of infrastructure, and translating any APIs into Kubernetes APIs. We hope to spark new ideas, and conversation by bringing up a new way to connect Kubernetes to "any" service or technology.

KubeCon EU talk link: https://sched.co/MPin

Anubhav Mishra

May 21, 2019
Tweet

More Decks by Anubhav Mishra

Other Decks in Technology

Transcript

  1. Introduction to
    Virtual Kubelet
    Ria Bhatia, Program Manager, Microsoft
    Anubhav Mishra, Developer Advocate, HashiCorp

    View full-size slide

  2. Ria Bhatia
    Program Manager, Microsoft
    @rbitia
    Maintainer of Virtual Kubelet Core

    View full-size slide

  3. Anubhav Mishra
    Team Lead, Developer Advocacy, HashiCorp
    @anubhavm
    - Kubernetes Community
    - Provider Maintainer, Virtual Kubelet
    - Helm, Secret CSI Driver

    View full-size slide

  4. Virtual Kubelet
    • Open Sourced by Microsoft in 2017
    • Extend the Kubernetes API to serverless container
    platforms like ACI, Fargate, Google Containers.

    View full-size slide

  5. A Long Time Ago…..

    View full-size slide

  6. Announcing v1.0!

    View full-size slide

  7. Kubernetes Architecture
    In two slides…..

    View full-size slide

  8. Anatomy of a Node
    • Kubernetes is fundamentally a node-based scheduling system
    • A node comes with a number of conventions and constraints
    • Pods are run in the same address space
    • Pods are executed using low-level operating system primitives (cgroups /
    namespaces)
    • Pods share node resources - kernel, ephemeral disk, container images
    • Pods inherit certain aspects of node configuration
    • Node is a static size
    • Privileged containers expect to interact directly with node resources
    • A node is a single fault domain - affinity consideration

    View full-size slide

  9. Anatomy of a Node: Node Agent

    View full-size slide

  10. Introduction to Virtual Kubelet
    • VK treats the concept of pods and nodes in the abstract
    • A node is a bounded amount of resource
    • A pod is a set of containers running within a sandbox
    • The specifics of how these are manifested is contained within a
    pluggable Provider
    • Common code in VK is relatively small
    • Registers with the API server as a client
    • Polls for state changes in Objects
    • Reports back state of "node" and "pods"
    • Handles synchronous interaction with containers
    • VK can itself be deployed as a Pod

    View full-size slide

  11. Why Virtual Kubelet?
    • Flexibility of abstraction
    • Flexibility of resource consumption
    • Greater granularity – pay for pods, not nodes
    • Hybrid use-case - traditional cluster with a VK node for bursting
    / batch / on-demand pricing
    • Single cluster high availability - a VK in each availability zone
    • IOT edge connector - a VK schedules to a set of IOT devices
    • Alternate Kubelet – VK as a node agent in a different kind of
    node

    View full-size slide

  12. Provider Interface
    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)
    .....

    View full-size slide

  13. 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.

    View full-size slide

  14. Extend Kubernetes workloads to any service you like!
    20

    View full-size slide

  15. Providers in Virtual Kubelet

    View full-size slide

  16. IoT Edge with Virtual Kubelet

    View full-size slide

  17. Virtual Node architecture in AKS
    Kubernetes
    control pane
    Application
    architect
    Infrastructure
    architect
    Azure Container Instances
    (ACI)
    Virtual node
    Pod
    Pod Pod
    Pod
    Pod Pod
    Pod
    Pod Pod
    Pod
    Pod Pod
    VM VM
    VM VM
    Deployment/
    tasks
    Pod Pod Pod Pod Pod
    Pod Pod Pod Pod Pod
    Pod Pod Pod Pod Pod
    Pod Pod Pod Pod Pod
    Pod Pod Pod Pod Pod
    Waste
    Waste
    Waste
    Waste

    View full-size slide

  18. Tolerance to Pod Spec

    View full-size slide

  19. Affinities to Burst Out to ACI

    View full-size slide

  20. Demo – AKS and ACI

    View full-size slide

  21. Another demo.

    View full-size slide

  22. Extend Kubernetes to Nomad
    Kubernetes
    control pane
    Application
    architect
    Infrastructure
    architect
    HashiCorp Nomad API
    Virtual node
    Pod
    Pod Pod
    Pod
    Pod Pod
    Pod
    Pod Pod
    Pod
    Pod Pod
    VM VM
    VM VM
    Deployment/
    tasks
    Waste
    Waste
    Waste
    Waste
    Nomad Servers
    Nomad
    Client
    Nomad
    Client
    Nomad
    Client
    Nomad
    Client
    Nomad
    Client
    Nomad Job
    Task
    Task
    Task Group

    View full-size slide

  23. Demo – Nomad

    View full-size slide

  24. Thanks!
    Questions?
    Deep Dive: Virtual Kubelet
    by Jeremy Rickard, Microsoft & Lei Zhang, Alibaba
    Cloud
    Wednesday, May 22 • 14:00 - 14:35
    Hall 8.0 E1

    View full-size slide