2

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.

1 Answer 1

3

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 ~ #
1
  • This is correct. Fleet units are stored in hidden keys under the namespace /_coreos.com/fleet Nov 21, 2014 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .