Comments (8)
So for an application with context, it will be like:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
ports:
- port: 8000
workflow:
context:
myName: "my-comp"
steps:
- name: apply-comp
type: apply-component
properties:
component: express-server
And if in the definition we have cue template like:
name: context.myName
Then when the application is deployed, the name will be my-comp
.
I'd like to discuss more about where we should put this context field. If we put the context in parallel with the component it will make more sense. However, this will also change the model of OAM so we'll probably need more discussion.
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
ports:
- port: 8000
context:
myName: "my-comp"
workflow:
steps:
- name: apply-comp
type: apply-component
properties:
component: express-server
from kubevela.
We need something similar to pass additional runtime information to the workflow steps. It is possible in standalone workflow runs but not in Applications, which is a shame, and thus we cannot refer to existing workflow templates which expect context parameters.
It would be a great addition if we could define runtime context information for the workflow steps, the same way we do it for workflow runs.
Thanks
from kubevela.
Hi @testinfected
According to your description, the capability you want is to use the context
in workflow steps but not trait and component, right?
If so, we can add the context
field inside the workflow but not the whole application like:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
ports:
- port: 8000
workflow:
context:
myName: "my-comp"
steps:
- name: apply-comp
type: apply-component
properties:
component: express-server
from kubevela.
Hi @FogDong yes this is correct.
One use case is using an external workflow template. It's possible to add context parameters in workflow runs, but not applications.
Thanks
from kubevela.
I think it's a valuable feature for Application and I'm good with supporting it.
If other maintainers also like this idea then I'll start working on this.
cc @wonderflow @StevenLeiZhang
from kubevela.
For us would be beneficial to be able to use the user context in the applications and traits like in your first example
If you add it just to workflow steps will is still be available to use in the application cue templates?
from kubevela.
For us would be beneficial to be able to use the user context in the applications and traits like in your first example If you add it just to workflow steps will is still be available to use in the application cue templates?
If we want this context to be used in the whole Application, then we may need to re-struct the Application template to add context
field, which might affect the OAM model and need more discussion.
from kubevela.
Having it at a application OAM level and usable in all templating at components, traits, workflow, policy on the application would work for us
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: test
namespace: default
spec:
components:
- name: express-server
type: webservice
properties:
image: oamdev/hello-world
ports:
- port: 8000
context:
myName: "my-comp"
workflow:
steps:
- name: apply-comp
type: apply-component
properties:
component: express-server
from kubevela.
Related Issues (20)
- Passing data from component to trait
- Unable to start a Kubevela app with local helm chart or git helm chart.
- [Feature] Allow specifying cloud credentials for Crossplane integration via a secret
- [bug] The app reconcile key will always be in the queue
- [bug] The app reconcile key will always be in requeue
- list application records can not return the recods
- Unable to update workloads in v1.9.10 which were deployed in <=v1.9.9 due to resourcetracker controller guid HOT 3
- Unable to run Kubevela in Kubernetes v1.29 HOT 9
- [Bug] vela cli print useless log about cpu quota HOT 1
- Support Input validation for Kubevela Application manifests
- [BUG] Trait patch fails on patchKey field with default value depending on syntax used
- A potential risk in kubevela-master that could lead to takeover of the cluster
- 2024.4.29 execute install.sh will become error HOT 1
- Version 1.9.11 is not updating deployments with a new image HOT 1
- Report the use of components with vulnerabilities in kubevela
- [Feature]kubevela 的ci webhook HOT 1
- Send a notification if the component status is abnormal after the application has been deployed
- kubevela.io domain is down? HOT 4
- Cannot install new version of vela with kubevela.net HOT 5
- Kubevela helm repository inaccessible HOT 1
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 kubevela.