Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Adding support for VM based runtimes #2

Open
mcastelino opened this issue Nov 30, 2017 · 4 comments
Open

Adding support for VM based runtimes #2

mcastelino opened this issue Nov 30, 2017 · 4 comments

Comments

@mcastelino
Copy link

Today when invoking the CNI plugin the return value typically looks like

{
  "ip4": {
    "ip": "10.56.217.133/24",
    "gateway": "10.56.217.1",
    "routes": [
      {
        "dst": "0.0.0.0/0"
      }
    ]
  },
  "dns": {}
}

The vhost socket information is passed in via volumes in

/var/lib/cni/vhostuser/

However for VM based runtimes which can consume the vhost-user socket directly, sending out an additional value say

   "vhostfd": "/path/to/vhost/fd"

would be helpful.

A runtime would be free to ignore fields it did not recognize.
golang json unmarshalling skips fields it does not recognize.

@rkamudhan
Copy link
Contributor

@mcastelino Are you using clear containers or hyperd in your kubernetes cluster? I worked in both container runtime long back, like to get your idea on it.

@mcastelino
Copy link
Author

@rkamudhan yes on Clear Containers. We already have support for vhost-user with our own CNM plugin for VPP. https://github.com/clearcontainers/vpp.

However here we setup a dummy interface to send in the information.

With CNI it should be much cleaner, specially since unrecognized fields are skipped.
Ideally extending CNI results field would be better. There is a thread about it based on another requirement

containernetworking/cni#513 (comment)

@rkamudhan
Copy link
Contributor

oh cool, got your idea on it. Is that runtime not designed to ignore additional fields? I may be wrong, runtime care for IPAM information only right?

@mcastelino
Copy link
Author

I meant json unmarshalling will drop that field so that runtimes that do not know or care about this field can ignore them till the spec gets standardized. They will not even see the field

https://play.golang.org/p/JTQTlWG5Ub

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

No branches or pull requests

2 participants