 zero. Hello my definition friends from everywhere in the world thank you for coming to another Tech Talk. I'm Antio and Aga I'll be your host today and today we have a very special guest because Cedric the OpenShift Developer Advocate team turn is going to present some awesomeness about how can you quickly and easily deploy your applications to Kubernetes using ODO version 2.0. So without any third delay I'd like to point to you Cedric the stage is yours. Thank you so much Edson I'm very happy to be here again my name is Cedric Claiborne I'm a OpenShift Developer Advocate intern here at Red Hat. I came on in the summer of 2020 and I've had the fortunate chance of being here in the fall and I'm able to share with you what I've been discovering with ODO 2.0 and everything that's been released in the newest version as well as going over some basic concepts for today so we're going to talk about cloud native application development on OpenShift. So fortunately if you haven't heard of me my name is Cedric Claiborne I have been on the Red Hat developer channel doing some getting started videos check out my podman my build up my tecton videos if you haven't gotten the chance but I'm super happy to be talking about ODO 2.0 because for developers like you and me it's kind of difficult sometimes to get our projects running on a Kubernetes or OpenShift cluster and ODO is an amazing it's a iterative and straightforward CLI tool to essentially get our projects up there running not only on OpenShift but Kubernetes as this ODO 2.0 release covers not only Kubernetes but things called dev files and a lot of other amazing features that I can't wait to get into today on our presentation but real quick I want to talk about our agenda for what we're going to be talking about so we have a quick introduction I'll give a little bit more information about myself and my background we'll talk about ODO a wide overview but also new features that have came with this 2.0 release that are incredible and they're going to help streamline your process for development we're going to talk about dev files which are portable development environments that you can recreate on any of your Kubernetes clusters we're going to go hands in and create a front-end with no JS it's going to be awesome we're going to migrate a sourced image component from ODO 1.0 and we're going to get that to 2.0 so for any of you developers who have experience with ODO and have been using it over the past year we're going to talk about how you can upgrade your components to a dev file and be able to use that on any of your Kubernetes clusters and then finally we're going to talk about that mini-cube compatibility with Kubernetes so I'll do a mini-cube demo just to show that we have support for Kubernetes on this 2.0 release which I think is incredible because people have always been asking us you know why can't I get this running on my Kubernetes cluster well now we have it so a great a great talk we have for you today and real quick I want to give some more information about myself I am a computer science student at NC State University as well as an OpenShift developer advocate intern I am the coffee intern even though it's virtually I can send the coffee through Slack as an emoji my strengths are yep right there Edson has it crazy how that works my strengths academically are through a Java but on the side I love Node.js and JavaScript so we're gonna do a bit of both a bit of Java and a bit of Node just so this covers most people out there and then finally I want to talk about real quick before the summer happened and before I had this internship I had pretty much no experience with anything Kubernetes related so no Docker no Kubernetes no OpenShift and so my perspective is is completely fresh in the in the way that my how I think about cloud native development is is kind of how most people think about just developing locally so when we talk about the inner loop of development here in a little bit I'll be able to give you a different perspective than you're used to on how I think about it and how Odio can help you when it comes to that so real quick some resources for our talk today if you're looking to install Odio or get some resource some tutorials and how to use it please feel free to head to Odio.dev which is essentially the main website for the Odio program and project from there you can download your local binary for your operating system something unique about Odio is it's a command it's a client based program so essentially you're gonna download it for your operating system so for me it's gonna be Mac OS I can easily install it but if you're on Linux you can download the binary for your distribution and if you're on Windows we even have support for you so doesn't matter what operating system that you're on you're gonna be able to use Odio like a pro next up we've got a cheat sheet developed by my mentor Jason Dobies and it's gonna give you a lot of basic commands for getting started with Odio so essential things like Odio create Odio catalog was components all those different things that you're gonna be using a lot so you can feel free to download that PDF it'll help you a lot when you're getting started and then finally we've got a tutorial for you something called a catacoda scenario so what you'll be able to do is actually spin up an OpenShift cluster in your browser live in your browser instantly and be able to either follow along with the guided lab that we have or you can follow along with this demo either way you can get some hands-on experience on using Odio and kind of see how it works and see all the possibilities that it has because being able to use it for the past couple weeks I've learned so much and I'm so excited to dive into it and really talk about what Odio is so Odio is a command line tool for creating and deploying applications on Kubernetes without having to understand a lot of complex Kubernetes concepts that come with deploying applications so Odio allows you to concentrate on development instead of deploying so you can create deployment configurations build those configurations create service routes which we're going to be using OpenShift for some of our demos today and you're going to see how easy it is to create those routes and other Kubernetes and OpenShift resources that are all automated essentially with Odio so it's going to save you a lot of time it's going to streamline your process and make you more efficient as a developer because at the end of the day what we want back is time and Odio kind of gives us that by streamlining a lot of processes that are typically complex for developers so what I want to talk about is the inner loop of development because when we're going from simply a project to actually deploying our applications it's very easy on a local machine you know you're writing your code in Visual Studio you're building that whether it's a Java project with like Maven or something deploying that running unit test and debugging and you know you're going around in that loop over and over and over again but what what happens when we go from simply like a local machine and local development to cloud native development is you've got so many more processes that make it much more complex you know you're building with a Docker file you're pulling you're pushing from different repositories and along the way along all these steps if you make one little error one little typo one little bug you've got to restart all of that so it's a pain and Odio kind of allows you to streamline that process so that if you're going along that you don't have to make all these mistakes and you save time because you're able to deploy so much easier so it speeds up that inner cycle and as I said before it saves you time and that's what we're all about so features that are new and Odio 2.0 well the biggest thing I want to explain today is what a dev file is so a dev file is a portable YAML file that essentially allows you to describe your deployment environment so this dev file is a portable YAML file and you can use it on any of your OpenShift or Kubernetes clusters it allows you to create a development environment without the need of configuring a new one every time you create a cluster because that can take a lot of time and we don't really want to have to do that if we have the ability to use a dev file so what we can do and what we can describe describe with this dev file is predefined you know build and application runtimes the images of course we can create predefined commands to run so whether you're running a node project or a Java project we can include those default commands very simple and then projects to initially clone so what we're going to do here actually is go out of the presentation when we're actually going to create a dev file from scratch and we're going to look at all these different components some of these are schema version which is the only property of a dev file which is actually required we've got metadata for explaining what our dev file is about starter projects what you'll clone from a Git repo components and then finally commands so commands are what you're going to they're going to be the bulk of your dev file and they're going to explain different commands that you're going to want to run with your dev file and with your project so we'll go in and all of this and I'll explain it from a real-world perspective with a node project I'm going to switch here quickly from my presentation and let's go ahead and actually create a dev file from scratch so I'm going to hop in here in my terminal of course we've got we're on Mac I love my Mac but what we'll do is we'll hop into our documents and let me see I might have to delete a old folder so let's make a new folder called dev nation we love dev nation dev nation rocks and let's go ahead and hop in there and what we're going to do is run the odio create command so that's the basis of odio that's where everything starts with where you create your components it's kind of the the start of everything so what we'll do is it's going to bring up a interactive menu of different dev file components that we wish to create and I'll go in a little bit more detail later on in this presentation of what components we have but dev files essentially allow you to run java and node officially supported and python but we also have old sourced image components covering everything from pearl to php to dot net a lot of different things but for right now we're going to create a dev file using node js so we'll scroll down it's going to ask us what we wish to name the dev file component we can go ahead and use the default in the namespace that we want the dev file component to be created in again we'll use the default and it's going to go through a couple of different stages of validation so it's going to check if we have the dev file that exists and it's going to pull that from a registry and this is super important to note because something awesome about dev files is we can customize the registry which we're pulling from so if you want to add new components if you want to customize your components you can simply add or remove registries which is super awesome but by default we have this default dev file registry in which we're pulling from and again you see it's validated and it's going to ask us if we want to download a starter project for right now since we have nothing to go off of we're going to do that just so we can get a look at what the dev file looks like so we've downloaded a starter project from this repository and we should have it hopefully yep right in our folder right here so if you have familiarity with javascript and node you should see some familiarity here we've got our server.js a test folder some other things but right here we can check it out we've got this awesome little dev file hanging out in our folder so let's go ahead and take a look with Vim which is the superior text editing software and we can see a couple components that we just looked at from the presentation we've got the schema version which is the only required part of a dev file we've got metadata explaining some details and descriptions of what we have so we've got an alpha for build docker file and alpha for deployment manifest which i'm not going to go into today but definitely cool things to take a look at later we've got a starter project which we just saw in the terminal that's what we cloned from so we can customize that we've got the components of our dev file so it looks like we're pulling the node.js image we've got a memory limit and endpoints when we create a route for our application later on we're going to be able to see this actually in action but the biggest part which i really want to show you is the commands so this is customizable and it's going to be different for every kind of language that you're using for node you see the very familiar npm install and you see the very familiar npm start here which are going to be used in our development environment so you've got of course debugging test as extra features but you can see that this portable yaml file this dev file describes our development environment and for node it has all of the necessary components for a node project and what's awesome is that these dev files can be anything from say three lines or three hundred lines it's all up to you on how you want to customize it but there's so much capability that i think it's really awesome that we have these dev files and we're able to use them so what we're going to do now that we've talked about dev files is let's actually deploy an application let's deploy say like a front end component and actually understand how we can use these dev files so what we're going to do is clear our console and we're going to create a new folder let's build a weather application from a github repository that we already have predefined and so what we're going to do before we go ahead and do that is list the components that dev files have that are offered by dev files so we'll go ahead and use the catalog of odo to list the components that we have if i can type properly and so it'll take a second and we'll see right here here's everything that is covered by dev files of course you see the default dev file registry that we talked about earlier we've got multiple types of java of course we've got java corkis which we love here at red hat we've got node j s which we're about to use here in a second and we've got some open shift components first image components that are still around if you need them but of course there's more emphasis on the dev file components just because of how much you can really do with them so what we'll go ahead and do now is we're going to create a new project with odio project and so there's some interlapping of oc the command line tool and odio which is awesome but it's necessary to note that odio isn't really a replacement for oc it's kind of a supplement and allows you to do more with less which is kind of a weird way to think about it but it's really helpful when we're trying to deploy applications so we'll use odio project create to create a new project and let's title it weather and it's going to go ahead and create a new project called weather and we're going to go into it automatically um what we have here is so now we're in um let's create a new folder or we already created it let's hop into it um and so now we've got just an empty folder so that's if we didn't have a project already it's okay because we can clone uh this repository in right now which is a javascript weather application that's going to deploy a front end and so now we have that um in our folder so let's go ahead and hop into that and we see just like before um traditional uh node components that we're already familiar with um and so now that we have this project and we're in this project right now in our local directory let's go ahead and create a component configuration using the dev files that we had before so we'll do odio create remember that's the basis of odio and we'll use the component node js so instead of just hitting enter here and using the interactive menu we can do it all from the command line and we'll use node js of course and let's title it uh weather bug and type properly so what this is going to do is it's going to do the same validation um that we saw before check uh the existence of a dev file if it's compatible pull it from the dev file registry and validate that uh and that's really all you have to do because uh odio is doing all the the complex kubernetes and and open shift um uh processes for us um with a dev file and so what we'll do here is we need to have a way to access our um deployed content so once we actually push this we're using the odio push command which i'll talk about in a second how are we going to access it well routing is super easy especially with open shift and really all we have to do is create a url with this command so it's going to automatically generate us a name for our url uh tag for it for the component weather which we just created so now that this is already done this is really all we have to do before we type in odio push and odio push you know you're probably thinking of like a git push and you're really not too far off because odio push is going to do a lot of different processes in order to get the dev file ready and and start spinning up say like a pod um and a lot of other kubernetes resources to get your application from the source code that you already have uh use a dev file uh configuration for it and actually spin it up in your cluster to be ready to be used um so what it's going to do uh is it's going to wait for the component to start uh when we looked at that dev file earlier we saw um it had a npm install and an npm start and a few other commands well we're actually going to be executing those commands right now uh so we can see executing install command to install the dependencies and everything that we need for our node project um and you'll will see npm start once it's ready for that so right here we saw it executed the run command and literally like that we have our project running in our openshift cluster and i think it's crazy that we went from project to deployed in so few commands so right now let's take a look at it using the url that we created earlier um it gave us that automatic name weather 3000 sounds like some like invention that someone's going to make one day uh to like ai weather um and let's hop in our browser to actually see what this looks like and see if everything's working properly because it looks like it's uh successfully pushed and we have a pod running in our um kubernetes uh our openshift cluster um and so let's access it so i'm going to share my chrome real quick um and we'll actually be able to see it so you should be able to see my chrome um and let's paste in that url that it gave us there we go we can see it running right now on the cluster so of course the url is a little bit wonky uh we can fix that later but we have this application running live um and we can use it to pull data and actually get the weather for our location so let's type in a city for me uh and i guess edson um we're we're both in the 919 which is the area code of uh raleigh um which is where one of the red hat towers is located at so it's a great place to be and let's go ahead and search what the weather is right now so it looks like we've got heavy rain and humidity throughout the day it's currently 24 degrees um it's important to note this is not fahrenheit we would be freezing i would have more than one t-shirt on if it was fahrenheit this is celsius of course but yep it's cool to it's cool to see that live in an action um but okay let me put you in a in a perspective say we're a developer um and we need to make some changes to our application well it's already running live but we want to see that reflected live as well so i'm going to open up my terminal again and i'm going to run the command called odio watch and what that's essentially going to do is it's going to keep track of our current directory um and if we make any changes to the code inside of that directory it's going to automatically redeploy our um our entire project uh using odio push but it's going to do it automatically for us we don't have to go in there do anything different so we'll run the command odio watch and it says waiting for something to change in the current directory where we're at um so let's go ahead and let's hop into visual studio uh and let's go ahead and make a little change um so i'm going to open up the uh correct folder for where we are documents dev nation weather and we've got that weather app right there so let's hop in that um and here we are so i'm not sure why this is already open but we've got everything um our entire folder right here on the left hand side uh you know it's the same folder which we were working on in the terminal um but since it's a java um a java uh no jas project i'm sorry let's hop in and let's edit something that you know could be publicly accessible uh from that url that we provided so the index page of course you know index.html this is very similar uh this is what's going to be reflected from the front page um of course you saw the user site to get your weather right above the button let's add in some text um i mean this is completely random uh cedric is the best intern okay we've got some text we've made a change um and let's go ahead and save this i'm not sure how that got there um but since we've made a change in our our directory that we're working in uh odio watch is going to automatically um do an odio push uh and it's going to do everything for us to have those changes reflected um live on our uh deployed application so um let's wait a second um actually i'm going to show you real quick actually the terminal because it's doing some work here right now as you can see it is seeing that there was some changes up here at the top um that we've edited some files and it's pushing that it's pushing all the changes it's doing uh an npm install and an npm start doing everything that we did with the odio push again and now it's back to waiting for something to change so that means it's done what it has to do and let's hop in google chrome to the same application of course you see with the weird url let's do a refresh whoa that's crazy that's crazy so it says cedric is the best intern of course that's what we did in our um in our application the changes that we made and of course um if we wanted to see what the weather is at our other red hat location it's type in boston um we've got some light rain so application has been redeployed the pod has been restarted um it has done the uh dev file commands that we have put in um or we're actually actually auto generated when we created our dev file and it's kind of already done that for us so the odio watch uh paired with you know a dev file has incredible possibilities um and that's just something in one of the many features i wanted to highlight uh with odio today but we've got a lot to cover uh one thing i do want to um show is how we can migrate as i said before on our agenda a sourced image component with odio 1.0 to odio 2.0 into a dev file so what we can do is actually hop out of this uh weather app let's hop out of that and let's create a new folder um called sourced image and let's hop into that and so say if we're working with a java program of course we can use a java um uh sorry dev file component or we can actually import say open jdk which is uh going to be a sourced image component so now that we've imported that from see if i can go back up here um the uh red hat registry let's go ahead and annotate it um and so we can annotate that to make it accessible for odio uh with the builder tag so i can see that hey odio use this this is a component that you can use and now when we do our odio catalog list we'll be able to see that if i typed it right yep so you've got our dev file components up here and check that out we've got uh open jdk just chilling uh right now in our sourced image open shift components and of course it's supported now since we've imported it uh so that's awesome so that's the open jdk uh component that we'll be working with today but let's go ahead and import a project so i've got this open shift evangelicalist uh wild west backend um it's a java uh project that is the backend for a front end but we don't have to get into that right now we'll just look at uh the backend right now uh and let's hop in there um and see what it's look like what it's looking like so we've got our source folder of course um which is going to have all of the um uh files that we need to compile with maven um so we can do that right now actually just use maven package to build the source files and create a jar and that jar file uh the dot jar is what we're going to be able to use to create the component configuration so we've got that build success if we look at the folder again now we've got a target folder which is going to have our dot jar um and so we'll hop in and we'll actually create a component with that so we'll use open jdk uh 18 of course call it backend and let's point to that target um and use should be something like wild west dot jar um and that's going to create our component configuration so let's run that oh check it out so uh odio is actually telling us that um we need to add a source to image flag uh when we're running this command so let's go ahead and add that nothing bad about that it's just saying hey you know there's default options available we prefer you use yet but you can still continue using your source to image you just need to make sure you're using this flag so we'll validate that and now that we've got this component configured uh this component created um we can either do an odio push and continue with that and deploy that or we can use a utility uh that comes with odio 2.0 and it's called convert uh to dev file and what that's going to do is essentially package our component up into a dev file and have that ready for us to use um so as we can see dev file is available in your current directory so if we were to hit uh ls again we can see a dev file has now been created so this is awesome and if we were to take a look at that we can see that of course schema version metadata all those uh simple components that we have uh all these properties of a dev file and then down here we can actually see the image that we've imported earlier um so everything's come in full circle now we have a dev file from um the uh configure the sorry the component that we imported um and though there's some instructions that will come with doing this command of course you got to do odio push um and kind of finish that off but as far as migrating uh something from sourced image to uh a dev file it's simply that easy um and i guess there's a little bit of time that'll take uh to do that because it's having to create the kubernetes resources so we can kind of pause that um or wait for that and the last thing i want to show through this uh through this demo is the minikube and kubernetes compatibility that is provided uh with um odio so edson do we have time to cover that real quick just to make sure yeah we should have a still have a couple minutes yeah all right sweet i forgot to set a timer so awesome so what we can do is i'm gonna go ahead and start um my kubernetes uh real quick and i'm gonna share uh that extra terminal real quick because i think it's awesome that we now have uh support official support for um kubernetes and so i kind of just want to show that before we finish off so we're going to do a minikube start to start our local kubernetes cluster and we're going to wait for that um and the instructions to start uh or create a component and deploy that uh on kubernetes is really similar to open shift there's just uh small differences um which i'm going to cover here in a second because um to uh to define a route and to create that route we're actually going to have to bring up ingress ip um and if you're interested there's definitely some resources on odio.dev about the ingress ip and why it's important um but we'll wait for that for one second um for it to bring it up and then we'll go ahead and start and create a new project um looks like we're getting an error real quick uh that minikube is paused so i'm going to do it one more time um and hopefully we'll be able to do it on minikube before we run out of time here but we'll wait for that for one second and as i said again um if you're looking at more information about running all of your projects on minikube definitely um or or kubernetes in general definitely head over to odio.dev because we have resources that parallel not only open shift but also kubernetes so we'll just finish up waiting for uh minikube to start and then we'll create a new project and for this we're actually going to use again a no j s project um a lot of a lot of javascript today uh but hopefully um that's that's okay with everyone big fan um but of course we cover java today as well so let's just wait for this to finish up okay cool so um let's go ahead and find our ingress ip um and for us it's right here and so that's going to spit it out um but to continue let's go ahead and do another odo project create um let's let's pick a new name instead of whether what we had before um minikube testing so that's going to create this new project and it's it's going to have us already in it um and that's again list the catalog um for all the components that we have available because you're going to notice that's actually a little bit different than open shift we've actually just got the dev file components and not the opens the open shift components that we had from before so it's a little bit less um but we still have the most important things java node python uh for creating our applications so real quick um we're going to hop in that dev nation folder um and make a new uh folder called uh mini hop in there and let's go ahead and clone a node jask example component into that folder um and so this is the same uh component sorry the same project file I think that we used at the beginning when I was showing you dev files um so from there you can see all of our basic parts of um a uh a node project and we're going to do the odio create command again and instead of using the interactive menu we'll use node jas and let's give it a name uh let's call it my node jas so we're going to validate uh that we have the dev file pull it from the registry um and now it's almost ready but when we pulled up the ingress ip earlier it's for a reason because when we're creating a url on kubernetes we actually have to define the ingress url uh when we create a url so we'll do odio url create and give it that host flag um and actually I kind of forgot what the ip was so let's bring that up again awesome so let's create a url to access our content once it's deployed um and we'll create that oh I might have already done that yeah sorry about that we'll create the url um with the host flag and let's put in our ip our ingress ip for that and so there we go we've created a url to access our component um once it's created and as you can see uh when we take a look at the URLs that we have with odio url list it's already created um and that's going to be local on my machine um and then all we have to do is of course follow the instructions and do an odio push and that's going to deploy our source code for this node project so comes full circle you know whether you're using open shift or whether you're using kubernetes uh odio is a fantastic way to kind of go in and speed up your development process um and kind of get it running from project uh to uh deployed um and I know that developers like me and developers everywhere around the world and around the dev nation family will kind of appreciate this and hopefully we can save you some time so again my name is sedger cliver and I'm so happy to have had the chance to kind of give a brief overview I wish I could go in more depth uh about odio but uh thank you so much for your time for being here I really appreciate it if you want to reach out I just created a Twitter I'm not really sure how to use it uh but it's above there and my github and stay tuned to the red hat developer channel and dev nation but yeah thanks edson awesome cedric yeah if you're a tech person you should be on twitter and uh if you're watching this you have the tip uh you can follow cedric so he'll be sharing a lot of different technology stuff and uh cedric also thank you very much for this awesome presentation um I hope we can book you for another session talking about an audio deep dive yeah everything worked perfectly today and I'm sure also that the open shift team agrees that you're the best intern ever yeah unfortunately we don't have time for questions today but thank you very much for watching this today and the dev nation family gives cedric a huge thank you and a round of applause for this successful presentation see you soon in our upcoming in other upcoming dev nation tech talks bye