CoreOS unit files are actually systemd unit files. When you submit a unit file to fleet, it is stored in some registry. When you start unit file, fleet transfers this unit file into a /run/fleet/units directory on the machine, the unit is scheduled to run on. When unit stops, unit file is removed from the machine.

The question is: where fleet stores those submitted unit files? I thought there is only etcd there as a distributed data storage. But etcd ls inspection doesn't show anything like unit files in the storage.

Oh.. It appears they are stored in the hidden keys in etcd like this:

core-02 ~ # etcdctl get /_coreos.com/fleet/states/hello-fleet.service/7fd494f60e2844978072683ea374a7dd
{"loadState":"loaded","activeState":"active","subState":"running","machineState":{"ID":"7fd494f60e2844978072683ea374a7dd","PublicIP":"","Metadata":null,"Version":""},"unitHash":"e738189b45f4421e25cc0990da1c1e37ba0d40c6"}
core-02 ~ # etcdctl get /_coreos.com/fleet/job/hello-fleet.service/object
{"Name":"hello-fleet.service","UnitHash":[231,56,24,155,69,244,66,30,37,204,9,144,218,28,30,55,186,13,64,198]}
core-02 ~ # etcdctl get /_coreos.com/fleet/state/hello-fleet.service
{"loadState":"loaded","activeState":"active","subState":"running","machineState":{"ID":"7fd494f60e2844978072683ea374a7dd","PublicIP":"","Metadata":null,"Version":""},"unitHash":"e738189b45f4421e25cc0990da1c1e37ba0d40c6"}
core-02 ~ # etcdctl get /_coreos.com/fleet/unit/e738189b45f4421e25cc0990da1c1e37ba0d40c6
{"Raw":"[Service]\nExecStart=/usr/bin/bash -c \"while true; do echo 'Hello Fleet'; sleep 1; done\"\n"}
core-02 ~ #
  • This is correct. Fleet units are stored in hidden keys under the namespace /_coreos.com/fleet – Brian Redbeard Nov 21 '14 at 16:57

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.