{"action":"created","comment":{"url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments/125296622","pull_request_review_id":47672655,"id":125296622,"diff_hunk":"@@ -0,0 +1,82 @@\n+# Using CNI Interfaces and libvirt for networking\n+\n+Author: Fabian Deutsch \\<fabiand@redhat.com\\>\n+\n+## Introduction\n+\n+Today networking in KubeVirt is not integrated with Kubernetes, a user can\n+rather choose to create a specific VM Spec definition to create a particular\n+libvirt domxml, to reuse an existing physical device.\n+But this is obviously suboptimal\n+\n+- It is not integrated with Kubernetes\n+- It does not provide connectivity with pods\n+- It requires to specify host specific bits (the network device to use)\n+\n+The purpose of this document is to describe one approach of how we can provide\n+a minimal integrated solution, with few workarounds.\n+\n+\n+## Use-case\n+\n+The primary use-case is to allow VM to get connected to the pod network.\n+\n+\n+## API\n+\n+The API is pretty clear: As usual an interface will be defined.\n+To indicate that Pod interfaces shall be used for networking, a new type\n+`pod-network` is introduced.\n+All other fields, concerning the properties of the virtual NIC, can be used\n+as usual.\n+\n+```yaml\n+kind: VM\n+spec:\n+  domain:\n+    devices:\n+      interfaces:\n+      - type: pod-network\n+        mac:\n+          address: 00:11:22:33:44:55\n+        model:\n+          type: virtio\n+        source:\n+          network: default\n+```\n+\n+The `source` field can be omitted initially, as Kubernetes only provides a\n+single network for Pods today.\n+In future we might want to allow it to select the Pod network to connect to.\n+\n+\n+## Implementation\n+\n+The broader steps to enable networking in the described way:\n+\n+1. Request/Create a new Pod interface on the libvirt pod\n+2. Remember the IP of the Pod interface, then remove it from the Pod interface\n+3. Create a libvirt network, backed by a bridge, enable DHCP,\n+   and add a single host entry, with the IP address of the Pod, and the MAC\n+   address of the corresponding virtual NIC of the VM","path":"docs/libvirt-pod-networking.md","position":61,"original_position":61,"commit_id":"c6ce3b281b153c88645a4adf87b6e54c0fa57c7d","original_commit_id":"c6ce3b281b153c88645a4adf87b6e54c0fa57c7d","user":{"login":"rmohr","id":4534621,"avatar_url":"https://avatars0.githubusercontent.com/u/4534621?v=3","gravatar_id":"","url":"https://api.github.com/users/rmohr","html_url":"https://github.com/rmohr","followers_url":"https://api.github.com/users/rmohr/followers","following_url":"https://api.github.com/users/rmohr/following{/other_user}","gists_url":"https://api.github.com/users/rmohr/gists{/gist_id}","starred_url":"https://api.github.com/users/rmohr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmohr/subscriptions","organizations_url":"https://api.github.com/users/rmohr/orgs","repos_url":"https://api.github.com/users/rmohr/repos","events_url":"https://api.github.com/users/rmohr/events{/privacy}","received_events_url":"https://api.github.com/users/rmohr/received_events","type":"User","site_admin":false},"body":"Hm, @fabiand, I think you leave the Pod IP of the libvirt pod alone. It can be used by libvirt/qemu for spice, ...\r\n\r\nTo get new IPs for VMs, virt-handler or something on that layer would call CNI directly, to add a new device the the libvirt Pod namespace. Then you use this IP and send the traffic through the device, created by CNI for this IP. That should pretty much overcome the problems mentioned .\r\n\r\nvirt-handler can also shutdown the devices via CNI, after the VM stopped, so that the IP is returned to the provider pool. The question is, how we can weave that properly into the Pod shutdown process.","created_at":"2017-07-03T14:03:19Z","updated_at":"2017-07-03T14:03:19Z","html_url":"https://github.com/kubevirt/kubevirt/pull/279#discussion_r125296622","pull_request_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279","_links":{"self":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments/125296622"},"html":{"href":"https://github.com/kubevirt/kubevirt/pull/279#discussion_r125296622"},"pull_request":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279"}}},"pull_request":{"url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279","id":128234876,"html_url":"https://github.com/kubevirt/kubevirt/pull/279","diff_url":"https://github.com/kubevirt/kubevirt/pull/279.diff","patch_url":"https://github.com/kubevirt/kubevirt/pull/279.patch","issue_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/279","number":279,"state":"open","locked":false,"title":"docs: Use pod networking with libvirt","user":{"login":"fabiand","id":83456,"avatar_url":"https://avatars2.githubusercontent.com/u/83456?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiand","html_url":"https://github.com/fabiand","followers_url":"https://api.github.com/users/fabiand/followers","following_url":"https://api.github.com/users/fabiand/following{/other_user}","gists_url":"https://api.github.com/users/fabiand/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiand/subscriptions","organizations_url":"https://api.github.com/users/fabiand/orgs","repos_url":"https://api.github.com/users/fabiand/repos","events_url":"https://api.github.com/users/fabiand/events{/privacy}","received_events_url":"https://api.github.com/users/fabiand/received_events","type":"User","site_admin":false},"body":"This document is drafting how pod networking and libvirt can be used\r\nin a stock (or most stock) Kubernetes environments to provide network\r\nconnectivity to virtual machines.\r\n\r\nDesign for kubevirt/kubevirt#261\r\n\r\nSigned-off-by: Fabian Deutsch <fabiand@fedoraproject.org>","created_at":"2017-06-29T20:00:42Z","updated_at":"2017-07-03T14:03:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e134679feb811633e5730d4cb0709c7cbe78f29a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279/commits","review_comments_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279/comments","review_comment_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/279/comments","statuses_url":"https://api.github.com/repos/kubevirt/kubevirt/statuses/c6ce3b281b153c88645a4adf87b6e54c0fa57c7d","head":{"label":"fabiand:libvirt-pod-networking","ref":"libvirt-pod-networking","sha":"c6ce3b281b153c88645a4adf87b6e54c0fa57c7d","user":{"login":"fabiand","id":83456,"avatar_url":"https://avatars2.githubusercontent.com/u/83456?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiand","html_url":"https://github.com/fabiand","followers_url":"https://api.github.com/users/fabiand/followers","following_url":"https://api.github.com/users/fabiand/following{/other_user}","gists_url":"https://api.github.com/users/fabiand/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiand/subscriptions","organizations_url":"https://api.github.com/users/fabiand/orgs","repos_url":"https://api.github.com/users/fabiand/repos","events_url":"https://api.github.com/users/fabiand/events{/privacy}","received_events_url":"https://api.github.com/users/fabiand/received_events","type":"User","site_admin":false},"repo":{"id":76869407,"name":"kubevirt","full_name":"fabiand/kubevirt","owner":{"login":"fabiand","id":83456,"avatar_url":"https://avatars2.githubusercontent.com/u/83456?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiand","html_url":"https://github.com/fabiand","followers_url":"https://api.github.com/users/fabiand/followers","following_url":"https://api.github.com/users/fabiand/following{/other_user}","gists_url":"https://api.github.com/users/fabiand/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiand/subscriptions","organizations_url":"https://api.github.com/users/fabiand/orgs","repos_url":"https://api.github.com/users/fabiand/repos","events_url":"https://api.github.com/users/fabiand/events{/privacy}","received_events_url":"https://api.github.com/users/fabiand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fabiand/kubevirt","description":"KubeVirt is a virtual machine management architecture built around Kubernetes.","fork":true,"url":"https://api.github.com/repos/fabiand/kubevirt","forks_url":"https://api.github.com/repos/fabiand/kubevirt/forks","keys_url":"https://api.github.com/repos/fabiand/kubevirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fabiand/kubevirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fabiand/kubevirt/teams","hooks_url":"https://api.github.com/repos/fabiand/kubevirt/hooks","issue_events_url":"https://api.github.com/repos/fabiand/kubevirt/issues/events{/number}","events_url":"https://api.github.com/repos/fabiand/kubevirt/events","assignees_url":"https://api.github.com/repos/fabiand/kubevirt/assignees{/user}","branches_url":"https://api.github.com/repos/fabiand/kubevirt/branches{/branch}","tags_url":"https://api.github.com/repos/fabiand/kubevirt/tags","blobs_url":"https://api.github.com/repos/fabiand/kubevirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fabiand/kubevirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fabiand/kubevirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/fabiand/kubevirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fabiand/kubevirt/statuses/{sha}","languages_url":"https://api.github.com/repos/fabiand/kubevirt/languages","stargazers_url":"https://api.github.com/repos/fabiand/kubevirt/stargazers","contributors_url":"https://api.github.com/repos/fabiand/kubevirt/contributors","subscribers_url":"https://api.github.com/repos/fabiand/kubevirt/subscribers","subscription_url":"https://api.github.com/repos/fabiand/kubevirt/subscription","commits_url":"https://api.github.com/repos/fabiand/kubevirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/fabiand/kubevirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/fabiand/kubevirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/fabiand/kubevirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/fabiand/kubevirt/contents/{+path}","compare_url":"https://api.github.com/repos/fabiand/kubevirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fabiand/kubevirt/merges","archive_url":"https://api.github.com/repos/fabiand/kubevirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fabiand/kubevirt/downloads","issues_url":"https://api.github.com/repos/fabiand/kubevirt/issues{/number}","pulls_url":"https://api.github.com/repos/fabiand/kubevirt/pulls{/number}","milestones_url":"https://api.github.com/repos/fabiand/kubevirt/milestones{/number}","notifications_url":"https://api.github.com/repos/fabiand/kubevirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fabiand/kubevirt/labels{/name}","releases_url":"https://api.github.com/repos/fabiand/kubevirt/releases{/id}","deployments_url":"https://api.github.com/repos/fabiand/kubevirt/deployments","created_at":"2016-12-19T14:34:49Z","updated_at":"2016-12-19T14:34:50Z","pushed_at":"2017-06-30T09:49:08Z","git_url":"git://github.com/fabiand/kubevirt.git","ssh_url":"git@github.com:fabiand/kubevirt.git","clone_url":"https://github.com/fabiand/kubevirt.git","svn_url":"https://github.com/fabiand/kubevirt","homepage":null,"size":16438,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubevirt:master","ref":"master","sha":"f48fc7c6798103584fed4a9f5d2eb8b668b4f361","user":{"login":"kubevirt","id":18700703,"avatar_url":"https://avatars2.githubusercontent.com/u/18700703?v=3","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"repo":{"id":76686583,"name":"kubevirt","full_name":"kubevirt/kubevirt","owner":{"login":"kubevirt","id":18700703,"avatar_url":"https://avatars2.githubusercontent.com/u/18700703?v=3","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubevirt/kubevirt","description":"KubeVirt is a virtual machine management add-on for Kubernetes.","fork":false,"url":"https://api.github.com/repos/kubevirt/kubevirt","forks_url":"https://api.github.com/repos/kubevirt/kubevirt/forks","keys_url":"https://api.github.com/repos/kubevirt/kubevirt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubevirt/kubevirt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubevirt/kubevirt/teams","hooks_url":"https://api.github.com/repos/kubevirt/kubevirt/hooks","issue_events_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/events{/number}","events_url":"https://api.github.com/repos/kubevirt/kubevirt/events","assignees_url":"https://api.github.com/repos/kubevirt/kubevirt/assignees{/user}","branches_url":"https://api.github.com/repos/kubevirt/kubevirt/branches{/branch}","tags_url":"https://api.github.com/repos/kubevirt/kubevirt/tags","blobs_url":"https://api.github.com/repos/kubevirt/kubevirt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubevirt/kubevirt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubevirt/kubevirt/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubevirt/kubevirt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubevirt/kubevirt/statuses/{sha}","languages_url":"https://api.github.com/repos/kubevirt/kubevirt/languages","stargazers_url":"https://api.github.com/repos/kubevirt/kubevirt/stargazers","contributors_url":"https://api.github.com/repos/kubevirt/kubevirt/contributors","subscribers_url":"https://api.github.com/repos/kubevirt/kubevirt/subscribers","subscription_url":"https://api.github.com/repos/kubevirt/kubevirt/subscription","commits_url":"https://api.github.com/repos/kubevirt/kubevirt/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubevirt/kubevirt/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubevirt/kubevirt/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubevirt/kubevirt/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubevirt/kubevirt/contents/{+path}","compare_url":"https://api.github.com/repos/kubevirt/kubevirt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubevirt/kubevirt/merges","archive_url":"https://api.github.com/repos/kubevirt/kubevirt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubevirt/kubevirt/downloads","issues_url":"https://api.github.com/repos/kubevirt/kubevirt/issues{/number}","pulls_url":"https://api.github.com/repos/kubevirt/kubevirt/pulls{/number}","milestones_url":"https://api.github.com/repos/kubevirt/kubevirt/milestones{/number}","notifications_url":"https://api.github.com/repos/kubevirt/kubevirt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubevirt/kubevirt/labels{/name}","releases_url":"https://api.github.com/repos/kubevirt/kubevirt/releases{/id}","deployments_url":"https://api.github.com/repos/kubevirt/kubevirt/deployments","created_at":"2016-12-16T21:24:26Z","updated_at":"2017-07-03T03:57:11Z","pushed_at":"2017-07-03T13:01:43Z","git_url":"git://github.com/kubevirt/kubevirt.git","ssh_url":"git@github.com:kubevirt/kubevirt.git","clone_url":"https://github.com/kubevirt/kubevirt.git","svn_url":"https://github.com/kubevirt/kubevirt","homepage":"","size":1923,"stargazers_count":218,"watchers_count":218,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":53,"forks":43,"open_issues":53,"watchers":218,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279"},"html":{"href":"https://github.com/kubevirt/kubevirt/pull/279"},"issue":{"href":"https://api.github.com/repos/kubevirt/kubevirt/issues/279"},"comments":{"href":"https://api.github.com/repos/kubevirt/kubevirt/issues/279/comments"},"review_comments":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279/comments"},"review_comment":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubevirt/kubevirt/pulls/279/commits"},"statuses":{"href":"https://api.github.com/repos/kubevirt/kubevirt/statuses/c6ce3b281b153c88645a4adf87b6e54c0fa57c7d"}}}}
{"actor":{"display_login":"rmohr"}}