Hello Rancher team and everyone.
When host are registering with rancher server, rancher agent will download source of host-api and python-agent. I wonder that what is host-api?, what is python-agent?. I want to know exactly what are host-api and python-agent doing for? (I saw README of them, but not enough to understand).
Thanks.
They implement the actual things the agent does. The server provides the right code to run on the agent and manages updating them when the server version changes.
python-agent manages the containers on host... creating/starting/stopping/removing in response to API events, and keeping the server in sync when the state of containers change (e.g. one dies) or when new ones are created outside of the API (e.g. by docker run
on the host).
host-api provides the API for the server to talk to each host (separate from events) for things like host/container stats, logs, and the shell (exec).
Thanks for quickly response, I has look through the source code of python-agent. According to what I understand, python-agent will start process_watcher and plugins like: docker, host-api, cadvisor. process_watcher will monitor the other processes, and restart when they die. So I can be summary as follows: python-agent have two important tasks: start other processes (process_watcher, plugins) and manage the containers on host, host-api like you said. Is this right?
I also saw python-agent and host-api both have events and I don't know what are difference between us. I hope you can clarify it for me. Thanks you again.
@CBR09 Please let me know if you have further quesitons.
Most helpful comment
They implement the actual things the agent does. The server provides the right code to run on the agent and manages updating them when the server version changes.
python-agent manages the containers on host... creating/starting/stopping/removing in response to API events, and keeping the server in sync when the state of containers change (e.g. one dies) or when new ones are created outside of the API (e.g. by
docker run
on the host).host-api provides the API for the server to talk to each host (separate from events) for things like host/container stats, logs, and the shell (exec).