-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kubernetes backend #524
base: master
Are you sure you want to change the base?
Conversation
Oh, and I'm not sure I drove godeps right - i was struggling a bit with it. Should it be updating files under |
@ashb download |
Something's still not adding up -- To start with even to k8s.io/client-go/tools/cache is listed in the Godeps.json (now) it's not writing the file to vendor/ when I run Also if I try to compile it now I get this. I'm guessing I did something wrong? (I have to jump through hoops to get golang.org/x/net/lex/httplex added, because golang.org/x/net/context was pinning x/net to an older version.)
|
Okay I think I finally got something by following the instructions here tools/godep#478 (comment) (I can at least run a |
Although kubernetes isn't a key-value store it provides useful information for some workloads. There are integration tests included for this but they are not run automatically on Travis because it is hard/impossible to get even something like minikube running there.
The previous URL was failing -- this is the URL given in the Amaon docs right now.
It might be useful to know which IPs are not ready so that newly created pods can be bootstrapped -- don't you just love Big E Enterprise workloads?
Sounds fancy! Any updates on this one? |
Any chance for this PR to be accepted / merged? Having access to the Kubernetes resources as a basis for dynamic configuration would be awesome. @ashb any chance you would extend your K8S client to
|
Hi, I've also implemented a k8s backend for confd. It can monitor services, endpoints and statefulsets for now. |
@frittentheke I'll review this PR in January. |
@okushchenko I sent a pull request: #649 I can rename the backend to something else so we can have two implementations of k8s backend if we want to merge both. Thanks. |
I know Kubernetes isn't a key-value store so this might not make immediate sense but confd's mode of operation (of watching for changes, then rendering templates and running reload commands) has been a massive help in moving some of our enterprise applications to kubernetes.
I have written some docs which you can view in rendered form https://godoc.org/github.com/ashb/confd/backends/kubernetes (will work while my fork lasts) I have included a snippet below that shows the keys and their values that I "synthesised" from the API objects.
I have been using this for a week and it's been working for me. I have also written an integration test script (note - it will create a
confd-test
namespace in what ever kube cluster you run it in) but I couldn't find any easy/obvious way to run these tests from Travis.Mapping API Object to Variables
Since confd expects a key-value store and the kubernetes API doesn't expose this directly we have to define our own pattern of variables from the API objects.
The only API objects (and thus initial key path) supported are endpoints.
For a service called "mysvc" it will create the following variables under "/endpoints/mysvc":
A "ports/$port_name" variable for each named port with the port number as the value. Ports with numbers only names are not present.
A set of keys under "ips" for each ready pod
A set of keys under "allips" that combines ready and notready pods
A complete listing of all the variables created in this example service are: