How to manage Camel K routes via API(or other alternative ways)?

294 Views Asked by At

I have a Camel K application which contains multiple routes(each route is a Java file). my goal is to manage the routes status, for instance start certain routes and stop other running routes.

Currently I start and close the routes manually using kamel run XXX.java --pod-template pod_template.yaml --property=file:logging.properties ..., I am wondering what is the best way to achieve managing routes status via API?

My goal is achieving below using API:

  • start a route
  • stop a route
  • list available routes

I have asked the question under apache/camel-k but still confused about the Integration CRD mentioned in the answer.

I have found that Camel K has API Camel K API unfortunately I haven't figure out how to call the APIs if it is possible?

Can someone share knowledge and help me on this? Thanks!

1

There are 1 best solutions below

0
On

You an use the kamel CLI to start and list the Integrations available, ie:

$ kamel run Sample.java
Integration "sample" created
$ kamel get
NAME    PHASE   KIT
sample  Running default/kit-c82emh1c11s7ki7ijq0g

The above will use Kubernetes Custom Resource to create an Integration and list the Integration accordingly

There is no direct way to pause/stop/resume a route. The best thing I can suggest is to have a route per Integration and stop it via kamel delete CLI or equivalent Kubernetes API