<p>I'm currently working on a project in Germany, which is already using Camel inside Karaf. And i would like to deploy an sample Camel route written in Blueprint XML inside a Kubernetes cluster using Camel K. Defining and creating the datasource was simple in Karaf. On Karaf CLI
just execute: </p>

<p>karaf@root()> jdbc:ds-create -t derby -u test -i datasource01</p>

<p>And then deploy below XML</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="
    http://www.osgi.org/xmlns/blueprint/v1.0.0
    http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd"&gt;

    &lt;bean id="datasource01" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
        &lt;property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/&gt;
        &lt;property name="url" value="jdbc:derby:database01" /&gt;
    &lt;/bean&gt;

    &lt;bean id="datasource02" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
        &lt;property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/&gt;
        &lt;property name="url" value="jdbc:derby:database02" /&gt;
    &lt;/bean&gt;

    &lt;camelContext xmlns="http://camel.apache.org/schema/blueprint"&gt;
        &lt;route&gt;
            &lt;...&gt;
            &lt;to uri="jdbc:datasource01"/&gt;
            &lt;...&gt;
            &lt;to uri="jdbc:datasource02"/&gt;
            &lt;...&gt;
        &lt;/route&gt;
    &lt;/camelContext&gt;
&lt;/blueprint&gt;
</code></pre>

<p>I have searched the documentations and web for Camel K and Kubernetes datasources and haven't found the solution. Does anybody know how the datasource which is used in the JDBC Componenent URI can be created using Camel K inside Kubernetes ?</p>

Murat Yildiz
<p>Hi and welcome to StackOverflow</p>

<p>You basically ask <strong>how to define custom beans inside the Camel context</strong> in Camel K. Datasource definitions etc are defined as beans in the Camel context. </p>

<p>See <a href="https://github.com/apache/camel-k/issues/814" rel="nofollow noreferrer">this link</a> for a similar question and an example answer. </p>
