camel-k
camel-k copied to clipboard
kamel run with reference to an existing Integration Kit in another namespace
I'm going to run an Integration with a reference to an existing Integration Kit.
kamel run -t prometheus.enabled=true -k basic Hello.java -n integration-dev
When I'm using the -o yaml > Hello.yaml option I'm getting
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
creationTimestamp: null
name: hello
namespace: integration-dev
spec:
integrationKit:
name: basic
namespace: integration-dev
sources:
- content: "// camel-k: language=java\n\npackage de.casag.hello.route;\n\nimport
org.apache.camel.builder.RouteBuilder;\n\npublic class Hello extends RouteBuilder{\n\n\tpublic
void configure() throws Exception {\n\n\t\tfrom(\"timer:enforedeinvoices?period=3600000&delay=0\")\n\t\t\t\t.log(\"Hello
World!\")\n\t\t;\n\n\t}\n}\n\n"
name: Hello.java
traits:
prometheus:
configuration:
enabled: true
status: {}
The Integration should be deployed in the namespace integration-dev. The Integration Kit being referenced is located in the namespace camel-k.
I can change this in the YAML file like
apiVersion: camel.apache.org/v1
kind: Integration
metadata:
creationTimestamp: null
name: hello
namespace: integration-dev
spec:
integrationKit:
name: basic
namespace: camel-k
sources:
- content: "// camel-k: language=java\n\npackage de.casag.hello.route;\n\nimport
org.apache.camel.builder.RouteBuilder;\n\npublic class Hello extends RouteBuilder{\n\n\tpublic
void configure() throws Exception {\n\n\t\tfrom(\"timer:enforedeinvoices?period=3600000&delay=0\")\n\t\t\t\t.log(\"Hello
World!\")\n\t\t;\n\n\t}\n}\n\n"
name: Hello.java
traits:
prometheus:
configuration:
enabled: true
status: {}
and deploy afterwards with
kubectl apply -f Hello.yaml
The Integration works event with the reference to an Integration Kit in another namespace.
Is there a way to address the different namespace in the kamel run -k <IntegrationKit> CLI part?
Best Gerald
No we have nothing like that. Maybe we could think to introduce a syntax such as namespace/kit.
Thanks @squakez. Could you than turn this into a feature request please?
Let's wait for others input. I have no strong opinion about the possibility to use cross namespace references, but others may have concerns about that.
Cross-namespace IntegrationKit references are already supported in the Integration type, so that seems like a reasonable request to surface it into the CLI.
Thanks a lot. The point is when the Operator has been installed with the --global option, let's say in namespace camel-k and we're going to create an integration in an other namespace, let's say integration-dev, the Integration Kit will be created in namespace camel-k.
Thanks a lot. The point is when the Operator has been installed with the
--globaloption, let's say in namespacecamel-kand we're going to create an integration in an other namespace, let's sayintegration-dev, the Integration Kit will be created in namespacecamel-k.
Right, this primarily applies when the operator has been installed with the global option.
Could this be turned into a feature request @squakez? Many thanks in advance.
This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!