-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve direct connections to Antrea API in antctl
For some commands (get featuregates, supportbundle, proxy), antctl connects directly to the Agent / Controller API when it is run from outside of the cluster. We try to address some shortcomings in the implementation: 1) Antctl was giving priority to the Node's InternalIP to determine how to connect to the API. This doesn't work when the machine on which antctl runs doesn't have connectivity to the InternalIP (e.g., if I am running antctl on my laptop and Antrea is installed in an EKS cluster). To fix this issue, we instead give priority to the Node's ExternalIP. 2) The connections were always "insecure" (no TLS verification). To fix this we need to retrieve the correct CA certificate and use it in the client TLS config. For the Controller, the CA certificate is available in the kube-ssytem/antrea-ca ConfigMap, which is easy to retrieve. For the Agent, we have to first make sure that the self-signed certificate is written to disk (not just stored in-memory), then retrieve it using the "exec" API endpoint so that it can be used in the TLS config. Writing it to disk should not be a security issue: we already do this in the Controller, and it is common practice to mount certificate data in Pods. One case that's not supported is when running antctl outside of cluster and trying to access the Agent API for a Node where the Agent is running as a Service. While it would be good to find a solution for this case, a workaround is to use the `--insecure` flag for the commands mentioned above. Signed-off-by: Antonin Bas <[email protected]> Secure connection to connect to Antrea API directly Signed-off-by: Antonin Bas <[email protected]>
- Loading branch information
1 parent
eccac6b
commit ff10769
Showing
12 changed files
with
558 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.