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

Implement commands for listing per-cluster CT/SNAT maps #24629

Commits on Apr 12, 2023

  1. clustermesh: Add a constant of common per-cluster CT map prefix

    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    50b9fab View commit details
    Browse the repository at this point in the history
  2. Introduce GetClusterCTMaps method to PerClusterCTMapper

    Introduce a new method GetClusterCTMaps which gets all CT maps for
    specific cluster.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    570f872 View commit details
    Browse the repository at this point in the history
  3. Fix a bug of dumpAndRead of ct list command

    dumpAndRead takes dump function and argument (args... interface{}) and
    calls dump function with args without expand the args slice. Fix it to
    expand slice.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    7aeeaa5 View commit details
    Browse the repository at this point in the history
  4. cmd: Cleanup bpf ct list command fixture

    In the current `cilium bpf ct list`, we specify the instance of the CT
    maps to dump by reserved word "global" or numeric id of the endpoints.
    This means we recognize the "type" of the CT maps by checking if the
    first argument is string or int and now we're trying to introduce
    another type for per-cluster maps.
    
    It is technically possible to introduce compatible command fixture like
    follows, but the parsing is unnecessarily complicated.
    
    Global   : cilium bpf ct list global
    Enpoints : cilium bpf ct list 12345
    Cluster  : cilium bpf ct list cluster 1
    
    Instead, we can explicitly specify the type by the first argument.
    
    Global   : cilium bpf ct list global
    Enpoints : cilium bpf ct list endpoint 12345
    Cluster  : cilium bpf ct list cluster 1
    
    This breaks the existing command for per-endpoint CT maps, but we
    consider this as an acceptable change since it doesn't change output of
    the command and cilium command fixture is considered as an cilium
    internal things and not a user interface we maintain.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    44e3aa5 View commit details
    Browse the repository at this point in the history
  5. Introduce a command to list per-cluster CT maps

    Introduce a new command `cilium bpf ct list cluster <cluster id>` which
    dumps per-cluster CT maps.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    b1aa908 View commit details
    Browse the repository at this point in the history
  6. Introduce a command to list per-cluster NAT maps

    Introduce a new command `cilium bpf nat list cluster <cluster id>` which
    dumps per-cluster NAT maps.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    5931f43 View commit details
    Browse the repository at this point in the history
  7. Implement from_tunnel field handling in flagString

    Handle from_tunnel in flagString. So that we can show from_tunnel value
    to CLI output.
    
    Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
    YutaroHayakawa committed Apr 12, 2023
    Configuration menu
    Copy the full SHA
    3630bbe View commit details
    Browse the repository at this point in the history