-
Notifications
You must be signed in to change notification settings - Fork 3
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
definition templating language #243
Comments
I've used |
My concern with jsonnet is if it's tough to use with yaml. Also does this mean we'll want |
yes this would replace the current yaml templating we have. we could still allow users to supply so you could write type: v1/service
...
exec:
environment:
NODE_ENV: {{ node_env }}
... or {
"type": "v1/service",
...
"exec": {
"environment": {
"NODE_ENV": "{{ node_env }}"
}
}
...
} but for anything more complicated you need to use jsonnet. Put a different way, you can use Also to be clear, I still propose breaking the resolution into a sidecar service regardless of the templating solution chosen. |
consider replacing our current primitive
${param}
with an external more fully featured templating solutionTemplating Solution Contenders
text/template
aymerick/raymond
text/template
in particular outlined in https://sweetcode.io/a-first-look-at-the-helm-3-planShopify/go-lua
)Implementation Considerations
DOS
Currently, template resolution occurs in the
build
controller.The jsonnet documentation nicely summarizes some of the issues that we would face when using any external solution that has the potential to consume large amounts of resources. Indeed a version of this problem somewhat already exists in the component resolver as it is today. One example manifestation is if a reference references itself, we don't detect the cycle and you can stall the controller.
Proposed solution
Run a sidecar definition resolution service alongside the
controller-manager
. This would be agrpc
service defined as:There are a few architectures this service could take, but a likely one would be:
The above architecture should be pretty easy to implement.
The whole container itself could have its resources limited and the request handlers could themselves further limit the resources available to an individual resolution as well as timing out and killing a long-running resolution.
Eventually if needed the request handlers could be smarter and queue up based on available resources, but definitely not necessary to start.
The
build
controller would then instead of callingc.componentResolver.Resolve
:lattice/pkg/backend/kubernetes/controller/build/pending_build.go
Line 90 in 532b4e5
would simply call
c.componentResolverService.Resolve
.The text was updated successfully, but these errors were encountered: