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

What a Runtime of Windows Container looks like ?

What a Runtime of Windows Container looks like ?

Container Runtime Meetup #2 の資料です。

cyberblack28

August 22, 2020
Tweet

More Decks by cyberblack28

Other Decks in Technology

Transcript

  1. What a
    Runtime of Windows
    Container looks like ?
    Cyberblack28
    Container Runtime Meetup #2

    View full-size slide

  2. Name: Yutaka Ichikawa
    Twitter/GitHub/Qiita: cyberblack28
    Hatena Blog: https://cyberblack28.hatenablog.com/
    Slides: https://speakerdeck.com/cyberblack28
    Job
    Educational Solution Architect
    Developer Advocate / Technical Evangelist
    Infrastructure Engineer / Frontend Engineer
    Certification & Community
    CKA CKAD KCM100
    2018 2019
    Profile
    #CNDT2020

    View full-size slide

  3. Agenda
    1. Windows Container Mode
    2. Runtime of Windows Container
    3. Reference

    View full-size slide

  4. Windows Container Mode

    View full-size slide

  5. Windows Container Mode
    プロセス 分離モード(Windows Server Container)
    Hyper-V 分離モード(Hyper-V Container)
    ホストOSのカーネルを共有しながら、ホストOSや他のコンテナーから分離されたユーザー
    モードプロセスの実行環境を提供。
    Linux上のDocker + コンテナーと同様
    Hyper-Vハイパーバイザーを利用して、隔離されたコンテナーごとの専用環境を提供。確
    実なリソースと厳密なセキュリティ境界が特徴。
    ホストOSのカーネルを共用することはない、Windows特有機能。

    View full-size slide

  6. Windows Container Mode
    プロセス 分離モード(Windows Server Container)
    BareMetal or Virtual Machine
    Docker Client
    Windows Server
    Docker
    ホストOSのバージョン/ビルドと
    Windowsコンテナーのバージョン/ビル
    ドが同じ必要があります。
    カーネル共有における制限
    Windows
    Container
    Windows
    Container
    Windows
    Container
    Kernel Share

    View full-size slide

  7. Windows Container Mode
    Hyper-V 分離モード(Hyper-V Container)
    BareMetal or Hyper-V Virtual Machine
    Docker Client
    Docker
    UtilityVM
    Windows Server
    Utility VM
    (Windows Kernel)
    Windows Container
    Utility VM
    (Linux Kernel)
    Linux Container
    UtilityVMと呼ばれる仮想マシンがその
    上で稼働するコンテナーにカーネルを
    提供します。
    Hyper-V分離モードのコンテナーは、ホ
    ストOSのカーネルを共有することはあ
    りません。
    Kernel Share Kernel Share
    Linux Containers on Windows
    (LCOW)
    Hyper-V Container
    Hyper-V Hypervisor

    View full-size slide

  8. Runtime of Windows Container

    View full-size slide

  9. Runtime of Windows Container
    “Linux + Docker + Runtime”

    View full-size slide

  10. Runtime of Windows Container
    Docker
    Docker Client
    containerd
    runC
    Linux
    cgroups Namespaces
    Union
    Filesystem
    Network
    Low-level
    Container Runtime
    High-level
    Container Runtime
    OCI(Open Container Initiative)
    CRI(Container Runtime Interface)
    kubelet

    View full-size slide

  11. Runtime of Windows Container
    “Windows + Docker + Runtime”

    View full-size slide

  12. Runtime of Windows Container
    BareMetal & Virtual Machine
    Docker Client
    Windows Server
    Docker Windows
    Container
    Windows
    Container
    Windows
    Container
    Kernel Share
    View the detail
    この部分を詳しく...
    プロセス 分離モード(Windows Server Container)

    View full-size slide

  13. Runtime of Windows Container
    Docker
    Docker Client
    Windows
    libcontainerd
    hcsshim
    HCS(Host Compute Service) HNS(Host Network Service)
    Job
    objects
    Namespaces
    Union
    like filesystem extensions
    WinNAT
    Windows
    Firewall
    vSwitch TCP/IP
    VPF
    libnetwork plugins
    Windows
    Container
    Windows
    Container

    View full-size slide

  14. Runtime of Windows Container
    hcsshim
    Host Compute Service(HCS)
    Host Network Service(HNS)
    Host Compute Service(HCS)、Host Network Service(HNS)を使用してWindowsコンテ
    ナーの起動、管理するためのGolangインターフェイス。
    Windowsでコンテナーを扱うためのAPI。Linuxにおけるcontainerdとruncにあたる機能を
    提供。
    Windowsでコンテナーのネットワークを扱うためのAPI。Windowsコンテナーのネットワー
    ク管理を担います。

    View full-size slide

  15. Runtime of Windows Container
    “Windows + Docker + Kubernetes + Runtime”

    View full-size slide

  16. Runtime of Windows Container
    2019.03 Kubernetes 1.14
    Windows(Docker EE-basic 18.09+、Windows Server 2019/1809+)ノードをワーカー
    ノードとして追加し、Windowsコンテナーをスケジュールする機能をサポート。※Control
    PlaneはLinuxであることが制限事項
    参考:Intro to Windows support in Kubernetes
    (https://kubernetes.io/ja/docs/setup/production-environment/windows/intro-windows-in-kubernetes/)
    2020年8月時点では、Kubernetesで対応するWindowsコンテナーは、
    プロセス分離モード、Hyper-V分離モードはKubernetes 1.20(containerd1.5)予定。
    History

    View full-size slide

  17. Runtime of Windows Container
    Docker
    Docker Client
    kubelet
    libcontainerd libnetwork plugins
    Windows
    HCS(Host Compute Service) HNS(Host Network Service)
    Job objects Namespaces
    Union like filesystem extensions
    WinNAT Windows Firewall
    TCP/IP vSwitch VPF
    dockershim
    hcsshim
    Windows
    Container
    Windows
    Container

    View full-size slide

  18. Runtime of Windows Container
    2020.03 Kubernetes 1.18
    Windows上のCRI-ContainerDのサポートを追加(Containerd1.3)。
    参考:Intro to Windows support in Kubernetes
    (https://kubernetes.io/ja/docs/setup/production-environment/windows/intro-windows-in-kubernetes/)
    ● Enable CRI plugin #4076
    ● Add support for Windows containers process isolation cri#1264
    ● Build CRI Plugin on Windows and add presubmit cri#1258
    Containerd 1.4で実際は追加されました。(2020年8月時点)。
    (https://github.com/containerd/containerd/releases)

    View full-size slide

  19. kubelet
    Windows
    Runtime of Windows Container
    Docker
    Docker Client
    containerd
    containerd-shim(runhcs)
    libcontainerd libnetwork plugins
    HCS(Host Compute Service) HNS(Host Network Service)
    Job objects Namespaces
    Union like filesystem extensions
    WinNAT Windows Firewall
    TCP/IP vSwitch VPF
    hcsshim
    CRI(Container Runtime Interface)
    CRI API
    Windows
    Container
    Windows
    Container
    OCI(Open Container Initiative)
    OCI準拠のruncのフォーク

    View full-size slide

  20. Runtime of Windows Container
    Simplifying Windows runtime and deployment in Kubernetes - Muzz Imam, Microsoft & Michael Michael, VMware

    View full-size slide

  21. kubelet
    Windows
    Runtime of Windows Container
    Docker
    Docker Client
    containerd
    containerd-shim (hcsshim)
    libcontainerd libnetwork plugins
    HCS(Host Compute Service) HNS(Host Network Service)
    Job objects Namespaces
    Union like filesystem extensions
    WinNAT Windows Firewall
    TCP/IP vSwitch VPF
    hcsshim
    CRI(Container Runtime Interface)
    CRI API
    Windows
    Container
    Windows
    Container

    View full-size slide

  22. Runtime of Windows Container
    Simplifying Windows runtime and deployment in Kubernetes - Muzz Imam, Microsoft & Michael Michael, VMware

    View full-size slide

  23. Runtime of Windows Container
    Simplifying Windows runtime and deployment in Kubernetes - Muzz Imam, Microsoft & Michael Michael, VMware
    Kubernetes 1.20
    Containerd 1.5
    に向けて

    View full-size slide

  24. Runtime of Windows Container
    Simplifying Windows runtime and deployment in Kubernetes - Muzz Imam, Microsoft & Michael Michael, VMware

    View full-size slide

  25. Runtime of Windows Container
    Add
    Windows
    Node to
    Kubernetes
    Cluster
    (GA or Experiment)
    Enterprise

    View full-size slide

  26. Reference
    I referred to the good books and internet information.

    View full-size slide

  27. Reference
    ● Windows コンテナー プラットフォーム
    https://docs.microsoft.com/ja-jp/virtualization/windowscontainers/deploy-containers/containerd
    ● Introducing the Host Compute Service (HCS)
    https://techcommunity.microsoft.com/t5/containers/introducing-the-host-compute-service-hcs/ba-p/382332
    ● Windows上のコンテナに関するドキュメント
    https://docs.microsoft.com/ja-jp/virtualization/windowscontainers/
    ● Kubernetesエコシステム-コンテナランタイム編
    https://www.kaitoy.xyz/2019/06/15/k8s-ecosystem-container-runtimes/#containerd
    ● Docker Desktop の復習と、Windows Container に入門: Windows Server Container 理論編
    https://qiita.com/kikuchi_kentaro/items/2fb0171e18821d402761
    ● Intro to Windows support in Kubernetes (翻訳に協力)
    https://kubernetes.io/ja/docs/setup/production-environment/windows/intro-windows-in-kubernetes/
    ● sig-windows
    https://github.com/kubernetes/enhancements/tree/master/keps/sig-windows

    View full-size slide

  28. Thank you for your attention !!

    View full-size slide