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

CNI v2/ export CNI service via gRPC #874

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

robberphex
Copy link

@robberphex robberphex commented Jan 3, 2022

Provide CNI service via gRPC.

  • If we define NetworkConfigList with Any field, could we change the format of config file?
  • Currently, AddNetwork accept NetworkConfig and RuntimeConf, could we just omit NetworkConfig, and use name of NetworkConfig?
    We could provide List/Add/Del methods for NetworkConfig.

@robberphex robberphex marked this pull request as draft January 3, 2022 15:43
@robberphex robberphex changed the title CNI v2 CNI v2/ export CNI service via gRPC Jan 3, 2022
Signed-off-by: luyanbo <robert.lyb@alibaba-inc.com>
Signed-off-by: luyanbo <robert.lyb@alibaba-inc.com>
@robberphex
Copy link
Author

Example network configuration could be like:

{
  "cniVersion": "1.0.0",
  "name": "dbnet",
  "plugins": [
    {
      "type": "bridge",
      "bridge": "cni0",
      "extra": [
        {
          // **plugin specific parameters for nerdctl**
          "@type": "type.googleapis.com/helloworld.NerdctlNetworkConfig",
          "NerdctlID": 112233,
          "NerdctlLabels": {
            "bob": "11"
          }
        },
        {
          // **plugin specific parameters for bridge**
          "@type": "type.googleapis.com/k8s.cni.cncf.io/v1.0.0.BridgeNetworkConfig",
          "configKey": "configValue"
        }
      ],
      "ipam": {
        "type": "host-local",
        // ipam specific
        "subnet": "10.1.0.0/16",
        "gateway": "10.1.0.1",
        "routes": [
          {
            "dst": "0.0.0.0/0"
          }
        ]
      },
      "dns": {
        "nameservers": [
          "10.1.0.1"
        ]
      }
    },
    {
      "type": "tuning",
      "capabilities": {
        "mac": true
      },
      "sysctl": {
        "net.core.somaxconn": "500"
      }
    },
    {
      "type": "portmap",
      "capabilities": {
        "portMappings": true
      }
    }
  ]
}

And this kind of config can be decoded to protobuf/json format.

@squeed Any ideas?

@mars1024
Copy link
Member

mars1024 commented Jan 5, 2022

Hi @robberphex , thanks for your effort, but CNI v2 is not just a simple migration from v1, even SPEC may change. We need more discussions before reaching implementation, even a detailed enhancement proposal.

@MikeZappa87
Copy link
Contributor

@robberphex I was just trying to do this and realized you had done some of the work. I am trying to get the gRPC conversations moving again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants