Skip to content

Instantly share code, notes, and snippets.

View kelseyhightower's full-sized avatar

Kelsey Hightower kelseyhightower

View GitHub Profile
[09:21:40] <claytonc> kelseyhightower: do you know if anyone has done http proxying of a subset of the etcd keyspace for clients? I.e. something like `goetcd.NewClient("<host>/path/prefix"); client.Get("/foo/bar")` makes a call to <host>/path/prefix/v2/keys/<someotherprefix>/foo/bar
[09:22:07] <claytonc> use case is to proxy only a subset of the keyspace (for tenants) as well as to host that at a non root url
[09:22:51] <kelseyhightower> claytonc No. I see why you would want to do this, but the main use case I've seen for etcd is single tenant setups
[09:23:21] rmdashfstar (d81ff0e3@gateway/web/freenode/ip.216.31.240.227) left IRC. (Quit: Page closed)
[09:23:30] <claytonc> kelseyhightower: are there any gotchas besides client URL generation and then ensuring the responses are somewhat sane? first problem I could imagine would be that the paths in responses would be wrong
[09:23:40] <kelseyhightower> claytonc my little confd tools does something like this using a prefix, but it's only to generate a te
-- Logs begin at Sat 2014-08-09 14:56:39 UTC, end at Fri 2014-10-03 20:16:12 UTC. --
Sep 28 16:52:37 aurora.c.socialrank-prod.internal systemd[1]: Starting fleet daemon...
Sep 28 16:52:37 aurora.c.socialrank-prod.internal systemd[1]: Started fleet daemon.
Sep 28 16:52:37 aurora.c.socialrank-prod.internal fleetd[720]: INFO fleet.go:141: Using default config file /etc/fleet/fleet.conf
Sep 28 16:52:37 aurora.c.socialrank-prod.internal fleetd[720]: INFO server.go:137: Establishing etcd connectivity
Sep 28 16:52:37 aurora.c.socialrank-prod.internal fleetd[720]: INFO client.go:278: Failed getting response from http://localhost:4001/: dial tcp 127.0.0.1:4001: connection refused
Sep 28 16:52:37 aurora.c.socialrank-prod.internal fleetd[720]: ERROR client.go:200: Unable to get result for {Update /_coreos.com/fleet/machines/f401b3ef329f434eaecb377ed066d9f2/object}, retrying in 100ms
Sep 28 16:52:37 aurora.c.socialrank-prod.internal fleetd[720]: INFO client.go:278: Failed getting response from http://localhost:4001/: dia
confd $ /Users/kelseyhightower/go/bin/confd --debug --scheme https --onetime -confdir ~/confd-examples/
2014-10-06T17:28:06-07:00 Macintosh.local /Users/kelseyhightower/go/bin/confd[76242]: WARNING Skipping confd config file.
2014-10-06T17:28:06-07:00 Macintosh.local /Users/kelseyhightower/go/bin/confd[76242]: NOTICE Backend set to etcd
2014-10-06T17:28:06-07:00 Macintosh.local /Users/kelseyhightower/go/bin/confd[76242]: NOTICE Starting confd
2014-10-06T17:28:06-07:00 Macintosh.local /Users/kelseyhightower/go/bin/confd[76242]: NOTICE Backend nodes set to https://127.0.0.1:4001
2014-10-06T17:28:06-07:00 Macintosh.local /Users/kelseyhightower/go/bin/confd[76242]: ERROR cannot connect to etcd cluster: https://127.0.0.1:4001
confd $ cp ~/Downloads/confd-0.6.1-darwin-amd64 /usr/local/bin/confd
confd $ chmod +x /usr/local/bin/confd
confd $ confd --debug --scheme https --onetime -confdir ~/confd-examples/
2014-10-06T17:31:10-07:00 Macintosh.local confd[76251]: WARNING Skipping confd config file.
2014-10-06T17:31:10-07:00 Macintosh.local confd[76251]: NOTICE Backend set to etcd
2014-10-06T17:31:10-07:00 Macintosh.local confd[76251]: NOTICE Starting confd
2014-10-06T17:31:10-07:00 Macintosh.local confd[76251]: NOTICE Backend nodes set to https://127.0.0.1:4001
2014-10-06T17:31:10-07:00 Macintosh.local confd[76251]: ERROR cannot connect to etcd cluster: https://127.0.0.1:4001
confd $ confd --debug --scheme http --onetime -confdir ~/confd-examples/
2014-10-06T17:31:21-07:00 Macintosh.local confd[76252]: WARNING Skipping confd config file.
confd $ confd --debug --scheme https --onetime -confdir ~/confd-examples/ -node 127.0.0.1:4001
2014-10-06T17:32:23-07:00 Macintosh.local confd[76254]: WARNING Skipping confd config file.
2014-10-06T17:32:23-07:00 Macintosh.local confd[76254]: NOTICE Backend set to etcd
2014-10-06T17:32:23-07:00 Macintosh.local confd[76254]: NOTICE Starting confd
2014-10-06T17:32:23-07:00 Macintosh.local confd[76254]: NOTICE Backend nodes set to https://127.0.0.1:4001
2014-10-06T17:32:23-07:00 Macintosh.local confd[76254]: ERROR cannot connect to etcd cluster: https://127.0.0.1:4001
# confdir
```
$ tree env_confd/
env_confd/
├── conf.d
│   └── nginx.toml
└── templates
└── nginx.tmpl
[Socket]
ListenStream=/var/run/fleet.sock
ListenStream=127.0.0.1:59867
Host: {{.CurrentState.Host}}
PodIP: {{.CurrentState.PodIP}}
Containers: {{range $container := .DesiredState.Manifest.Containers}}
Name: {{$container.Name}}{{range $port := $container.Ports}}
HostPort: {{$port.HostPort}}
ContainerPort: {{$port.ContainerPort}}{{end}}{{end}}
[Unit]
Description=Go Commit Watcher
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=/usr/bin/curl -s --create-dirs \
-z docker-commitwatcher.tar.gz \
-o /opt/docker-commitwatcher.tar.gz \
http://storage.googleapis.com/golang-testing/docker-commitwatcher.tar.gz
# Copyright 2014 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Commit Watcher image: gobuilders/commitwatcher
FROM ubuntu:trusty
MAINTAINER golang-dev <[email protected]>
RUN apt-get update -y && apt-get install --no-install-recommends -y -q curl build-essential ca-certificates git mercurial bzr