{"id":19236880,"url":"https://github.com/crunchydata/skybridge","last_synced_at":"2025-02-23T13:49:42.218Z","repository":{"id":27045097,"uuid":"30510275","full_name":"CrunchyData/skybridge","owner":"CrunchyData","description":null,"archived":false,"fork":false,"pushed_at":"2016-07-08T14:56:08.000Z","size":6027,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-05T01:40:59.609Z","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/CrunchyData.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-02-08T23:38:47.000Z","updated_at":"2016-07-08T14:56:10.000Z","dependencies_parsed_at":"2022-09-01T02:23:56.912Z","dependency_job_id":null,"html_url":"https://github.com/CrunchyData/skybridge","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fskybridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fskybridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fskybridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrunchyData%2Fskybridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrunchyData","download_url":"https://codeload.github.com/CrunchyData/skybridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324060,"owners_count":19783453,"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":"2024-11-09T16:23:50.490Z","updated_at":"2025-02-23T13:49:42.200Z","avatar_url":"https://github.com/CrunchyData.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nthis container is now deprecated, please see the crunchydata/skybridge2 project\nfor the more recent version of this container.  Also, a similar DNS functionality\nis offered in the crunchydata/crunchy-containers project from the crunchy-dns\ncontainer.\n\n\nskybridge\n===========\n\nskybridge is a small program that listens to Docker events locally\nand adds/removes/updates DNS information on a skydns service\neither locally or remotely. RHEL7/Centos7 64 bit systems are\ncurrently supported.\n\nskybridge is distributed as a Docker image found on github\nat the following location:\n\nhttps://registry.hub.docker.com/u/crunchydata/skybridge\n\nThere is a script to run the skybridge docker container\nfound here:\n\nhttps://github.com/CrunchyData/skybridge/blob/master/bin/run-skybridge.sh\n\n\nenvironment prerequisites\n=========================\n\nFirst, you will need a stable hostname and IP address, so\nset your hostname (e.g. dev.crunchy.lab) using the nmtui utility\nor similar.\n\nSecond, make sure to add your hostname to your /etc/hosts file!\n\nNext, you are setting up a DNS server by installing skybridge!  So,\nyou will need a basic understanding of Linux networking, but\nhere are the basics you will need:\n\nMake sure /etc/resolv.conf specifies your server's IP address as the primary DNS nameserver as follows, using 192.168.0.106 as an example of \nyour server's IP address and 192.168.0.1 as your existing DNS nameserver:\n\n~~~~~~~~~~~~~~~~~~\nnameserver 192.168.0.106\nnameserver 192.168.0.1\n~~~~~~~~~~~~~~~~~~\n\nYou will want to adjust your network settings to ensure that these\nDNS values don't get blown away after you reboot your system! See\nPEERDNS and NetworkManager for details on how to set your\nethernet adapter settings. A static IP address is essential\nfor a production installation, however if you just want to test\nskybridge, and your DHCP address doesn't change very often, you \ncan specify your DHCP assigned address.\n\nDocker Container Installation\n=============================\nThe easy way to run skybridge is to run the Docker container version.\n\nA container has been built that includes etcd, skydns, and skybridge\nready for use.\n\nThe container is located in DockerHub at crunchydata/skybridge:latest\n\nTo execute, run the run-skybridge.sh script found here:\nhttps://github.com/CrunchyData/skybridge/blob/master/bin/run-skybridge.sh\n\nEdit the script, adding your own IP address of your host, the domain\nname of your choice.\n\nThen run the script:\n\nsudo ./run-skybridge.sh\n\nThis script will pull down the skybridge docker image, and execute\nit.\n\nHost Installation\n=====================\nUsers can also run skybridge on their host, outside of a container, by\ndownloading the skybridge installation archive from\nthe following location:\n\n~~~~~~~~~~~~~~~~~~~~~~~~~\nwget https://s3.amazonaws.com/crunchydata/cpm/skybridge.1.0.4-linux-amd64.tar.gz\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThey will un-tar the file and run the install.sh script located\ninside the archive.  The install.sh script will prompt them\nthrough the install. The installation script requires sudo\nprivileges.\n\n~~~~~~~~~~~~~~~~~~~~~~~~~\ntar xvzf skybridge.1.0.0-linux-amd64.tar.gz\n./install.sh\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe install.sh script will prompt the user for the IP address to\nuse for running the etcd/skydns/skybridge services, as well\nas the domain name to use.\n\nsystemd unit files are copied to the user's system (/usr/lib/systemd/system), enabled, and started.\n\nAll installed files are copied to the following directory:\n~~~~~~~~~~~~~~~~~~~~~~~~~\n/var/cpm/bin\n/var/cpm/config\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\nBuilding from Source\n==========================\n\nInstructions below are for building skybridge from source as well\nas packing up skybridge into a user installation archive.  Most\nusers will just want to do a user install and forego building\neverything from scratch.\n\n\netcd\n===========\n\netcd is included in the user installation archive.\n\netcd is used to store DNS information for skydns, in a typical\ndeployment, you would install etcd as a first step\n\nInstall instructions for etcd are found at https://github.com/coreos/etcd/releases\n\nCurrently we are using etcd 2.0.0.\n\nBy default, etcd binds to localhost.\n\nWe specify a location for etcd to store it's data, for\nexample:\n\n~~~~~~~~~~~~~~~~~~\n-data-dir /var/cpm/data/etcd\n~~~~~~~~~~~~~~~~~~\n\n\nStarting etcd\n-----------------\n\nA systemd unit file is provided, etcd.service, for automatically\nstarting etcd, see config/etcd.service for an example.  This file\nis installed when a user performs a skybridge user install using\nthe binary tar archive.\n\nskydns\n=================\nskydns is a DNS server that we are using specifically to\ndiscover Docker container instances.\n\nSkydns uses etcd to store it's data and is therefore a dependency.\n\nWe are currently using skydns 2.0.1d which can be found at:\n~~~~~~~~~~~~~~~~~~\ngit clone git@github.com:skynetservices/skydns.git\ngit checkout tags/2.0.1d\n~~~~~~~~~~~~~~~~~~\n\nAfter building skydns, you will pass a flag to it which identifies\nthe backend etcd system it will use, for example:\n~~~~~~~~~~~~~~~~~~\nexport ETCD_MACHINES='http://192.168.0.106:4001'\n~~~~~~~~~~~~~~~~~~\nor\n~~~~~~~~~~~~~~~~~~\n-machines=127.0.0.1:4001\n~~~~~~~~~~~~~~~~~~\n\nStarting skydns\n-------------------\n\nRemember that DNS is a privileged port and requires you start\nskydns as root if you want to use the default port of DNS (53)\n\nA systemd unit file is provided to start skydns, it is found in\nthe config/skydns.service file.\n\nAfter starting skydns, you can test it using curl.\nExample of adding a host and IP address to skydns using curl:\n~~~~~~~~~~~~~~~~~~\ncurl -XPUT http://127.0.0.1:4001/v2/keys/skydns/lab/crunchy/foo \\\n-d value='{\"host\":\"192.168.0.107\", \"port\":8080}'\ndig foo.crunchy.lab\n~~~~~~~~~~~~~~~~~~\n\nskybridge \n===================\n\nskybridge is meant to be installed on any Docker host.  skybridge\nwill listen to the local Docker service, once a start or stop Docker\nevent is received, skybridge opens a connection to the \nskydns server and makes a skydns REST API call to create or update\na DNS record.\n\nSo, if a Docker container called pgdb1 is started, skybridge\nwill send to skydns the container's IP Address, domain name, and\ncontainer name.\n\nskybridge configuration flags\n----------------------------\n\nDOMAIN\n------\nthis is the DNS domain name to use when registering new containers\nor containers that have been removed, the default is 'crunchy.lab' if\nnot specified, for example:\n~~~~~~~~~~~~~~~\n-d crunchy.lab\n~~~~~~~~~~~~~~~\n\nSKYDNS\n------\nthis is the URL of the etcd server to be used for registering\nDNS information, the default is http://127.0.0.1:4001, if not\nspecified:\n~~~~~~~~~~~~~~~\n-s http://192.168.0.106:4001\n~~~~~~~~~~~~~~~\n\nDOCKER\n------\nthis is the URL of the Docker server socket that will be listened to\nby skybridge, the value of the env variable SWARM_MANAGER_URL is used:\n~~~~~~~~~~~~~~~\n-h tcp://192.168.0.107:8000\n~~~~~~~~~~~~~~~\n\nTTL\n------\nthis is the TTLS value to use when registering DNS values, the default\nis 360 if not specified by this flag:\n~~~~~~~~~~~~~~~\n-t 400\n~~~~~~~~~~~~~~~\n\nStarting skybridge\n-------------------------\n\nA systemd unit file is provided to start skybridge, it is found in\nthe config/skybridge.service file.\n\nExample startup of skybridge that will connect to an etcd service\nrunning at 192.168.0.106:4001 and use a domain name of 'crunchy.lab'\nfor creating new entries in DNS:\n~~~~~~~~~~~~~~~~~~\n./skybridge -s http://192.168.0.106:4001  -d \"crunchy.lab.\"\n~~~~~~~~~~~~~~~~~~\n\nNew entries take the form of containerName.domainname\n\n\nPackaging skybridge\n=====================\nMost users would just want to install the skybridge binary and\ndependent binaries (etcd and skydns).  An archive of the \nessential skybridge files is created by running:\n~~~~~~~~~~~~~~~~~~~~~~~~~\n./bin/package.sh\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThis will create an archive for performing a user install.  Archives\nare stored in the Amazon S3 for users to download.\n\n\nTesting the User Installation\n=============================\n\nAfter the skybridge installation has been performed, you\ncan create a Docker container and then query the DNS name as\nfollows:\n~~~~~~~~~~~~~~~~~~~~~~~~~\ndocker run -d --name=tester busybox /bin/sh\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIn another terminal window:\n~~~~~~~~~~~~~~~~~~~~~~~~~\ndig tester.crunchy.lab\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nIf all is working as normal, the tester.crunchy.lab should resolv\nto your container's IP address.  You can also do a reverse\nDNS lookup using the IP address as follows:\n\n~~~~~~~~~~~~~~~~~~~~~~~~~\ndig 172.17.0.XXX\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunchydata%2Fskybridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrunchydata%2Fskybridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrunchydata%2Fskybridge/lists"}