Public etcd Discovery Service
Go to file
James Blair ca7eaf6f58
Add OWNERS file for discoveryserver. (#7)
Signed-off-by: James Blair <mail@jamesblair.net>
2023-10-02 16:15:27 -05:00
handlers Upgrade go modules (#6) 2022-06-15 19:13:55 -06:00
http Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00
integration Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00
metrics Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00
timeprefix Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00
.gitignore Upgrade go modules (#6) 2022-06-15 19:13:55 -06:00
Dockerfile Upgrade go modules (#6) 2022-06-15 19:13:55 -06:00
OWNERS Add OWNERS file for discoveryserver. (#7) 2023-10-02 16:15:27 -05:00
README.md Add cloudbuild (#3) 2019-11-30 10:26:17 -05:00
cloudbuild.dev.yaml Add cloudbuild prod file (#4) 2020-01-21 20:54:05 -06:00
cloudbuild.prod.yaml Add cloudbuild prod file (#4) 2020-01-21 20:54:05 -06:00
discovery.go Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00
go.mod Upgrade go modules (#6) 2022-06-15 19:13:55 -06:00
go.sum Upgrade go modules (#6) 2022-06-15 19:13:55 -06:00
tests.sh Move discovery server code to its own repo 2019-10-31 12:30:44 -06:00

README.md

discovery.etcd.io

Docker Repository on Quay

This code powers the public service at https://discovery.etcd.io. The API is documented in the etcd clustering documentation.

Building with Docker

Requirements

Docker, using one of the following configurations:

  • macOS You can either use Docker for Mac or docker-machine. See installation instructions here.
  • Linux with local Docker Install Docker according to the instructions for your OS.

To build the image with Docker run:

$ cd path/to/discoveryserver

$ docker build -t discoveryserver .

To create and execute the discoveryserver container run:

docker run discoveryserver

Building on a local OS/shell environment

Go

Discoveryserver is written in Go. If you don't have a Go development environment, please set one up.

discoveryserver requires Go
0.1 =>1.11

Go modules

Discovery server uses Go modules, so that we need a Go version greater than or equal to 1.11.

Build the binary:

go build -v -o ./bin/discovery .

Test

./test.sh

Configuration

The service has three configuration options, and can be configured with either runtime arguments or environment variables.

  • --addr / DISC_ADDR: the address to run the service on, including port.
  • --host / DISC_HOST: the host url to prepend to /new requests.
  • --etcd / DISC_ETCD: the url of the etcd endpoint backing the instance.

Production Configuration

See https://github.com/etcd-io/discovery.etcd.io for how the service is run on Kubernetes.

History

This package implements a super minimal etcd v2 API built on the currently incomplete [v2v3 package]. We need to do this because the public etcd discovery service has been running on the inefficient v2 storage engine and causing operational burden.

Further, to solve operational issues using the v3 API will enable us to use the backup features of the etcd Operator.

Run Cloudbuild

Cloudbuild is a GCP service that can be used to build and deploy discoveryserver. cloudbuild.dev.yaml builds discoverserver, publishes the docker image, and deploys to the dev environment. Cloudbuild.prod.yaml deploys a built docker image to the production environment.

$ export ENV=(dev|prod)
$ gcloud builds submit . --config=cloudbuild.$ENV.yaml --substitutions=COMMIT_SHA=`git rev-parse HEAD`