Hi Keith
ksonnet like you already know is just a bunch of generated mixins on top of jsonnet, this makes its templates hard to read and write, moreover the design choices made for jsonnet didn't attract us. I mean we all know what happens when you put a programming language inside a configuration file.
This is why we created ICL (
https://github.com/archipaorg/icl), it's a declarative configuration language inspired from nginx config file syntax and written primarily for docker orchestrators' YAML file, it has the concept of inheritance, class, mixins and libraries.
This is what it looks like if i write my "hello world app" manifest file in ICL for k8s:
::variable "container-port" apply ContainerPort @@name="nginx", @@containerPort="8080"
::variable "container-ports" [variable.container-port]
::variable "container" apply Container @@image="nginx:1.13.0", @@name="nginx", @@ports=variable.container-ports
::variable "container-list" [variable.container]
::variable "pod-spec" apply PodSpec @@containers=variable.container-list
::variable "labels" table "app" = "nginx"
::variable "pod-metadata" apply ObjectMeta @@labels=variable.labels
::variable "template" apply PodTemplateSpec @@spec=variable.pod-spec, @@metadata=variable.pod-metadata
::variable "spec" apply DeploymentSpec @@replicas=5, @@template=variable.template
::variable "metadata" apply ObjectMeta @@name = "nginx"
_ "_" apply Deployment @@metadata=variable.metadata, @@spec=variable.spec
Of course i could wrote a mixin to shorten the creation of a specific section in my case, but the point is that even if no one knows what ICL is, everyone can read and understand what's happening here.
How does it compare to other approaches ? ICL is a JSON/YAML extension, it has some OO concepts such as inheritance (multiple inheritance actually), mixins, and class, but remember ICL's purpose is to make config files modular, and easy to read. so there are no conditional, loop...instructions. the point is that when a developer checks a config file he must be able to see what he gets.
e.g. (:: in ICL means its a settings block library => no rendered)
::vegetable "fruit" as Fruit {
type = "fruit"
}
::color "green" as Green {
name = "apple"
}
apple "green" from Fruit, Green {
}
Output in YAML =>
apple:
green:
name: apple
type: fruit
Whatever you write in JSON/YAML can be written in ICL and vice-versa.
Hope it's clear for you
Regards,
Mahieddine