TL;DRThere are multiple interdependencies and it becomes complex to use a worker API in isolation as it leads to errors, limitations and problems of many kinds, including security issues.
Yes, it is intentional. Mainly for security, since the API uses a centralized authentication system and also roles, policies, and users (
RBAC). This information is stored in the master node. For example, if a worker also had this information (distributed system), there could be a user or role that no longer exists in the master node, giving rise to security problems.
Therefore, even if all workers have APIs, authentication requests are redirected to the master, who knows the permissions for the credentials provided.
In addition, there are many requests that cannot be made to the workers directly since it is the master that centralizes and coordinates the workers.
For example, having the following cluster:
- 1 master node (without agents)
- 1 worker-1 node (with agents 001, 002, 003)
- 1 worker-2 node (with agents 004, 005, 006)
It would not be possible to request the worker-2 node to restart agent 001 because that agent is connected to the worker-1 node.
Therefore, the requests are redirected to the master, who knows which node has certain agents, thus redirecting the request correctly.