|
|
|
|
|
by hosh
3317 days ago
|
|
Sorry, I don't have much in the way of examples. I am not using a textual template language. Instead, you define Ruby hashes which is then converted into either json (for loading into Kubernetes) or yaml (for debugging). It takes advantage of method overrides and class/module inheritance to achieve that. Specifications themselves are written as untyped, lazy-evaluated functional style. (Ruby being Ruby, it is not really immutable) I just created a small example with redis: https://gist.github.com/hosh/89099f6f14ca5101e22c55f8d7f9e65... That doesn't show off all of the features in there. There is a Rails-like convention so that resource definitions are loaded and can be referenced within each other. There are additional hooks that lets you generate `kubectl` commands, so for example, on our team, I defined hooks that lets me shell into a running container, or go directly to the console. (Redis, MongoDB, PostgreSQL, Rails, Rabbitmq, etc. consoles) So yeah, Matsuri is very heavy-weight compared to Ksonnet. It isn't just that it is Ruby (already heavy-weight). Feature-wise, it does a lot more. I'm not sure that is a good or a bad thing. |
|