Project Atomicと
geardの紹介
第18回 CloudFoundry輪読会 #cfcrjp
たかはし@tnaoto
自己紹介
• たかはしなおと
• TwitterID:tnaoto
• お仕事:クラウドミドルの開発
バイクツーリングのお誘い待ってます
注意
CloudFoundryと全然関係ない話をします
Project Atomic

http://www.projectatomic.io/
• RedHatが始めたDockerコンテナのための軽量OSを作るプロジェクト
コンテナといえば
Warden
Warden
ウォードン!
!
「わーでん」じゃないよ!
Wardenといえば
Warden
って、本題は

Wardenじゃなくて・・・
Project Atomic
Project Atomic
• Dockerコンテナのために設計された軽量OSを提供するプロジェクト
• Production環境でのDockerコンテナ環境
• ベースOSは、RHEL,Fedora,CentOS(作業中)
• コンテナ管理と分散基盤管理のためにsystemdを採用。

ログ管理に、systemdのjournaldを利用することで、コンテナのログをセキュアに管理する
• 主要コンポは4つといろいろ
• Docker
• rpm-OSTree
• systemd
• geard
Docker
• 言わずと知れたやつ
• 説明不要
rpm-OSTree
• OSのシステム:ブータブル&アップデートの仕組み
• 新たなアップデートが見つかった場合には、現在の/etcに対し、
3way-mergeを行う
• システムはTree(スナップショット)を持つので、アップデートの
rollbackも行える
• マージでぶっ飛んたときに対応できるようにコピーが/usr/etcにあるっ
ぽい
• 詳細はここ

http://rpm-ostree.cloud.fedoraproject.org/
rpm-OSTree
systemd
• Linuxシステムのinitの代わりとなるシステムデーモン

http://ja.wikipedia.org/wiki/Systemd
• systemdは、cgroupに多く依存し、PIDを監視するのではな
く、cgroupを使ってサービスプロセス郡を監視する。即ち、
デーモンの実行制御をする
• コンテナのセキュリテイ問題と相性が良さそう?
その他
• SELinux
• いつもdisableな(ry
その他
• Cockpit
• GNU/Linuxサーバを

リモート管理するための機構
geard
• http://openshift.github.io/geard/
• 次期OpenShiftと目される実行基盤
• geardのページにはこんなことが書かれている
!
!
!
!
• 実装はGolang

https://github.com/openshift/geard
geard is a command-line client and agent for integrating and linking
Docker containers into systemd across multiple hosts. It is the core of
the next generation of OpenShift Origin and helps administrators install
and manage the components of their developers' applications. geard is
currently under active development in the upstream community - get
involved today!
geardのコンセプト
• Linking - use iptable rules and environment variables to simplify
container interconnect
• SSH - generate authorized_keys for a user on demand
• Isolated container - start an arbitrary image and force it to run as a
given user on the host by chown the image prior to execution
• Idling - use iptable rules to wake containers on SYN packets
• Git - host Git repositories inside a running Docker container
• Logs - stream journald log entries to clients
• Builds - use transient systemd units to execute a build inside a container
• Jobs - run one-off jobs as systemd transient units and extract their logs
and output after completion
https://github.com/openshift/geard
geardでまだ出来ないこと
• Integrated health check - mark containers as available once a pluggable/
configurable health check passes
• Joining - reconnect to an already running operation
• Direct server to server image pulls - allow hosts to act as a distributed registry
• Job callbacks - invoke a remote endpoint after an operation completes
• Local routing - automatically distribute config for inbound and outbound
proxying via HAProxy
• Repair - cleanup and perform consistency checks on stored data (most
operations assume some cleanup)
• Capacity reporting - report capacity via API calls, allow precondition PUTs
based on remaining capacity ("If-Match: capacity>=5"), allow capacity to be
defined via config
https://github.com/openshift/geard
geard
• geardは、一部がsystemctrコマンドラッパー

gear start/stop/statusコマンドなどを打つと、systemctrでもイケるよ!って言われる
• gear create-repoとかどうやって使うの・・・

従来のopenshiftの考え方だと、コンテナの中にアプリ用のgitレポジトリを

持つので、その概念を引き継いでいる模様
• HTTP通信によるリモートdeploy可能。ただしデーモン必要

他にMQやgossip Protocolを使ったノードの追加とかも出来るらしい(予定かも)
• geardデーモンの起動は “systemctl start geard”

シングルhostの場合は、デーモンなくても動く
!
• などなど・・・
• 詳細は、後日ブログにでも書きます。ごめんなさい
https://github.com/openshift/geard
時間があったら、デモ
まとめと所感
• ホストOSとしてのインストール機構は作業中(要anaconda)
• PaaSが、アプリケーションのポータビリティを重要視しているが、そこ
まで爆発的に普及してない感。

背景には、エンタープライズアプリなどの現行のアプリケーションアー
キテクチャから変更に耐えられない人多数
• コンテナ型は、IaaSとPaaSの間を埋めるような存在になるのではないか
と予想
• OpenShiftがその世界へ向けて動いた。さて、CloudFoundryはどうす
る?!

(そいえば、deckerっていうdocker + wardenってのが・・・)
おわり

ProjectAtomic-and-geard