Okteto - How To Create Instant Development Environments In Kubernetes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Great tool cannot recommend it enough

👍︎︎ 4 👤︎︎ u/qa_otto 📅︎︎ Jan 15 2021 🗫︎ replies
Captions
it was automatically created for me preview environments it's not really working well without really knowing much about kubernetes thumbs up for instant cluster type of stuff [Applause] everybody is using kubernetes one way or another maybe you're experimenting with it maybe you're running in production but you are you almost certainly using kubernetes somehow or at least learning about it and we already know how to run permanent environments we know how to run staging integration production clusters environments that's a known thing more or less temporary environments are more flaky still not really solved the other day i created that video how to create preview environments and you can see the link is somewhere there but how about environments for development you know before we reach the phase where we create a pull request how can i as a developer leverage kubernetes to give me everything i need to work on my stuff whatever that stuff is now i already explored git pod and you can see the link over there watch that video if you haven't it's amazing but git put gives me you know ide and terminal and stuff like that replaces my laptop what i still don't have is a good way to create enviro servers let's say clusters or environments within clusters where i can deploy my stuff and there are a couple of things that are very important when we work as developers we need a cluster or an environment or a namespace or something where we can deploy our stuff which might be our laptop but hey might not be might be a real cluster somewhere we need our work to be separated from other people's work right at the moment we integrate with others but while i'm working alone i need my own environment whatever the environment is it needs to be very easy right i cannot expect everybody to start learning about kubernetes spend three years figuring out no no it needs to be extremely easy and it needs to be accessible and and this is important part it needs to clean itself up if i'm going to use real clusters to deploy my stuff stop the time developing before it reaches pull requests before it reaches staging or roads or not i probably do not want to waste money to run everything i ever deployed forever and ever so i need to be able to hey i need to start working deploy this here and then half an hour later if i go for lunch then maybe it should be shut down right so what we really need while developing in those early stages is a way to create dynamic environments for every person for every project for every single combination and that needs to be temporary easy and it needs to clean itself up now we can approach that problem by you know creating namespaces so some administrator can create a namespace for you and namespace for you and everybody gets a namespace and maybe every project gets a namespace or maybe there is a permutation for every project for every person gets a separate message but that's extremely complicated to manage and it's it's it's it's painful it's going to be painful now let's see if we can simplify that let's see if everybody can get a fraction of a cluster where they can deploy anything they want and if that something is going to be very easy if the learning curve is going to be very shallow and if it feel out to clean itself let's see how we can do that and today for doing that we're going to try something new we're going to try a service called octo sounds weird anyways we're going to see whether we can accomplish whether we can get our development the environments clusters what's or not using octato and it's going to be free that's a good thing so let's dive in let's see octato in action and whether it can fulfill our needs for development environments so before we dive in into octet what is it let's let's see what is it i have it written here it says empower developers to innovate and deliver cloud native applications faster than ever now that's a vague description that's from their site i don't like it i will describe my need my requirements my desires and we'll see later whether octato can give me give us that developers get preview environments without much fuss so this is octeto or whatever it's pronounced and i did a few things in advance i registered already and i perished it and i installed the cli i will put the links in the description together with hey i will have a gist even with all the commands that i will run but anyways those are the two things i did in advance i installed the cli and i registered in octo and everything else we are going to do together we are going to explore octato in 20 minutes or less and try to discover whether it can help us creating development environments and in this context i don't mean like what gitpod is doing maybe actually we'll see but most more importantly whether we can get uh clusters that we need to deploy our applications while delivering right and trying them out and testing and doing what's not we'll see but anyways this is octato in 20 minutes or less the first thing i'm going to do is you can guess probably i'm going to login hey there we are i'm going to use my github account and there we are now we are in octet and what can we do actually let me make this bigger for you it's empty and there is a big button saying deploy let's deploy an application and see what are we going to get and it asks us for a git repository yes i want to deploy from a gt repository it could be help chart we're not going to do to that today and the address is going to be https github.com remember all the commands and all the instructions are in a gist go to the description to get it and the other the the repository belongs to me and it is octet demo so i just specified the ripple and telling of octet hey this is the repository you know what to do let's see whether octato really knows what to do and now we need to be patient right patience it's a virtue people say i don't know i was never patient enough anyway there we are it's almost there it's waiting for output it is creating the the environment and it already figured out it is building the container image it is installing the application and says octato pipeline successfully uh executed that's it my application is up and running and i can view it in browser i can do whatever i want to do and all i did was just tell octato hey this is the repository uh go do something and it figured out it found out that there is a directory with some kubernetes definitions it found out where it is it could be helm it could be customized it basically how to detect what we have and uses what is already in that repository and i invite you to explore that repository later on in more detail yourself but it figured it all out and uh just did the right thing now let's switch to the terminal because i cannot live without the terminal for too long so i'm going to do octet login now from a terminal i'm logged in cool it redirected me to the browser it figured out that uh i'm already logged in it configured my cli and now i can run octet namespace that's a bit strange name basically actually it's not that strange it will create a namespace in some cluster somewhere for this project only or for me you'll see but first things first let me export cubeconfig so the just in case i don't want to mess up with my real production cube config so export cube config equals wherever i am right now slash cube config dot yaml oh that's a typo over there it should be slash excellent now let's see what do we get with that with the command octet or namespace that was mentioned in the ui before octet namespace traffic that's it now you might be confused what happened what happened now what happened really is that it configured cube config to use the cluster that octato created somewhere some somehow for me and we can see that with cube cattle config view right this was this is kubernetes config that was created for me basically tells my lock on my laptop hey this is the cluster you got to work on whatever you're working on right now and go use it right i got the cluster for me or a namespace within a cluster or a segment of a cluster anyway whatever i need for development and we i can confirm that by saying cube cattle get oh let's see what do i have in that cluster that was automatically created for me here we are i have a pod a service a deployment and a replica set now it could be more it could be less what matters is that this is the application that was deployed for me when i when i told octato hey this is the git repository it found out some manifests and it deployed the application for me now let's see more importantly cubecut will get ingresses not only that it deployed but it created this address look at this guy here it exposed my application to the outside world based on the name of the app which is devops toolkit uh my username which is vfrsecan.cloud.net and let's see actually now if i go to browser if i open it what will i have this is the same address this is my application it is deployed it is running somewhere in my cluster i don't care i don't need to care it is all interconnected in a way now what else can we do let's take a look at the deployment that was deployed for my app cube cattle describe deployment devops toolkit and we can see that it did everything it needed to do this is my manifest but it's not exactly as i defined right so it took the manifest from the git repo that i initially told it to use and then it built the image it figured out it found docker file it built the image and it changed the image uh to this right so this was not part of my manifest it was something else before it was clever enough to to understand that whatever i defined as the image should not be the one it should use the one it built so this is it replaced the image with whatever was built when i created the octatone space now let's see how we can combine that with uh a bit more of local work right i'm i'm now interacting from my laptop with the it's a clustering cloud right that runs my applications does everything i got i got my cluster or not the cluster namespace in some cluster with just enough of what i really need so let me clone the repository that we already told octato to use so git clone this is the same repo i used before github dot com slash with r6 slash octet demo so i'm cloning it locally and if i go to octet or demo now i can say octet up octato up now what will this do you will see actually what it will do it will be a surprise you might guess it i guess so it is now connecting my laptop with the pod inside of that cluster inside of that namespace actually it is creating a pod that will allow me to work fully remotely with the cluster basically i am about to enter ssh in a way into the cluster and it is synchronizing my files so it is moving my files not moving copying my files from my laptop into that container and once it's done i should be able to directly work against the name space against the applications in that cluster without really doing much so i'm going to fast forward to the end of this process there we are now i am inside of a pod inside of that cluster and i can work as if i'm completely there right i can prove it to you let's say that i can go to the source code through the src directory i can list the files i'm now inside of that cluster and those are the same files that i cloned locally right it synchronizes what they have on my laptop with what is happening in cloud i can list the processes for example with psox i'm now inside of that cluster inside of a pod inside of that cluster let's create the file i'm going to touch something i want to create a file in a remote cluster in a pod running somewhere else and see what is happening with my local files so i created a file over there i'm going to exit i'm going to list the files that i have now on my laptop and you can see that something is there it synchronizes what is happening between my laptop and what is happening in the cluster and that opens doors to some really funky things we can do so we have two major components or things that we might want to potentially use in vidoctato one is to have a cluster or a name specified in a cluster available for any of our projects for for every person and apparently of the others um to work without really depending on some infrastructure nonsense and what's or not so we got the cluster uh instantly basically and then we can work directly in that cluster writing code synchronizing between laptop and that cluster now i like the first part the first part is awesome so it gives me a remote cluster preview temporary clusters that i can use instantly right i can switch from one project to another and i will always get the new fresh namespace with everything any decide that's awesome now it also tries to replace my local work with remote work like when i did octet up it connected me to a pod running somewhere but that's finicky that doesn't work really well so it's not not that good at replacing my local development environment with something happening remote gitpod is much better for that so local development remote development replacing one with another it's not really working well but getting instant cluster instant namespace for whatever we need that's absolutely amazing so i really thumbs up for instant cluster type of stuff now let's see a bit more of how it really works let me output the docker file that we explored and it used right so this is the docker file i'm using it's hugo app that has multi-stage builds one is to compile the app and the other one is to create uh the final image my application is defined in the helm directory right now for rocktecto it could be helm it could be customized it could be a few pure kubernetes that's all good but there are a few other things that already had there that they didn't show you right cut octet pipeline now this is the pipeline i created in advance octet could figure out by itself in most cases what to do but if we create the octet pipeline then we will we are guiding it towards what we really really need and in this case i'm using octet to build to create a new image and that image is tagged as octatodev there was toolkit octator git comet right it's a naming convention doesn't matter and then i'm running a helm upgrade to install a new to upgrade or install or upgrade um helm uh release of my application so basically that is how octet knew what to do in my case right i just wrote a simple look at the pipeline that tells it what to do not much more and there is that octet yaml file that provides specific information for my development environment and i will show you that file here basically it is telling octato hey the command that should be executed is sh whenever i do octatop to synchronize with that cluster uh it should synchronize whatever is in my local directory and my laptop with uh the directory src in that development pod type of stuff and there is no need for persistent volumes so we have two things right octet of yaml which is this one which defines if you want to use octato to work remotely which i don't really recommend i think that gitpod is a better solution and we have octatop pipeline that tells octato how to deploy applications in those temporary clusters which is absolutely absolutely awesome and finally what else could it do uh yeah let me let me destroy the app from the ui first so that we start over a bit so i'm actually i can show you another command there but anyways destroy i'm going to destroy everything that was created so far and we're going to start over and do the same thing exactly the same thing but from a terminal right how can we accomplish the same result as what i initially did from a browser from a terminal so remember my cube config is still configured to communicate with octet namespace all i and i can use it freely i can do like helm upgrade doordash install devops toolkit and the directory is held and i want to set ingress enabled equals false because octet will create english for me right and now i'm working with that remote cluster i never created the cluster i mean i i did create the cluster but not in this case this is now against octato cluster so i can use it i can do it from browser like what i did initially then click the deploy button what's or not or remotely by octator namespace which creates a new temporary namespace and just help upgrade or helm delete devops toolkit right i can delete applications i can create applications i can upgrade application i can do more or less almost everything that i would normally do by creating my own cluster but this time i got clustering instantly so that i don't really need to worry about the setup and that's all there is to to it it's simple tool i like simple tools and there is no need to make it complicated if it does exactly what i need and what i need in this case is to get namespaces instantly for my work and that's exactly what i got so that's all there is to it octeto allows us to get instant cluster or a segment of a cluster without really knowing much about kubernetes and it allows us to synchronize our local source code with that cluster in case we want to work remotely now two things but not both of them equally good right getting instant cluster absolutely awesome amazing i love it having remote the work environment where i can write code and synchronize it not so good git pod is a much better solution the link to git pod it's in the description both git pod and octato are doing similar stuff but approaching it from different angles and maybe if we combine both of them we can get the right thing we can use gitpod to get replacement for laptops to get whatever we need in a laptop available from a browser running somewhere else and we can use octeto to get instant clusters where we can deploy stuff gitpod doesn't give us cluster it gives us work environment but not in an environment where we would deploy kubernetes applications a single application yes a whole something defined as kubernetes scale customer is not that good with git pod on the other hand remote replacement for a laptop you know with ide and synchronization files and git support not so good with docteta so they complement each other what matters for now is that you should think of octet as instant cluster instant development namespace where you can do whatever you need and then delete it when you don't need it anymore that's it no fuss easy cluster accessible to anybody or segment of a cluster thank you so much for watching remember subscribe to the channel if you haven't already you probably did right if you haven't don't be shy subscribe and click the like button likes are important for youtube algorithm and for me and what's whatsoever until then have a good day have a good night wherever you are and see you next time cheers
Info
Channel: DevOps Toolkit by Viktor Farcic
Views: 2,614
Rating: 4.9587631 out of 5
Keywords: development platform, k8s, app, okteto review, Viktor Farcic, preview environment, okteto kubernetes, Kubernetes, okteto tutorial, okteto deploy, integrated development environment, cloud computing, development environment, okteto, deploy, Cloud, application, development environment setup, containers, containers and kubernetes
Id: yjgHHUT-5-s
Channel Id: undefined
Length: 23min 1sec (1381 seconds)
Published: Thu Jan 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.