[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Feedback needed: Automating Kubernetes / OpenShift integrations - i.e. building your own controllers

Thanks for the feedback - some comments inline

> On Sep 8, 2016, at 3:44 AM, Tobias Florek <openshift ibotty net> wrote:
> Hi!
> I did not play with it yet but did find the docs:
> https://github.com/openshift/origin/blob/master/docs/man/man1/oc-observe.1
> I wrote a few simple kubernetes/openshift controllers in bash and did not find
> it too hard. There was quiet a bit of overhead though: watching in one
> container, periodic resyncing in another (filtering on already processed
> items), having to think about concurrency (locking). These parts could
> most likely be removed with an observe command. So cheers for that!
> Some things that come to mind are.
> If the script/executable to be run were given environment variables that
> correspond to the object being watched, e.g. for object
> '{"a": [{"b": 1, "c":2 }]}' it would set KUBE_OBSERVE__A__0__B=1 and
> KUBE_OBSERVE__A__0__C=2. That way it's not necessary to use jq or go
> templates (which imo are not easier and not as well documented).

One challenge is we'd have to map special characters into env names
(annotation keys with arbitrary chars) in some cases.  However, we can
do a lot more to document and describe our jsonpath and have examples.

> What to do with scripts failure conditions. How to report these? How to
> collect controller-specific metrics? This is an opportunity to integrate
> this! Let `kube observe` provide commands like kube_observe_log and
> kube_observe_metric accessible from the script to be run.

Observe exposes a metrics endpoint (Prometheus) at /metrics on the
--listenaddr - you can curl that from your script.

Failures can be retried (if you tell us what status code to retry on).
We also track the total number of failures and exit by default - so if
you're running in a pod you can get a warning from the console / tools
because you're restarting.

> It should be able to filter on annotations easily (e.g. `handle_it=true`).

Agree - that's something we want to add and will try to get in.

> It should work with openshift objects ;).

It does!

> Thanks for doing something to make extending kubernetes/openshift
> easier!
> Tobias Florek
> _______________________________________________
> dev mailing list
> dev lists openshift redhat com
> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]