Refactor agent registration
So that we can surface it to users in GitLab
Proposal
- Add a new gRPC service (e.g.
RegisterAgent) to theagent_trackerserver module that the corresponding agent module will be calling to passAgentMeta. - Move stuff from the server
agent_configurationmodule to theagent_trackerserver module to register the agent in the new RPC handler. - Register the new gRPC service on the
modserver.Config.AgentServergRPC server to expose it to agents. - Add agent module in
internal/agent_tracker/agent. This module will be responsible for periodically calling the new RPC. - The
agent_tracker/agentmodule should retrieve Kubernetes version first time it needs to call the new RPC. We don't want to do it during startup of the program because it's I/O and we don't want to slow down the startup of the agent.
This work can be split into several smaller MRs:
- Move RPC, etc.
- Add Kubernetes version to
AgetnMeta.
Edited by Taka Nishida