13. #VACD
コンテナの仕組みとその性質
あるプロセスを他のプロセスから切り離して実行するための仕組み
● OS のカーネルを共用
● 名前空間という仕組みにより、プロセス ID、メモリ空間、ファイルシ
ステム、ネットワークなどがホストから読み替えされる
13
注: Windows の Docker Desktop 上で走る Linux コンテナや、 Windows 上で走る Windows コンテナでもカーネル バージョンが異なる場合に
用いる Hyper-V 分離の場合には、上記はあてはまらず、代わりに軽量な VM の上にコンテナを走らせています。
https://docs.microsoft.com/virtualization/windowscontainers/manage-containers/hyperv-container
コンテナのメリット
• 起動が早い
• メモリが軽量に実行できる
コンテナのデメリット
• 異なるカーネルには使えない
(下記参照)
14. #VACD
VM による仮想化とコンテナの違い
14
異なる OS が一つのハードウェア上に共存でき
る (通常、仮想化されたうちの一つがホスト OS
として振る舞う)
カーネルを共用するので、個別のコンテナのメモ
リは軽量、イメージも小さい、起動も迅速。異な
る OS のアプリケーションは走らせられない。
23. #VACD
Docker Swarm の利用
● Docker から標準で利用できる小規模なオーケストレーター
23
> docker swarm init
Swarm initialized: current node (awv1og70vi7dwxqjyefow4ali) is now a manager.
To add a worker to this swarm, run the following command:
docker swarm join --token SWMTKN-1-05t2868h41...(略)...s2ik7m9exe 192.168.65.3:2377
To add a manager to this swarm, run 'docker swarm join-token manager' and follow the instructions.
> docker node ls
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
awv1og70vi7dwxqjyefow4ali * docker-desktop Ready Active Leader 19.03.8
28. #VACD
余談: Kubernetes の起源
● Google 社内で使われていた Borg というシステムが源流
● https://kubernetes.io/blog/2015/04/borg-predecessor-to-
kubernetes/
● Verma, Abhishek, Luis Pedrosa, Madhukar Korupolu, David
Oppenheimer, Eric Tune, and John Wilkes.
"Large-scale cluster management at Google with Borg.“
Proceedings of the European Conference on Computer Systems
(EuroSys). 2015.
https://research.google/pubs/pub43438/
28
32. #VACD
AKS を作る手順
az group create -l japaneast -n KubRG
az aks create -g KubRG -n MyCluster --enable-managed-identity
Standard DS2 v2 (2 vcpus, 7 GiB memory) x 3ノード、
Basic ネットワーク構成、RBAC 有効なクラスタができる
Kube config に設定を書き込むと kubectl で使える
az aks get-credentials -g KubRG -n MyCluster
32