Hacker News new | past | comments | ask | show | jobs | submit login

From looking at your KY tool, it sounds like the pain point you're having is that there's a lot of boilerplate repetition around loading configmaps and secrets into your containers, is that correct?

If that's not far off the mark, have you looked at using an object-oriented k8s client? I've been playing with a pattern where I create classes which know how to render themselves into k8s API objects, and that gives the ability to use language-level looping to create, for example, lists of env variable definitions in the resultant spec.

I'm writing python apps so PyKube[1] is the base client that I've used, but there are clients in lots of languages at this point.

I also tried out Helm, which looks like it has a way of generating k8s yaml files using Go templates, and given a set of config parameters[2]. Unfortunately my use case was a bit too dynamic to fit in that mould, but this seems like it could be useful for many things.

[1]: https://github.com/kelproject/pykube/ [2]: https://github.com/kubernetes/helm/blob/master/docs/examples...




Sorry I didn't see this sooner! The repetition is definitely something that bothered me in the early working versions of our app on kubernetes, and also the general lack of reproducibility and manual fiddling that might be required to make changes or create new services, and the difficulty of having the configuration live in the code so it can change on a per branch basis, and have that branch built correctly by CI when it goes to QA/staging.

ky is definitely still just in the "maybe useful/maybe practical" territory, but now that the basic concept of compiling from a Procfile seems to work, I suspect adding some configuration and more environment aware and extensible/overrideable templating could make it pretty practical, but I also had/have my eye on Helm. There may be some practical/logistical complications in using Helm, and I think if we went that way we'd probably go full hog and use Deis Workflow (https://deis.com/workflow/), which also deserved mention in this thread's discussion, but the k8s clients like the python one you point to or the ruby one (https://github.com/abonas/kubeclient) may be worth bringing into the mix depending on how this all works out... Thanks for the links and for having a look!


Cool, thanks for the explanation. Interesting times living on the frontier here, lots of best practices (and the tools to support them) yet to be written. Definitely interested to follow your experiences, keep sharing :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: