-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
2.0: Protobuf / gRPC: how to pass network configuration to plugins? #887
Labels
Comments
squeed
changed the title
2.0: Protobuf / gRPC: how to pass arbitrary data?
2.0: Protobuf / gRPC: how to pass network configuration to plugins?
Mar 23, 2022
In CNI 2.0, we provide gRPC/Protobuf definition, so I think use protobuf any type is nature.
{
"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 protobuf any type can be converted to json. I submitted a pr, #874 . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assuming we move forward with daemonization (#821), then we will have to write a protobuf schema for the CNI protocol. This tpresents a few awkward edges around network configuration.
The gist of the issue is this:
2.1. The same plugin can be used in different networks in the same container.
So, we need some way to ergonomically pass, to a plugin, a network configuration. This configuration is user-defined but plugin specific.
Options
The text was updated successfully, but these errors were encountered: