-
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 (#5135)
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, the self-signed certificate is now published as part of the AntreaAgentInfo CRD (field name APICABundle), and hence is available to antctl. We use `[]byte` as the field type as it feels more common, but `string` would also have been acceptable for that type of data. An `--insecure` flag is available for these commands, if users want to fallback to the previous behavior. Signed-off-by: Antonin Bas <[email protected]>
- Loading branch information
1 parent
b783a1c
commit 191a6ac
Showing
18 changed files
with
535 additions
and
169 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
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.