{"id":19738717,"url":"https://github.com/linkernetworks/network-controller","last_synced_at":"2025-06-12T07:36:49.877Z","repository":{"id":57565975,"uuid":"135435699","full_name":"linkernetworks/network-controller","owner":"linkernetworks","description":"🦃️🦃️🦃️🦃️🦃️ A Kubernetes CNI Network Controller Implement in Go","archived":false,"fork":false,"pushed_at":"2019-02-26T09:04:41.000Z","size":4851,"stargazers_count":30,"open_issues_count":2,"forks_count":10,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-30T05:35:48.892Z","etag":null,"topics":["cni","kubernetes","sdn","sdn-controller"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linkernetworks.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-30T11:55:33.000Z","updated_at":"2024-05-31T21:50:39.000Z","dependencies_parsed_at":"2022-08-27T19:00:57.990Z","dependency_job_id":null,"html_url":"https://github.com/linkernetworks/network-controller","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/linkernetworks/network-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkernetworks%2Fnetwork-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkernetworks%2Fnetwork-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkernetworks%2Fnetwork-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkernetworks%2Fnetwork-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linkernetworks","download_url":"https://codeload.github.com/linkernetworks/network-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linkernetworks%2Fnetwork-controller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259421198,"owners_count":22854760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cni","kubernetes","sdn","sdn-controller"],"created_at":"2024-11-12T01:15:02.048Z","updated_at":"2025-06-12T07:36:49.820Z","avatar_url":"https://github.com/linkernetworks.png","language":"Go","funding_links":[],"categories":["Networking"],"sub_categories":["[Jenkins](#jenkins)"],"readme":"# CNI Network Controller [![Build Status](https://travis-ci.org/linkernetworks/network-controller.svg?branch=master)](https://travis-ci.org/linkernetworks/network-controller) [![codecov](https://codecov.io/gh/linkernetworks/network-controller/branch/master/graph/badge.svg)](https://codecov.io/gh/linkernetworks/network-controller) [![Go Report Card](https://goreportcard.com/badge/github.com/linkernetworks/network-controller)](https://goreportcard.com/report/github.com/linkernetworks/network-controller)  [![Docker Build Status](https://img.shields.io/docker/build/sdnvortex/network-controller.svg)](https://hub.docker.com/r/sdnvortex/network-controller/)\n\n![overview](./images/overview.png)\n\nOpen vSwitch, Multiple network interfaces that associate with kubernetes pods, etc.\n\n## Table of Contents\n* [Development](#development)\n* [Usage](#usage)\n  + [Run a Server](#run-a-server)\n  + [Run a Client](#run-a-client)\n    - [Bridge Name](#bridge-name)\n    - [Interface Name](#interface-name)\n    - [IP Address of the interface](#ip-address-of-the-interface)\n    - [Add VLAN tag into the interface](#add-vlan-tag-into-the-interface)\n    - [Add a IP routing table(Add route)](#add-a-ip-routing-tableadd-route)\n    - [Server](#server)\n    - [Example](#example)\n\n## Development\n\n```shell\n# generate protocol buffer\nmake pb\n\n# make server binary\nmake server\n\n# make client binary\nmake client\n\n# make test (You should run this before push codes)\nmake test\n```\n\n## Usage\n\n### Run as a server\nThe network-controller server provide two ways to listen, TCP and Unix domain socket. If you want to run as a UNIX domain socket server, you should specify a path to store the sock file and server will remove that file when server is been terminated.\n```shell\n./server/network-controller-server -unix=/tmp/a.sock\n```\nFor the TCP server, just use the `IP:PORT` format, for example, `0.0.0.0:50051`\n```shell\n./server/network-controller-server -tcp=0.0.0.0:50051\n```\n\n### Run as a client\nThe clinet is used for the kubernetes pod to create the veth and you can see the example yaml in `example/kubernetes/*.yaml` to see how to use this client.\n\nFor creating a veth for Pod, the client needs the following information\n- Pod Name\n- Pod Namespace\n- Pod UUID\n- Target Bridge Name\n- The Interface Name in the container\n- IP Address of the interface in the container\n- Add VLAN tag into the interface\n- Add a IP routing table(Add route)\n- The server address\n\nThe first three variable can passed by the environemtn `POD_NAME`, `POD_NAMESPACE` and `POD_UUID`.\n\n#### Bridge Name\n`-b` or `--bridge` Target bridge name.\n\n#### Interface Name\n`-n` or `--nic` The interface name in the container.\n\n#### IP Address of the interface\n`-i` or `--ip` The ip address of the interface, should be a valid v4 CIDR address.\n\n#### Add VLAN tag into the interface\n`-v` or `--vlan` The Vlan Tag of the interface.\n\n#### Add route via gateway. Can add multiple times\n`--route-gw` Add route for the destination network cidr on interface.\n\n#### Add route via interface. Can add multiple times\n`--route-intf` Add route for the destination network cidr and gateway ip on interface.\n\n#### Add a IP routing table (Add route). Deprecated in the future\n`--net` The destination network for add IP routing table, like \"-net target\".\n\n`-g` or `--gateway` The gateway of the interface subnet.\n\n#### Servers\nThe clinet support two way to connect to the server, TCP socket and UNIX domain socket. In the TCP mode, use the `IP:PORT` format to connect to TCP server.\n```shell\n./client/network-controller-client -server=0.0.0.0:50051\n```\nFot the UNIX domain socket mode, you should use the `unix://PATH` format to connect to server. Assume the path is `/tmp/a.sock` and you can use the following command to connect\n```shell\n./client/network-controller-client -server=unix:///tmp/a.sock\n```\n\n#### Example\nFollowing is an example of the client and you can see more use the `--help`.\n```shell\n./clinet/network-controller-client \\ \n    --server unix:///tmp/vortex/vortex.sock \\ \n    --bridge br100 \\\n    --nic eth100 \\ \n    --ip 192.168.2.2/24 \\\n    --net 239.0.0.0/4 \\\n    --gateway 0.0.0.0\n\n./clinet/network-controller-client \\ \n    --server unix:///tmp/vortex/vortex.sock \\ \n    --bridge br99 \\\n    --nic eth99 \\ \n    --route-intf 239.0.0.0/4 \\\n    --route-intf 224.0.0.0/4\n\n./clinet/network-controller-client \\ \n    --server unix:///tmp/vortex/vortex.sock \\ \n    --bridge br98 \\\n    --nic eth98 \\ \n    --route-gw 192.168.2.0/24,192.168.2.254 \\\n    --route-gw 192.168.1.0/24,192.168.1.1\n\n\n./clinet/network-controller-client \\ \n    --server unix:///tmp/vortex/vortex.sock \\ \n    --bridge br98 \\\n    --nic eth98 \\ \n    --route-intf 239.0.0.0/4 \\\n    --route-gw 192.168.1.0/24,192.168.1.1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkernetworks%2Fnetwork-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinkernetworks%2Fnetwork-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinkernetworks%2Fnetwork-controller/lists"}