Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Agent's dependency on proxy to access Antrea Service #6361

Commits on May 28, 2024

  1. Remove Agent's dependency on proxy to access Antrea Service

    We add Endpoint resolution to the AntreaClientProvider, so that when
    running in-cluster, accessing the Antrea Service (i.e., accessing the
    Antrea Controller API) no longer depends on the ClusterIP functionality
    provided by the K8s proxy, whether it is kube-proxy or AntreaProxy.
    
    This gives us more flexibility during Agent initialization. For example,
    when kube-proxy is removed and ProxyAll is enable for AntreaProxy,
    accessing the Antrea Service no longer requires any routes or OVS flows
    installed by the Antrea Agent.
    
    To implement this functionality, we add a controller (EndpointResolver),
    to watch the Antrea Service and the corresponding Endpoints
    resource. For every relevant update, the Endpoint is resolved and the
    new URL is sent to the AntreaClientProvider. This is a similar model as
    the one we already use for CA bundle updates.
    
    Note that when the Service stops being available, we clear the Endpoint
    URL and notify listeners. This means that GetAntreaClient() can now
    return an error even if a previous call was successful.
    
    We also update the NetworkPolicyController in the Agent, so that we
    fallback to saved policies in case the Antrea client does not become
    ready within 5s.
    
    Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
    antoninbas committed May 28, 2024
    Configuration menu
    Copy the full SHA
    599780b View commit details
    Browse the repository at this point in the history
  2. Address review comments

    Signed-off-by: Antonin Bas <antonin.bas@broadcom.com>
    antoninbas committed May 28, 2024
    Configuration menu
    Copy the full SHA
    00220b9 View commit details
    Browse the repository at this point in the history