{"id":27294473,"url":"https://github.com/nerdalert/gitnet-overlay","last_synced_at":"2025-04-11T22:53:13.944Z","repository":{"id":36650269,"uuid":"40956561","full_name":"nerdalert/gitnet-overlay","owner":"nerdalert","description":"Git Network Boostrapping ","archived":false,"fork":false,"pushed_at":"2015-10-23T21:10:25.000Z","size":176,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T22:53:13.418Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/nerdalert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-18T07:09:13.000Z","updated_at":"2018-10-28T08:59:56.000Z","dependencies_parsed_at":"2022-08-30T11:51:21.292Z","dependency_job_id":null,"html_url":"https://github.com/nerdalert/gitnet-overlay","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalert%2Fgitnet-overlay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalert%2Fgitnet-overlay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalert%2Fgitnet-overlay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nerdalert%2Fgitnet-overlay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nerdalert","download_url":"https://codeload.github.com/nerdalert/gitnet-overlay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492951,"owners_count":21113162,"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":[],"created_at":"2025-04-11T22:53:12.393Z","updated_at":"2025-04-11T22:53:13.933Z","avatar_url":"https://github.com/nerdalert.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"ipvlan-docker-plugin\n=================\n\nIPVlan is a lightweight L2 and L3 network implementation that does not require traditional bridges. The purpose of this is to have references for plugging into the docker networking APIs which are now available as part of libnetwork. Libnetwork is still under development and is considered as experimental at this point.\n\nThis example uses Git to bootstrap multi-host environment. I like the idea of using git as a datastore since it offers a good amount of operational oversite and collaboration along with a record of exactly what changed in the infra. If infrastructure as code is the paradigm, then infra code being sourced from Git makes sense to me.\n\nThe Docker hosts need to share the same network segment at the moment as I havent tested beyond that. I will add VXLAN tunnels to abstract the underlay and next hop routes for IPVlan L3 mode is all that is required for connectivity. The same concept with Quagga or a BGP daemon could be used with IPVlan for underlay integration as desired.\n\n### Pre-Requisites\n\n1. Install the Docker experimental binary from the instructions at: [Docker Experimental](https://github.com/docker/docker/tree/master/experimental). (stop other docker instances)\n\t- Quick Experimental Install: `wget -qO- https://experimental.docker.com/ | sh`\n\n### QuickStart Instructions (L2 Mode)\n\n1. Start Docker with the following. **TODO:** How to specify the plugin socket without having to pass a bridge name `foo` since ipvlan/macvlan do not use traditional bridges. This example is running docker in the foreground so you can see the logs realtime.\n\n```\n    docker -d --default-network=ipvlan:foo`\n```\n\n2. Start a Git server. An easy one to use is [go git service](http://gogs.io/docs/installation/install_from_binary.md).\n\nAn example `ini` file to listen on port 80 and respond to `git clone http://username:passwd@172.16.86.1/username/git-overlay.git`\n\n```\nAPP_NAME = Gogs: Go Git Service\nRUN_USER = root\nRUN_MODE = prod\n\n[database]\nDB_TYPE = sqlite3\nHOST = 127.0.0.1:3306\nNAME = gogs\nUSER = root\nPASSWD =\nSSL_MODE = disable\nPATH = data/gogs.db\n\n[repository]\nROOT = /Users/brent/gogs-repositories\n\n[server]\nDOMAIN = localhost\nHTTP_PORT = 80\nROOT_URL = http://172.16.86.1:3000/\nOFFLINE_MODE = false\n```\n\nStart with:\n```\n sudo ./gogs web -c \"custom/conf/app.ini\"\n```\n\n3. Start the plugin on 2 Docker hosts. Both examples use a debug flag `-d` for lots of extra info.\n\n# Host #1 example:\n```\ngo run main.go -d --host-interface=eth2 --mode=l3 --ipvlan-subnet=10.1.48.0/24 --git-multihost=true --repo=\"http://username:passwd@172.16.86.1/username/git-overlay.git\"\n```\n\n# Host #2 example:\n\n```\ngo run main.go -d --host-interface=eth2 --mode=l3 --ipvlan-subnet=10.1.51.0/24 --git-multihost=true --repo=\"http://username:passwd@172.16.86.1/username/git-overlay.git\"\n```\n\nLastly start up some containers and check reachability:\n\n```\ndocker run -i -t --rm ubuntu\n```\n\nSome example debug output is:\n\n```\nDEBU[0033] copying [ data/endpoints.latest ] endpoint cache to [ data/endpoints.old ] endpoint cache dir for diffing\nDEBU[0042] Interval time expired\nDEBU[0042] Running: git -C data/endpoints.latest pull\nremote: Counting objects: 4, done.\nremote: Compressing objects: 100% (3/3), done.\nremote: Total 4 (delta 0), reused 4 (delta 0)\nUnpacking objects: 100% (4/4), done.\nFrom http://172.16.86.1/nerdalert/git-overlay\n + 3418d2a...f7aadc2 master     -\u003e origin/master  (forced update)\nMerge made by the 'recursive' strategy.\n endpoints/10.1.1.51.json | 7 +++++++\n 1 file changed, 7 insertions(+)\n create mode 100644 endpoints/10.1.1.51.json\n20150818023229\nDEBU[0043] checking repo for updates 2015-08-18 06:32:29.761949388 +0000 UTC\nDEBU[0043] New records learned [10.1.1.51.json]\nINFO[0043] Endpoint [ 10.1.1.51.json ] was added\nDEBU[0043] Umarshalled New Endpoint: [ 10.1.1.51 ]\nDEBU[0043] Umarshalled Network [ 10.1.51.0/24 ]\nDEBU[0043] Umarshalled Meta [  ]\nDEBU[0043] Umarshalled SegID [ 0 ]\nWARN[0043] Remote endpoint [ 10.1.1.51 ] != Local endpoint [ 10.1.1.48 ] adding route to remote endpoint [ 10.1.1.51 ] using interface [ eth2 ]\nDEBU[0043] Adding route in the default namespace for IPVlan L3 mode with the following:\nDEBU[0043] IP Prefix: [ 10.1.51.0/24 ] - Next Hop: [ 10.1.1.51 ] - Source Interface: [ eth2 ]\nDEBU[0043] Current record list: [10.1.1.48.json 10.1.1.51.json]\nINFO[0043] Records removed [ [] ]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdalert%2Fgitnet-overlay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnerdalert%2Fgitnet-overlay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnerdalert%2Fgitnet-overlay/lists"}