cni
cni copied to clipboard
CNI v2/ export CNI service via gRPC
Provide CNI service via gRPC.
- [ ] If we define
NetworkConfigList
withAny
field, could we change the format of config file? - [ ] Currently,
AddNetwork
acceptNetworkConfig
andRuntimeConf
, could we just omit NetworkConfig, and use name of NetworkConfig? We could provide List/Add/Del methods for NetworkConfig.
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?
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.
@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.