Comments (9)
I have a new feature on the latest
tag (when this run is done) for you to at least start playing with if you want. But I make no guarantees to its stability. I tried to mimic the tanka
example as close as possible (with a few omissions that are not available directly in the helm Go API without some hacking).
Simplest example is here:
local utils = import 'internal://utils.libsonnet';
{
chart: utils.helmTemplate('example', './chart', {
values: { replicaCount: 2 },
})
}
You can see the schema for the final opts
argument here. One important note is I skipped the calledFrom
construct for now. It's there in the options, but ignored. The path you give is assumed relative to where you are executing the jsonnet for now. In the controller that's the path you define in the CR.
To make testing a little easier I added to the konfig
CLI. There was already the build
command which did a server-side dry-run of a Konfiguration
. I added a simple (rather dumb for now, but can be expanded) show
command that behaves similarly to kubecfg
and regular jsonnet
. Just pass it a jsonnet file or path and it will run it through the same interpreter the controller uses.
It doesn't get released without a tag, so you'd have to build manually for now to get that command. If you have go installed you can run make build-konfig
in this repository and it will be installed to ~/go/bin/konfig
.
Any feedback is appreciated if you are able to give it a try 😄
from jsonnet-controller.
I guess my first question is do both those functions rely on any external CLI utilities. If they don't then I absolutely will include them, or something similar.
To your first question, I was trying to think of interesting ways a user could define additional functions at runtime. In my head at the time it didn't seem like it'd be worth the effort since the writer of the jsonnet can easily define the functions they need. That being said, having the ability to declare functions globally via another CRD or something could be interesting.
from jsonnet-controller.
I looked at the code. The helm native func does make CLI calls.
from jsonnet-controller.
And so does the kustomize native func. :(
from jsonnet-controller.
However, I wonder if those are necessary. I believe that there is a Helm Go API.
from jsonnet-controller.
Yea I have other projects where I've (at least with helm) invoked the needfuls via the Go API. But ya, we'd have to implement them into the controller. I'm trying to avoid embedding binaries - currently leaning on controller-runtime server-side apply for syncing state instead of using kubectl
.
from jsonnet-controller.
I may take a stab at, at least, helm functionality later today or tomorrow
from jsonnet-controller.
from jsonnet-controller.
Very nice!
from jsonnet-controller.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonnet-controller.