Post on 14-Jul-2015
Launching Containers with fleet Docker Seoul Meetup #3 / Feb 14, 2014
by @subicura (김충섭)
deployment
container
image를 배포하고
container를 stop/start만 하면 되는데..
fleet
a distributed init system
fleet = systemd + etcd
fleet = systemd + etcd
System and Service Manager CoreOS default init system
Fedora, Gentoo, Arch 사용중 / RedHat, Debian, Ubuntu 곧
fleet = systemd + etcd
[Unit] Description=My Service Requires=docker.service After=docker.service
[Service] ExecStart=/usr/bin/docker run --rm --name my_service busybox \ /bin/sh -c "while true; do echo Hello World; sleep 1; done" ExecStop=/usr/bin/docker kill my_service
systemd service file sample
systemd command
시작 - systemctl start [service]
종료 - systemctl stop [service]
강제종료 - systemctl kill [service]
상태보기 - systemctl status [service]
로그보기 - journalctl -u [service]
[Unit] Description=My Service Requires=docker.service After=docker.service
[Service] ExecStart=/usr/bin/docker run --rm --name my_service busybox \ /bin/sh -c "while true; do echo Hello World; sleep 1; done" ExecStop=/usr/bin/docker kill my_service
[X-Fleet] MachineMetadata=type=app Conflicts=%p@*.service
fleet unit file sample
fleet-specific properties
MachineID - 해당하는 machine에서 실행
MachineOf - 특정 서비스가 수행중인 machine에서 실행
MachineMetadata - metadata를 가진 machine에서 실행
Conflicts - 해당 서비스가 수행중인 machine을 피해서 실행
Global - 전체 machines에서 실행
fleetctl command서버리스트 - fleetctl list-machines
유닛리스트 - fleetctl list-units
등록 - fleetctl submit [service]
시작 - fleetctl start [service]
종료 - fleetctl stop [service]
제거 - fleetctl destroy [service]
상태보기 - fleetctl status [service]
로그보기 - fleetctl journal [service]
fleet list-machines
fleet list-units
fleet start nginx-confd.service
DEMO
summary
easy (with coreos) - systemd + etcd + fleetd
Deploy docker containers on arbitrary hosts in a cluster
re-scheduling on machine failure
Automatically SSH into the machine running a job
difficult server balance - no check cpu/memory/hdd/network
Lack of option
Lack of GUI Tool