 So I will share my screen or and they start the YouTube video or if anybody have any issues they can always Go to the YouTube and watch the session using the given link so Here so let's get started so our next Station is camel keep build and deploy on Kubernetes and This talk is given by Shailendra Kumar and Chandrasekhar Pandey. So So do you want to use the pre-recorded audio or do you want to give it on live? So you can always ask for sharing the screen. Okay, so I'll use the recorded audio that we have and If anybody have any question they can post in the in the chat bar and the Author of the talk will answer all the doubts that you have Hello guys, welcome to DevCon So today I and Chandrasekhar would be presenting a demo on camel K So we'll just show how to build and deploy on Kubernetes. So myself shallon Singh I work as a senior consultant in Red Hat Back to you Chandrasekhar Yeah, hi guys, my name is Chandrasekhar. I'm working as a principal software maintenance engineer We both are working in India, Red Hat India. Yeah Over to you Shailen Let's see what all the topic will be covering throughout the session So there would be a quick on what is camel K and how the architecture flow How it works with some configuration and mostly we will focus on a demo So before we start with camel K So, let's see what is Apache camel. So I'm sure most of you would be aware of what is Apache camel If not, then just a brief idea of it. It's an integration framework based on integration Enterprise integration pattern we call is it as a Swiss knife for the integration framework So this is mostly What is camel on the right side what you see is a book which is written by great hops With support known as for integration pattern To integrate camel, there are a lot of component which are available. You name it the component The component would be present almost 300 plus component are there Camel is ready with to integrate with any Kubernetes cluster like open safe K native. It's about K native Which will go as a serverless and if if I want to say a simple route so route is like Integrated integral part of a camel which explains what it does So in a simple language if you see At the top, it's a Java DSL At the bottom, it's a XML DSL. So what we are doing from We are we are reading a file and we are sending that content to a DMS cube So one of the main advantage of using camel is like you will have to write as low as the coding The state 20 90 So we'll have a low coding is required Most of the things would be done at a back end by the integration framework. This is camel So Back to you Chandra on the camel K Yeah, so then you would have to help me in you know moving the slides Yeah, yeah, yeah So guys Excellent provided you a brief idea of what camel is and it's very popular Integration framework. It has been active for last 10 years and still it is very active one of the most active Apache project So guys, what Apache camel is camel K is another offering of camel It is it is native to Kubernetes and OpenShift environment So it is specifically built for net Kubernetes and OpenShift Might be you are aware that we can still without using camel K2 we can deploy our applications To Kubernetes and OpenShift environment of the however the advantage with camel K is that the the code is quite less and The dependencies which we have to provide We we don't have to be concerned about that. So we will discuss it in our further slides So what is camel K? It's it is up as our slide says it's a platform Directly running integrations on OpenShift and Kubernetes for serverless loads. The camel K is specifically built for serverless applications This camel K as it requires Less code so it is Quick to build so applications we can easily build and quickly build and it is easy to boot easy to boot quick to boot So it's an advantage in serverless applications where your application so boot Quickly once a request is request arise. Okay. So the second thing is It is architectured by Kubernetes CRDs and operators. It is operator base so in OpenShift we have We can easily install the operator with the help of From the GUI itself OpenShift GUI itself. We will check in the demo demo as well And it's a community-driven project. So code is open. So Anyone can look into the code and check what's happening there This is an advantage here. Everything is Community-based. So it has been started on August 31st on 2018. Yeah, so in next slide if you can move Yeah, next slide. Hello Yeah, so why camel K. Yeah, so as I said earlier that already we have Framework like spring boot car off frameworks are there which can be uploaded in As an application to OpenShift of Kubernetes environment then why camel K so camel K It's it's it's low code means you will need One class only to write Your integration. Okay, and with the help of one that one class only you don't need any palm dot XML You don't need other classes. So that that is enough. Okay, and Cloud native it is it is a specific to Kubernetes and opens if environment. So the advantage here is it is It is quick to boot. It is the boot time is faster and also It is easier to install and build it it supports serverless applications as well with the help of K native and your OpenShift serverless operator the it it it provides serverless functionality where Your pod or your application will only be up when when the when it is serving request So when it is not serving request that pod will not be up. So it will better you utilize your resources, so yeah, the other The other advantages it is It can be written in YAML. It can be written in Java XML groovy JavaScript and Kotlin So YAML Can can be helpful when you don't have a big I would say big integrations So Java when you have complex integrations and when you have developers Who have experience in Java? So Java can be really powerful here and XML like In earlier Versions when we used to talk about few six dot X you seven. So they are XML was very powerful. So there we used to have blueprint or spring based XML But here we won't have be having a blueprint or spring boot. It will be specifically camel route XML only Yeah, and groovy JavaScript Kotlin are also community-based offerings for writing the camel K applications Yeah Thanks. Yeah, can we go to next slide? Yeah, and Limitations as well. It is this camel K is a specific specific for Kubernetes and OpenShift environment and It's still There are There are some components camel camel component few camel components, which still has to be moved to camel K But yeah, I mean since next few months. They would also be there and it is yeah It is not a replacement for Apache camel because Apache camel can be run as a standalone environment in As well, it can be run in EAP as well. Yeah, and camel K as we said it is specifically for Kubernetes Salan, do you have to say anything on this? Do you have to add on this? Yeah, so right now if you see for the camel K There's a very limited testing framework, which is available and as rightly said by Chandra This is not a replacement of camel K For Apache camel, but this is a very tightly coupled with a Kubernetes cluster So let's see how the architecture would look like So this is Architecture for camel K when you look at 80,000 feet How you have a dev environment on a dev environment you write a simple camel route By using a camel CLI camel CLI is just a client which you need to run on your dev environment And once you have access to a Kubernetes cluster, let's say open sift cluster Directly by using this camel CLI you can create you can push your code to the running cluster So what to add at a back end it will create a integration custom resource as Chandra says camel K is an operator base where you have to where you have to create an integration That is a custom resource would be created once the custom resource is created The operator will take care of running and each and everything Creating its pod creating the deployment config creating the route Etc. Etc would be taken care by this camel operator So this is basically tailored for a cloud native development experience And it goes a live updates whenever you change a code you can run camel K in a dev mode Which we'll see now demo and as soon as you update the code it will be reflected to the cluster Now let's see this is camel K in more detail so this is a message from a telegram Transform and push to the taskbar By using a camel CLI the same thing has been converted into a integration Inside a integration there would be a source which is Java and then the content Each and every route would be converted to a integration And once the integration is created this integration would be created by the camel CLI command to your cluster Once the integration is created camel K operator will choose the runtime to create a container image Create a Kubernetes resource for the deployment and each and your route would be deployed on a running Kubernetes cluster On a click on a click of go we'll see that in a demo So Chandra will explain of what are things was back end of the operator Back to you Chandra Chandra your voice is not audible Yeah sorry I was on mute yeah so there was some background noise So user or a developer shouldn't be or isn't aware about like what happening in the background So if we see this orange color this orange color oval shape or rectangle shape It is abstract from the user or from the developer So the developer or user is just aware of the code.groovy file So that file which is where he's writing his integration So that is the only thing he should be worried of and he should write that So once he writes that and he run that file that code.groovy with the help of camel CLI So this code.groovy would be we can say installed in the as a pod in the name space or project Which developer wants to upload to in the open shift environment So if we check like what's happening what's what is abstract Then the next slides to show us that the those abstract components which are not visible in the 12th slide So in 13th slide we can see that the components which are which are abstract So these are very important components So here we can see that these are these are this is this is a operator based framework So all the there will be CRD's and CR custom resource and custom resource descriptors will be there So the important thing is like there will be an integration There will be integration platform and there will be config maps There will be image stream and image stream tag So these things are these things will also be there in any operator operator based installation So the integration platform and integration is very specific to camel K So I would like to tell you like what integration is and what integration platform is So integration is specifically the developer is writing the that code.groovy So integration is specific to one integration So that code.groovy would have one integration So but what integration platform is integration platform is generic for all the for all the integration Like we can say the settings dot XML so settings dot XML will be having the the may one repository URL from where the may one repository may one artifacts will be downloaded So it will be common so it will be in your integration platform So while in integration we will be having specific route for our each integration So yeah and there will be config maps as well. We will be discussing that so we will be discussing that in our demonstration So integrated so config map will be having that settings dot XML is mounted in the config map And this even when we say that integration the groovy code the or the Java code is also mounted in the as a config map So we are going to check all these things in our demonstration Yeah, over to you Selen if you can demonstrate Yeah, yeah, so thank you. So before we start with the demonstration, I can just walk through you. I have open zip cluster available with me. You have to go you have to install the camel K operator. So you can go to the operator house you can type camel K camel K you will find camel K operator this is this is the community one and then integration camel K. This is the enterprise camel K supported by red hat. Yeah, Selen I just want to say one line here. Yeah, sorry for interrupting this camel K operator is it will be using it. Selen will be discussing more about this that integration this camel K is an enterprise offering of the same camel K So camel K the commands which we will be executing for camel K operator that will still apply for this red hat integration camel K But in between if you see there is a K native Apache camel operator that we won't be using so if you are writing a camel K application You need need not to install this K native Apache camel operator for now. Yeah, over to you Selen. Yeah, that's that's only I want to highlight Yeah, thanks Chandra. So I have installed camel K operator so once the camel K operator installed you can see there would be a CRD is created with the name integration and integration platform We'll see how to create a simple integration. So I can create a simple integration by using this channel five or I want to utilize a camel of CLI command. To do that, let's I have a VS code. And you can install if you have a VS code you can go and you can install this camel K plugin the lot of camel K plugin available is very easy to create any integration. And I will explain you, you know, like in a few seconds you will be able to deploy a sample let's say hello world program. So if I go and just search for the integration create a new Apache camel integration. It is asking for which language you want to let's say I want to have for the Java, which is the project of a fine I want to have this project and let's say I have created a sample, sample dot Java right now you can see camel K language you can see languages Java I don't want this comment I will remove this comment. And then you can see a simple route vendor class. This is a timer is just give a right route and then you just just say hello camel K. And I have installed a camel CLI from where you can download this you just have to go to this camel K release. If you find this camel K client to be downloaded for Linux Mac or Windows I have already installed. So if I do a camel version I'm expecting a wasn't so my wasn't is one dot one dot one. So how I want to install this on a cluster so I have a running cluster. Project with a lot of projects. I will go to this camel K project camel K. So we were talking about some development alive update and how that code will be updated to the cluster. Let's say if I want to do the same camel run. And then I have to provide the file name sample dot Java. And then I found out if I run in a death mode. Now I you can see in phase build is running once the build will just succeeded. My camel route would be deployed. Let's go to the cluster and see what is happening. I go to the cluster. I go to the project camel K. So right now I can see no deployment is not created. Let's say the part. So my build part is running. So it will take their images from where it will pick the image and which and everything would be there. So before going let's see what China has explained so there would be a lot of kids is going to this country map. If I go to this conflict map and if I see. You want to say something. Yeah. So from console we can check or we can check the integration and integration platform from the deployment section as well. Yeah. Yeah. I just wanted to show where this source goes there will be a sample source created if you click on the source. Yeah. You will see the same route over here has been created. Yes. So this has been deployed. Let's say my route has been started successfully now my route has been started successfully and every second every second I'm getting a print hello. What's the advantage of let's see a demo. If I do update. So let us go to this board. The sample. We are getting this logs what I will do. I will just change the value to the lower value. Yeah. Again my integration was redeployed and I'm getting again hello hello very fast the same thing starting the resource center of one round this part has been terminated and my new part has been started with the new with the newer configuration. This is this is how simple is to do the development for the live updates. Now let me let me close this and let me reset my camel. So once I do a reset, it will delete the other things. Yeah. So, okay, so before, so let's see a simple serverless demo. So for a serverless demo I have created a route, which uses the undertow, which expose on port 800 as a test, and it just send a content and just log a hello camel K. That's all the reason of adding as a undertow end point so that once the request is not coming. I would expect my pods to die off. The whole idea of serverless is for the resource utilization to save your resource utilization when your route or when there is no request. There should not be any resource use for the part will be scaled out to zero. Let's let's do that. Let's deploy this file. So if you see I have a command to deploy. I'm deploying this route demo dot Java. So there is a dependency of camel undertow and then I'm setting up this environment variable. So integration demo has been created if I go and see OC get it. So my demo now my build is running. If I do. OC get parts. So my build still my build is running. Okay, before that the same thing but we saw. So there would be a deployment would be created after the build has been completed. Let's see the conflict map. So I'm expecting my demo. This route configuration goes to my conflict map. Yes. Let's see. Okay, this is my conflict map and I can get my. I can get my route detail. Let's see if. Okay, so I can get my maven setting also this is the conflict map for camel game maven setting. If you want to override some of let's say you have you are working on a restricted job. So you have instead of going to internet you have your internal repository you can update this movement that settings. This is has been provided as a terms of conflict map. And one more important things you can see by the integration I can get all the dependencies. So right now, while passing you will see. I have used camel undertow. So I can get id demo yaml grep dependencies. Yeah, so this. Yeah. So hyphen a four is this like it will print four lines after it grips. Yeah. Yeah, the dependency you can see camel undertow which we have provided and this is the default dependency which has been picked by the operator camel can loader Java and runtime Java. Why this loader Java, because my language which I have selected was Java to select the XML you will find a different dependencies have added. So you saw how quickly we can build and we can deploy the part right now if you see there is no part running, there is only camel co operator running. There is no other part why because there is no request and being served. That's the reason. So what what we can do we can get the route once we get around will try to hit that route. So what we have to go I will have to go to this there would be a service created. This is my service. Hello, you can you can also show the output of that OC get it integration and OC get it before before running that yeah, yeah. If I do OC get it my integration you can see demo it is in running phase but replica is zero. So you can describe it as well. Yeah, OC get. Yeah, yeah. This is the integration platform. Yeah, which we were talking about it will be generic and it has those may one settings. Yeah. Oh, see this. Oh, see describe it demo if I do. Yeah. Yeah, it's a typo. It is not required hyphen or ML not required. Yeah. Yeah, that's it. Yes, you scroll it up. You can see over here the same route you can see this integration, all this integration will have your world and what is the state dependencies. Yeah, dependencies and you can see there all the event what's all the event what has been executed. And this route has been picked from the config map. Yeah, yeah. This is our detail. Also, we can see OC get out pod output so that it is clear that no pod is running. Yeah. We can see this is the big part there is no camel demo pod is it's not running. So what we'll do I will just do you know what we'll see. We'll see get parts on a watch. And this operator pod is as soon as you install that operator camel operator this operator pod will be there. The pod will die off. So we'll wait, which I which I'm printing as a log as a response. So this is how a serverless will begin as soon as the request comes in my pod is up and running. Once there is no request like the default values 30 seconds it's configurable. The pod will die off. We'll wait for a bit 30 second and we'll try to figure it out what all things has been created. And we'll see this will eventually die off. So this all configuration of serverless you can find in the K native serving. There would be a config map. Serving in grace arms. Oh, it would be the K native serving config auto scalar. If you see the config auto scalar config map you will see the scale to zero grace period is 30 second. So all this parameter is configurable for a serverless scenario. So let's see what the status of my pod. The camel K the pod is still running. It's terminated. It's in terminating state because there was no request coming. Now the part is in the terminating state. And if I again try to hit the same request, a new part will be start scaling up. So you can see a new part has been started up. So that's all what we wanted to show on a demo part. So anything to add from you, Chandra. No, that's excellent. You presented it very well without any interruptions. Thank you. Okay, so thank you guys. Thank you guys. Thanks, Alan. Thanks. This was great presentations. I really like your demo. It was really cool. And so if anybody have any questions about this talk, you can post it or chat and they both the present is will be here and they'll answer your questions.