Comments (5)
i see. may be following is useful kbld -f ... --lock-output /tmp/lock.yml
(which will record resolved/built images and save them as ImageOverrides in lock.yml) and then use it later via ytt ... | kbld -f - -f /tmp/lock.yml
(to use those overrides).
from kbld.
there are two challenges with that even if kbld would preserve comments -- (1) kbld returns combined output which would "break" any non-trivial ytt template since loads would not be able to find files (2) there is no guarantee that kbld can find image references since they might be in format like this: image: #@ data.values.image
(or some variation).
because of issues above i typically recommend to run kbld on the templating results or some kind of more deterministic input to the templates (eg data values files that are setting image references).
what are your thoughts on challenges above?
from kbld.
I better understand the challenges. I have a use case where spawn a lot of jobs from the same template and kbld execution, even when cached, is adding up to a long time.
In addition, kbld requires docker while ytt, kubectl does not. A system with docker could build the image and update the templated yaml. That updated template could then be used by another system without docker.
It's not something I desperately need, but I was slightly surprised to discover it wasn't possible.
Perhaps, the Sources
object could have a default tag. We could invoke kbld -f build.yaml > build.yaml
to build and update the default tag (build.yaml
containing only Sources
and ImageDestinations
). Then invoke kbld with a --noop that would only transfer the default tag kbld --noop -f build.yaml -f temaplte.yaml > rendered.yaml
. I don't know, I am thinking out loud..
from kbld.
Thanks @cppforlife. I didn't know about --lock-output
. Makes a lot of sense. Now I almost feel embarrassed.
In case it helps others, here is what I did in a Makefile:
workflow.build.lock.yaml: workflow.yaml workflow.build.yaml Dockerfile
kbld -f workflow.yaml -f workflow.build.yaml --lock-output workflow.build.lock.yaml
/tmp/rendered-workflow.yaml: metadata.yaml workflow.yaml workflow.build.lock.yaml
ytt -f metadata.yaml -f workflow.yaml | kbld -f workflow.build.lock.yaml -f - > /tmp/rendered-workflow.yaml
submit: /tmp/rendered-workflow.yaml
argo submit /tmp/rendered-workflow.yaml
workflow.yaml
in an argo workflow I want to run many time. metadata.yaml
configures the workflow. workflow.build.yaml
contains the image sources and destinations. workflow.build.lock.yaml
is the ImageOverrides resulting for the build, it can be checked-in for teammates to use.
from kbld.
@jpambrun glad it solves your problem!
from kbld.
Related Issues (20)
- [Guides] Building images with `KO` and `kbld` HOT 2
- Support jib for builds HOT 2
- kbld should be smart enough to see a Carvel tagSelection without additional work HOT 1
- release v0.36.0 HOT 1
- Keep original tag and only append sha256 digest HOT 7
- Containerd mess with kbld HOT 2
- keymatcher ignores path if name is set HOT 1
- kbld fails on `image:` field in Kyverno CRD HOT 11
- Are you using kbld?
- Enhance kbld to Utilize Alternative Image Operations Mechanism HOT 3
- Sign `kbld` binaries while releasing them HOT 1
- Use vanity urls to change the go module name HOT 1
- facing docker buildx error when building for multiple platforms. HOT 9
- Consider adding annotations to the pod template HOT 4
- docker buildx have different output depending on the driver used
- kbld with flag --json swallows error
- Docker API Rate Limit HOT 5
- Version checker errors when consumed as library
- Update copyright headers
- Help needed with updating reposerver and making kbld work HOT 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 kbld.