Comments (6)
Seems like there is no simple implementation sadly. I'll step back for now and get more familiar with kapp and ytt, maybe get back to this issue later. Feel free to close the issue
from kapp-controller.
ive stayed away from introducing this for now, but curious to hear your use case: what templaters are you using?
main reason why i avoided this so far, is that there is no "easy" way to implement this without either (a) preloading these into kapp-controller as separate containers and running a little daemon alongside or (b) using a separate pod to perform processing (which also could be considered to be done in multiple way: persistent pod per app, persistent pod for specific templating, etc.)
from kapp-controller.
another nuance is how this might play in with CLI version of this controller: #2, since this introduces docker daemon dependency.
from kapp-controller.
My use case
I'm currently using helm and helm-operator, but want to migrate to kapp because of go templating limitations.
I want to implement my own template engine with such features:
- Programming language instead of templating language
- Ability to use helm charts inside (as pure functions, without features like lookup)
With kapp it's easy to integrate custom templating, but with kapp-controller I'm limited to template engines implemented in controller itself.
Implementation
I think the most direct approach for implemetation is kubernetes batch jobs. Every time templates or values have changed, job should run, kubernetes manifests should be taken from its stdout and deployed via kapp.
Templating is supposed to be side-effect free, so it should be performed only if templates or values have changed. I don't know if kapp-controller is already working this way
CLI
What is the purpose of having kappctrl cli? I can see three reasons:
-
Deploying from yaml files with kapp-controller CR. Not sure if it's required because it already can be done with
kubectl apply -f
-
Deploying without yaml files based on cli arguments. This is how knative cli works. Might be useful and plays well with any configuration because cli in that case just creates CR from command line arguments and then
kubectl apply -f
them. -
Deploying from yaml files with kapp-controller CR but without kapp-contoller installed in cluster. I beleave it isn't a goal of kapp-controller, but it it is, batch job can still run in cluster
from kapp-controller.
I want to implement my own template engine with such features...
👍
What is the purpose of having kappctrl cli? I can see three reasons:
yup, point 3 is why we want to have a CLI:
Deploying from yaml files with kapp-controller CR but without kapp-contoller installed in cluster. I beleave it isn't a goal of kapp-controller, but it it is, batch job can still run in cluster
especially during development stages of App CR user may want to be referencing local directory as source, using functionality to tail logs inline, build images with kbld, etc. App CR ultimately represent a common workflow for getting app from source/config -> cluster, so we would want to unlock this workflow for local development as well, and having App CR be consistent with what gets sent to the cluster (eventually) is a nice bonus.
I think the most direct approach for implemetation is kubernetes batch jobs ... kubernetes manifests should be taken from its stdout and deployed via kapp.
that's definitely an option, though it rasise questions how to securely pass the output. we cannot rely on stdout of the container executing since output will/may contain sensitive data (like Secrets) and will be captured by typical logging solutions within a cluster.
that leaves us with needing to "intercept" output from the templating engine and pass that back into kapp in a more secure way. that could be achieved by having a statically built binary that gets copied over into templating container and wraps templating invocation. 🤔
from kapp-controller.
closing for now. feel free to reopen. we'll most likely reference to this discussion at a later point.
from kapp-controller.
Related Issues (20)
- Support Operator Lifecycle Manager (OLM) registry+v1 bundles HOT 3
- kapp-controller should look up addition imagePullSecrets from the ServiceAccount performing installation of the Package HOT 2
- Add Diagrams to Concepts & CRDs section of the Package Managment Section HOT 2
- Incorrect docs on the "Community OSS Repos" page HOT 1
- Use vanity urls to change the go module name
- Introduce CEL based validation in App spec for SA and Cluster HOT 3
- Optional ability to check if client has permissions to perform CRUD actions before trying them HOT 4
- `kctrl package install … --dry-run` logs "Succeeded" to stdout HOT 2
- `kctrl package install … --dry-run --ytt-overlay-file …` does not stamp out overlays HOT 1
- Unblock app deletion by falling back to noop when safe
- pull the kapp-controller continer image with tag equal to release HOT 2
- Ensure noop delete due to terminating namespaces takes into account that a namespace might have been terminated already
- Cannot release repository with build metadata HOT 2
- Support image pull cache for App CR to archieve 'imagePullPolicy: IfNotPresent' HOT 14
- Support exposing the status of individual resources applied on cluster HOT 3
- Make kapp controller extensible HOT 3
- Make bits of kctrl more configurable
- kctrl kubernetesVersionSelection constraint
- MetaPackage capability HOT 5
- 53: server misbehaving HOT 9
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 kapp-controller.