Refactor agent registration

So that we can surface it to users in GitLab

Proposal

  • Add a new gRPC service (e.g. RegisterAgent) to the agent_tracker server module that the corresponding agent module will be calling to pass AgentMeta.
  • Move stuff from the server agent_configuration module to the agent_tracker server module to register the agent in the new RPC handler.
  • Register the new gRPC service on the modserver.Config.AgentServer gRPC 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/agent module 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