From Docker Compose to Azure Kubernetes Service with Vy Ta, David Fowler, and Dan Wahlin

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Laughter] [Music] hi everyone this is john gallon welcome to episode 1 of coding with john in this first episode i've invited vita david fowler and dan wallin to explore bringing an application i wrote from docker compose all the way to azure kubernetes service we're going to be looking at docker compos local kubernetes deployments aks deployments scaffold and a new project from the.net team called project thai in this new series we're just going to be coding and exploring and learning together i'd love to keep creating these videos as this first episode was super fun for me and i learned a ton so if you want to see more of these videos please do give a like subscribe comment share on twitter and just let me know in any way that you can that you like this video so let's get right to episode one so i'm ve i'm an engineer in the commercial software engineering group at microsoft and i've been focusing in the containers and kubernetes space for the past like four five years four years yeah four years and um i'll just be here trying to get this app running locally on a kubernetes cluster and then in azure and aks cool david i'm david i'm an architect on the.net team um with the focus on kind of cloud and back-end services um i learned kubernetes like last year um so i'm here just to help out where i can nice dan yeah so i'm dan walleen i've been at microsoft for a whole two weeks now end of my end of my second week so i'm just still learning how to log in it feels like but um now i've been working with uh containers for a long long time and uh love kubernetes i'm a little more from the developer side of kubernetes though not the admin side so let me just go through the app so this is the azure sdk demo app what it does is it imports or sucks in ingests an image and extracts the text from that image and then analyzes the sentiment of it and then changes the border color dependent on that sentiment so if it's green it's positive it's if it's yellow it's mixed uh if it's red it's negative it's not perfect but it's a good example of how to tie together a bunch of the azure sdks so this version is written in.net and i'll bring you through the code here so in the dot and i'm actually going to write these in all of the various languages but in the in the dot net version we basically have three main uh parts to it and let me zoom in a bit an api with a single controller the image controller and that accepts an image it gets images and it gets images by id that also has an image hub which is a signalr hub that does some polling so as you're here and you click add random meme you notice it will add the image and then we're using signal r to query the cosmos database and so when all of that processing is done it will update the border color there and then we also have a a blazer web app here and it has a single page just index here you can see it's running outputting messages in the back and you can see here that that image was processed and it went and i'm logging all of the um all the activity that's happening on the queue and cosmos and everything question yeah is that a storage queue yeah so is that a yes azure okay yep yep so in the api uh actually great question so contr in the controller inside of this nq image async method here we have a cue image um so if if one's not passed in i dynamically get one from this meme reddit meme endpoint i'm streaming it i'm uploading to blob storage and then i'm putting a message in the queue okay uh and this is a storage cube so we're we're putting it to the queue okay now in the um service let's find that service we have a q service and that is um does some initialization to get all the clients ready and then it's just doing a while true and getting messages from the queue and it is using form recognizer to ocr basically extract the text from the image so we aggregate all that text there and then we are getting that text and sending it to the text analytics client and getting the sentiment back so it's it's either positive mix neutral negative and then we are storing that in cosmos and then deleting the message queue and that is on just on an infinite loop and so the reason why i have services key service i plan to take this to you know any in number of service options service bus you know event hubs and grid you know whatever uh whenever we get a new sdk out that's when i plan on implementing a new backend service obviously it'll be changes the api to accommodate that as well also back in storage like we're working on a table storage library right now and so i'll i'm going to redesign this a little bit to you either use either table or cosmos yeah and so then uh yeah when the page loads we just get the images we initially uh initialize the hub connection and then uh you know just boilerplate like handle form control stuff so that is the app and so i got all of this running and and i was questioned yeah and load what is that doing so i use umv files um a lot like pretty much every app i build i'm using an emv file because all of all of these so it works with net it works with python it works with any language has some sort of env loader and you know if i'm in net and i'm setting things and say you know web app app settings or whatever it is or in the api i'm looking at some settings here i don't want to have to dig through all of these various apps to set settings right all of everything basically is driven from this emv file here i see and so when i when i create my azure resources it outputs my endpoints i just copy and paste that uv file and then everything just works right yep and so yeah the if if if this were more idiomatic for net it would use um the configuration provider that was built into.net which kind of supports multiple config config sources okay it could be environment variables it could be a follow-on disk um and they kind of composed that way and then the intent is that when you use kubernetes or anything you you basically override the settings in the local app settings off in the local app settings with something else we don't have an info provider per se um but yeah yeah it would be actually something to look into is should we build an invalid provider yeah that seems reasonable yeah yeah especially real quick john i'll have to admit last night when you sent me all the info to get this going locally having that env file was super convenient because you know less than actually about five minutes yeah just plugged those values you gave me and it was up and running so that was pretty cool yeah i'm nice yeah super good feedback and it's interesting because you know every time i demo this i get that same question it's like what is that uv file but it's very popular uh way to develop so i think it's just maybe not popular in in java.net yet um but it's extremely popular in you know python world for sure and just to be clear that and follow does not end up in your report right it's supposed to be per user yeah so what i do is i publish always.um emv.tmp um and this allows you to to check this in commit this file but not this one so if this one has any secrets you know in this case it doesn't really have any secrets i've i'm using key vault now um so i don't have the cosmos key here uh and i all and these are very are public well-known like emulator keys so they don't really matter they're already out there in the wild and then in my get ignore i have uh yeah yeah so i'm just get ignoring that dot emv so dot net has something similar but it's not it is different all right so we have this thing called user secret there's a per user uh config file for every dynacore application and by default the config provider that's configured in asp.net core and for a worker service will include it and it basically lets you stay stay away from having stuff in source control because it is not in source control and you can use a tool to set and get values or you can or or you can open the file if you know where it is on disk and then like edit it to add stuff to it yeah i mean i i think i saw that and i i kind of lost interest when it was net specific but yeah because i knew i'm going to all these languages i'm like i just don't want to deal with that i have a method that works for me and it works great um so you know it'd be interesting though like a side thing is how can we bring the emv you know popular world to net in a more natural way kind of make it you know part of the ecosystem yeah in the api here inside of what is it startup i'm doing the same thing ev load uh api in the api uh in the service the web app actually doesn't need it um the only thing that web app needs is the api endpoint which i'm using in the dub dub root you have app settings for here and here and so i'm just using those app settings there because um i inside of the let's say program here i wasn't actually able to access environment variables from from here i had to do it as part of app settings and so that's the only blazer specific thing that i had to do and i believe it's just because blazer app runs in the client doesn't have access to environment variables so that's correct yeah cool um so i got it all running and i had you know that all of these open in instances and i'm hitting f5 to start the api hitting f5 to start the web app and whatever um and so i'm obviously not going to do that every time i want to debug or whatever and so i containerized each of these and so you'll see api as a docker file in you'll notice here too that i'm installing the cli for each of these you know think about it's like the dev container i haven't yet to do i haven't yet created the production container that doesn't include the cli but what this allows you to do is use the azure cli credential and so here down in lib identity i'm creating a chain of credentials and so it'll try environment variable credential it'll try azure cli credential and it will try manage identity credentials and so in this case because i've taken this all the way to kubernetes and aks i know that azure click credential doesn't work yet at least with my setup uh with kubernetes and so i popped in environment variable credential here uh just to get them to work actually in emv down here you'll see i actually have client id client secret and tenant id uh and that well the identity of environment credit will automatically pick that up and you'll notice here uv.temp i just removed those secrets everything has a docker file uh and then i did docker compose here and you'll notice same thing here i'm passing in the emv file to that uh docker container so this will create all the images when you run docker compose up it will build uh the images and uh it will start every one of them and let's say this one depends on the api so web app depends on the api and you can also mount volumes so this is how i was able to use the azure cli credential was here volumes i can say mount my home azure to root azure inside of the container it'll utterly automatically pick up that i'm logged in with the cli locally in the container so i don't have to do an easy login inside of the container every time it's funny you showed the env file there john because i was going to say earlier hey that's a good use case for docker compose and i'll have to admit i haven't even had time to see this yet so there you go there's another use case you said it works on python it works on.net and definitely because i've used it for docker compose more so that's cool yeah absolutely yeah it was super handy um and then um you know it's got it's all working here but it wasn't like i have i haven't deployed this to azure yet like this is just me running locally um and so i looked into a couple of things on basically how to go from docker compose to azure and i found i found something which was a container based uh app service where you can publish out a compose file but it's in preview so i was going to try that as a next step to just say okay i got containers i got docker compose now let me get this out in azure and docker compose inside of an app service um and i could obviously you know just create an app service for the api for the web app for the queue service and just run them as containers uh independently um but then i wanted the lifestyle life the lifecycle management of the containers like something dies i want to bring it back to life and whatever and you know just docker compose i don't believe does any of that and so then i was looking at uh doing kubernetes and um so i mean so it does right luckily if you want that you can you can have a restart policy on for each container and you can say restart all this oh okay yeah for for um okay so it's as one of the options here like yeah restart always something like that yeah yep god i say read and i wonder if the azure app service multi-container supports that um i haven't tried that myself on on that yeah this is the thing i found creating multi contain multi container pre using docker compose configuration and then as well this thing is still in preview i have no idea yeah i mean you could do this the thing is if you run this on app service with multiple containers what you end up with is multiple apps on the same vm basically yeah so you don't get the actual spread of the apps across multiple vms like how kubernetes like right we'll schedule the pause on different nodes right yeah and i mean i looked at it and i was like yeah i don't know i maybe yeah um and i just i'm like let me just jump over to kubernetes and then i was just like okay docker compose to kubernetes um and i believe this is how i found dan's course um what's the url to that let's see i think it's this one that's a good question i don't think i know it either um yeah so i found this course i went through uh let's just sign in here i went through each of these options and i think i skipped over stack i just didn't know what that was and i uh you know i just i figured i probably knocking it uh go ahead yeah probably not it's it's nice and easy it's a quick way to get it going if you have docker desktop um but you know if you're going to move to kubernetes anyway you're probably going to use one of the other options yeah yeah so then i looked at compose and i ran into a bunch of issues just like from the get go with compose with my uh compose with a k um and uh so basically compose will convert your docker compose files to kubernetes kubernetes friendly files um actually kubernetes files uh and then scaffold allows you to uh basically monitor your project and then rebuild your containers and deploy to your kubernetes instance automatically so you don't have to go and you know do a build and then do another deploy as you're developing so then i i went here and i installed i got it all running actually let me just show so docker compose up is a command i just have this shortcut um let's zoom in here a little bit i just have a shortcut alias d u which is docker dash compose up dash dash build i was typing that way too many times um and so this will go through and build all the containers and i'm in the net folder here and so we'll go through look at this compose file it will build all those containers and it will start everything up and then you just hit the uh hit the url so that's that's how that works and so then i went to look at compose and i had this at version three eight uh and apparently composed with k doesn't support three eight um so that was the first error i ran into i had to downgrade to three seven uh and i think that's just a known issue um and then i ran into a bunch of issues with with mounting um my local folder to the container inside of kubernetes that didn't work uh yeah volumes are tricky yeah it still doesn't work i found the bug i'm trying to follow up with docker desktop um and i actually pinged rich turner because i believe he did some work with them to get wsl 2 integrated um and so hopefully he has a contact over there to help i got a bug filed on that um so that's that's what led me to use the um you know service principle um and so yeah so here i am and then i um you know i generated the compose files and you know being new to kubernetes like i just went to you know i kind of want to learn i want to learn what it's about right so so i went here learned the basics and it's just like walls of all this text like and i'm i i i you know i got i kind of went through learned this stuff did the interactive tutorial but then i still didn't know like what what to do after that um you know i didn't know like okay i have these files like what do i do how do i get this running locally you're not alone john because i think we all we all started that way yeah what do we do now and even if i wanted to say okay i have like let's say i didn't have compose with a k and uh i wanted to should we just call it k compose is that how we say it uh or hard k compose compose okay i like that compose um you know it outputs in files but i don't really understand what's going on how what mapped to what um and so i this is this is at this point is when i pinged v and said hey can you help me with this v maybe it's a good time for you to take and show us you know how you went from here docker compose uh and then just show us how you got it running locally and then show us how you went to aks sound good yeah did you want me to talk about the different um the yaml files that are actually generated from compose yeah can you can you just go ahead and run the code compose command and then maybe just walk us through what it generated and why yes cool while they're getting set up i just wanted to take a quick moment to ask you to give a like comment subscribe if you like what you're seeing thanks a lot let's get back to it this is probably the i think this was the the command that you ran as well which was just using the convert command um pointing to a docker compose file setting an output directory and then we were testing out the hostpath volume and when you run that it creates um the service animals the deployment yamls and then also this config map that references that env that we were talking about earlier so if we open this actually we're not using these anyway so i'm just going to delete them these are just volume claims for the for when you deploy it and if you wanted to use a host path um eventually i do for sure want to use that because i want to get the azure cli credential working in kubernetes uh for at least for local dev so the good thing about compose is the fact that it does create these files for you because it is a pain to start from scratch and i was talking to john that usually i just find an existing deployment and i copy that and i change the values to what i need it to be it gives you the yamls that you need pretty easily um but it's especially helpful if you have a docker compose file so it is actually part of the kubernetes project like it's on github under theirs um and it is updated but yeah not as many people know about it so gotcha i love it i mean it saved me a lot so it's a good starter yeah especially if you have the docker compose file um so yeah this is a deployment which in kubernetes um because it is a declarative system the deployment will basically describe how you want your um pod pretty much and so you can describe um your i think you can describe up to uh i mean n numbers of containers in here so a pod can have one or more containers in here and so we have all of these environment variables that reference a config map that was also created by um compose which i'll show and then there's just the image name which is um your local image and then they added this volume yeah so do people typically do one container per pod um yes there are cases where you'd want like a sidecar container um for a lot of different reasons but yeah generally if you have a single service it's a single gotcha i think it's i think of sight cars like the new framework plug-ins for for clusters so it may not be your your own code being put in that as like our but it could be like a thing that runs in the cluster that's trying to add behavior to your your app exactly yeah that is the deployment here's the service for that deployment and this is basically just an end point given a a pod um and so this uses a selector on this label and this label was provided by compose but that really could be anything yeah that was something i kind of skipped over um and i know when i removed it it didn't like it um and and then when i you know i saw i just left it alone um so i mean i think earlier you said a bunch of this stuff's not required but i think label is required isn't it yes so you do want to label um your deployment so that your service or your pot at least so your service knows which pod to that it's um referencing when it when people try to hit its end point okay and then these are the ports that kind of i think were described in the docker compose so we can just leave those um this is the config map oh here it is this is the configmap that was generated with all the values so that's pretty much it and there's a deployment and a service per server so we have um three pairs in there i think new pods are created um given a deployment so if we were to just create this as a pod um a pod is like a single instance running thing in kubernetes and so once you delete it it's gone because a pot is just a pod but at deployment you can have replicas and this one we're specifying at least one needs to be running all the time and so once a pod is killed or something happens to a pod it'll spin up a new one to make sure this declaration is true always gotcha um and then we do label it with this i compose key with this value and then we tell the service to um send traffic to this deployment with this label yeah so dan you said that you remove a bunch of the stuff i think you keep the label right i well yeah i always rename them because theirs are you know that i o compose service key which i don't really like so you just do like a global replace of that yeah well typically but you know a lot of times i'll have multiple labels um i'll have for instance a tier i might have a tier of dev or stage or prod in some cases um and then the just the name like they have there gotcha um they also add like creation dates and a bunch of metadata that i typically will take out just because i don't need it probably should put that but i don't okay yeah but other than that like you said i think it's just a good it just saves you time it's like not a tool you have to use gotcha when you have when you say you copy and paste do you have uh examples and resources that you know that you pull from or is it your like your own personal or is there like a repo that you go to to get those examples um i usually just go to either the kubernetes docs themselves to copy the deployment sample that they have in there the other thing is um our docs uh microsoft docs has a sample deployment to aks with um the azure voting app deployment so i just take that those are yeah all right i'll link to that standard i wanted to show what we see when we just apply what is given to us um actually if i do apply this folder right now there are a couple things that i did add um to make sure that we can access the services one of it is this nginx deployment so that we can have an ingest controller to handle traffic um to the web app piece and to the api service as well yeah so when i i i got it kind of running ish and you know i hit the end point and nothing would happen and so i i i was like okay like i got all this running but i can't actually hit the endpoint it turns out the ip was an iep of the i think it was the cluster or the node i'm not sure uh and so it's not available to my local machine yeah and so then i did a bunch of research which was like a bunch of googling on how to hit you know your container um and i was thinking it would be this super easy thing uh but it turns out it's just not and there's no super clear guidance on how to do what you're you're gonna do and so i think this is something that we can like this step is something that we can help people figure out there's definitely a gap there yeah i think there is a if you specify like node port on these services for each of your deployments i didn't try this but if you did then you would be able to um ping it from your local host yeah i tried that you couldn't get it to work i don't know so the the report has to go on service right right and there's no port there's load balancer which doesn't work locally um there's one more camera the name of it yeah and that's what you don't want yeah um if we find that out yeah and i mean so by default kubernetes the networking is all about um internal cluster-based services and you have to basically expose explicitly what you want to expose to the outside world all right that's the mindset shift so even though if you were on app service one of your services would be the main entry point is similar here you have to kind of pick one of the services to be your entry point service um because it has no idea which things you want to be exposed or not so it assumes by default your internal to the cluster so everything has its own plaster ip uniquely and then you have to expose one of those services or you know or or have ingress to the whole um cluster to erupt to your internal services i tried node port didn't work i don't know what i was doing wrong um and and i couldn't find like a you know really good example and then the examples i found were mainly for linux based systems not windows not docker desktop not wsl2 uh and so i kind of got into this like networking nightmare kind of thing um so anyway yeah this is this is why i think this this nginx is is here right yes so the in the the engine x is here to be able to have a single um entry point because once you're in the cloud then you'll need to have this and a single entry point to route between the web app or yeah to the api from the web app um but i wanted to show here this is how you actually are exposing the nginx service to your local host and so if we did something similar to these individual services we would be able to hit them directly um but so for this that's only local like that wouldn't work in the cloud right so okay got it there's no way that i'm aware of that you can make the load balance the networking work the same way with the same manifest both locally and remotely because when you're on bare metal you don't have the load balancer option and when you're in the cloud you need to use the load balancer to to route traffic from azure's network or or any network on the cloud to your cluster this is the ingress deployment and then these are the ingress rules pretty much that i added um because without them then we would just hit their we which actually we can see one of the things that i noticed when you were doing uh that you had to expose the path for each of the unique endpoints so image images um image hub for the signalr stuff so why is that like why do we need why can't we just say yeah all paths should work for 2080. well because so we're routing from root to the web app okay but then routing i think i guess we could probably come up with a different regex to handle this but for me since i was testing individually because um i was looking at the network i was expecting the network and i was inspecting the network and seeing what um what was failing i saw that this one was failing and i saw that this one was failing and then i just so i just added and i felt like it would be easier to just add these go so you're saying path path could be a regex yes okay interesting okay you shouldn't need those three rows i don't think for the second one for the second set yeah so it's kind of like you know i mean i know it's blazer but i see the javascript yeah that makes sense and i've hit this a million times where you're like why isn't this working and then you're like oh shoot this is by the way from the cluster it's coming from the browser yeah this is this is why i am dubious about the way to do this like i would probably have a back end that was the back end for the front end that was proxying stuff to the back end because the issue is that you end up having to turn on course yeah coors is a nightmare yeah and you basically have two two web servers right the the engine is hosting the blazer client side assembly the client um yeah web assembly and then the back end yeah this makes sense now yeah i just for cores i just enabled all all clients all i think that's what we all do [Laughter] and then of course if it was a real app and we go to production we forget to take that out you know of course have the necessary routes that we need and then this config map changes the api endpoint well it basically replaces the app settings json file which i'll show you the volume out in the deployment um with the local hosts node port that we set in here um and then the oh actually i have not mounted yet i need to mount that i was going to show that failing do you want to see it failing and then adding it and then it working sure so we just apply this it always makes me feel better v when it fails and then all sudden it works you're like oh yeah so is it pretty standard that everybody creates an alias for cube cuddle to k oh yeah uh yeah i did right away that's how i knew v was a pro yeah i never do i'm a noob still i typed it like twice and i was like okay i'm done it's good to see this i mean it's actually fun watching someone else used to brunettes because like the whole reason we're working on ty is to simplify a bunch of these flows and it it this makes it more evident why it has to be done i think it's trying to go to uh docker hub it looks like did acr or or acr instead of loc local yeah um interesting what case is this is this like mini coo yeah doctor i see that i've literally never i've never turned this on not once yeah oh it's pretty awesome actually all i use actually yeah it's really good i don't i don't believe you especially with the wso2 integration yeah especially that's true i mean i'm on i might kind of i switch between mac and windows a lot but yeah on mac it works phenomenal but now that windows has wsl too it's like amazing with linux yeah so one of the things i did have to do was change the pull policy to uh never yeah i've had to do that never well if not present right or yeah if not present i guess either i put it on never because i you know that was what worked but if not present so yeah that's the normal one if not present this is also something i had to google as well as it was just not working locally and so i had to i had to set this yeah go through and set all these um so if not present it'll first look locally and then you know if if it's not there we'll pull it you just have to make sure they're there i think the default is always for um yeah yeah i think you're right this is crazy hard this is just like reinforcing everything we're doing yeah my whole kubernetes experience was not enjoyable no you know and until you until you get the uh like i saw v did she didn't describe it that's how i know she's done this quite a bit she did the uh k describe to debug the command you know and it's like until you know some of those things it's really hard at first but yeah so this is that failing mm-hmm so we reload and should fail here and this is because it's trying to go here gotcha yeah and so then we um add the the volume well first we should just create the volume then we'll show how we mounted it what's in the volume so the volume the config yeah it will just be the app settings um file so i have i'm looking at a sheet next to me because yeah i was gonna say if you're doing this for memory i'm really impressed no definitely not otherwise i would you know copy based on somewhere yeah this type of stuff i always have to go look up so this path is set in the container uh when i create the container i push to you know var dub web oops yep i'm looking i'm doing this that's the mount this is so this is the config map and then the name of the config map is settings and then we mount it so is the is the k apply smart enough to know that i need this config map web settings and therefore i have a dependency on it therefore i'm going to make that available you know like in terraform if you reference something else it'll automatically build up the dependency chain yeah i know no it's not that smart i don't think it'll do that you that's where you that dash f comes in you know for the folder um and yeah that's what i mean like even though you're pointing it to the folder like it has to process web dash config map first before this right oh uh no it it doesn't do that it'll make sure they're loaded though does it yes yeah sure yeah you don't have to worry about order when you do well command i guess the thing is the application so like all this is doing is updating it's updating the database on this on the api server on kubernetes right that's nothing nothing happens until it actually runs that's exactly that's why the order i guess doesn't matter probably yeah yeah because terraform is all client-side so it has to have to do ordering yeah so i wouldn't have figured this out like how to do the volume mods would kind of i spent too many hours on volume mounts like to actually know when to use sub path and all of that was pretty confusing uh volume is by far i don't know v what you think but they're in my opinion the most difficult part of kubernetes in general is just there's so many of them it's crazy um now one thing i wanted to point out real quick can you go to that config map real quick uh v which one this one uh yeah so just in case anyone's watching and wondering what the heck see that pipe thing on line six there pipe dash and then notice how the key is actually it there's two ways you can do this you can do key value pairs or you can have it loaded like a file and that's what this is doing is kind of like a file so if you can go back to your uh deployment now so that will overwrite anything that's in that file yeah so see the mount path that she did it's kind of weird there's two ways to do it though so you have volume way and then you have um just kind of an in-memory key value way yep and so this is actually how you do it with the value of the value so question isn't that easier to use a value to just set an environment variable so i my opinion is it is but we have to um you need that file yeah we need to replace this file for that i think so for the web app because uh could can you can blazer read from environment variables from the client so so here's the question isn't blizzard getting that environment no i guess it's like isn't i see the file gets actually sent to the client yeah you're right it in it would be wonderful if it could read environment variables because i got hung up on that for a bit no this is this is wise i'm so after that please yeah download that stuff from the server side before it runs another benefit that you'll find with this approach is you can change the file and as long as your app is able to pick up the file change you're good but if you do the other way that you know and you change the config map your environment variables in the container won't pick up that change so that's another kind of difference you need so there is a caveat to that that is true if you are mounting the um config map to a directory but since we're mounting the file itself we have to actually um either redeploy or just delete the pod so that it reloads oh you're right in that case yep yep that's true so i think i saved this and we can go back and reapply and um because if we didn't get like a yaml validation error i'm gonna say yes oh uh which reminds me uh have you used octant o c t a n t i found it yesterday oh cool it loads nice nice then we can try adding randomly octant is a a web ui to kubernetes um it is amazing like yesterday open dashboard right yeah when v when i was debugging with v yesterday and she's like hey have you done describe blah blah blah i was like no but i'm going to load the web app and it just you can drill down into the pod and just see it real quick um actually um let me just nice i'm looking at the website now yeah octant.dev yeah yeah um the vmware team that builds like kubernetes tooling um they built this tool and it's a client-side tool to basically like minus kubernetes octane yeah the visualizer and manager um learn something every day i like it yeah it's it's going to be my go-to and i you know i i did i was working with kubernetes for maybe you know two three weeks and hadn't heard of this and i saw a tweet from somebody you know talking about it um but yeah like just having to navigate all of those cli commands with like okay what is pod what is describe what is logs what is whatever uh it just it's kind of overwhelming you know i don't know like cli command overload or whatever yeah you can see you can like drill down workloads and then pods um yeah did you use the kubernetes dashboard and just didn't like that is there a kubernetes dashboard yeah yes okay it comes with it's comes with cool yeah let's just i haven't seen it but definitely runs client side the dashboard runs in the cluster oh so you can't even access it from from your local machine no you you can if you run our magic command that does all the the port forwarding and launches are browsing for you yep got it nice dan have you used this i have not uh yes the dashboard to be honest i don't use it i i normally go uh you know if you want to really go all out you do like prometheus with grafana um and i'll do that typically because grafana has amazing dashboards like out of the box that'll give you everything that you want everyone to know way more than you want to know about your pods gotcha okay but to be clear this thing is both it's both for those kinds of things but it also lets you like remote into the pod uh view logs um kill pods restart pods scale the octant one does as well or you're saying the dashboard the dashboard both yeah both if i already have the dashboard why do i need octane sorry the dashboard doesn't come with kubernetes locally as far as i know it does come in the cloud version so so aks has the dashboard installed already right yeah gotcha gotcha okay so yeah it was a bit more work i actually yeah i do remember seeing this and it was like wall of text do all of this stuff and then i found octan i was like okay all you do is just run octane it just works they must just be under the covers calling those cliers well in getting the security thing set up for the dashboard right can be a little tricky too you got to set up the r back stuff and yeah lots of fun so we got it all running locally congrats right uh now we want to bring it up to azure and so i think you asked me to give a little bit of an overview of what aks is yeah that'd be good but aks is pretty much um a managed kubernetes service and so the control plane is completely managed by azure and that takes away having to have the responsibility of manage of managing that um bit of it what you do have to manage are the agent nodes themselves um because that's what you'll be deploying on and primarily be working with um so when you deploy which i'll this is the command i ran i use the azure cli usually when i'm interacting with azure um and i just sorry one thing question um so before aks people just spun up their own vms and just ran kubernetes on a vm good luck yeah well there's some like is that what they did though like you know how hard it is to set up kubernetes locally yourself yeah super hard but yeah you got to do yeah well we used to joke back in the day that you had to have a phd in kubernetes to set up kubernetes you know it was cube adm now is the kind of the go-to and it's a lot better but yeah aks is amazing compared to what the old way was so just don't even look into it and so actually aks under the hood uses aks engine but you can also use aks engine um so that you can have the ability to manage your own control plane but if you don't want that overhead then aks is usually what people don't show and so for this azure cli did you have to install anything special or is the aks just a command module or whatever that's already installed yeah it should be already installed got it um yeah and so i just created a really simple the simplest basic default version which i can show um when you create an aks cluster a secondary resource group is created and this is where your agent nodes and other cluster specific resources reside but then in the resource group that you deployed the cluster to is just this one resource so that you can manage other resources if you had to as a whole so right now in here as a default the cluster uses virtual machine scale sets which allows you to really easily scale your nodes um and i think there's two or three as a default are the nodes so how many nodes run on a vm um well one vm is one node okay yes and is there a base image that aks uses so for example i know like some vms startup faster than others like do you know what that base image is they do have actually so don't quote me on this i know that they have one for linux and then they were also working on one for windows um or or the opposite they had one for windows and they're working one for linux and can you change it you cannot change it okay not right now anyway okay i don't know if they're planning on making that gotcha hard to guarantee it when people are randomly popping in vm's skill sets i mean vm scales yeah okay got it and can i ask you a quick question v um so in the window on the windows containers like say i wanted to run i don't know iis or something that now i know you can run you can join windows containers into uh kubernetes cluster it's a if i remember it's fairly recent they added that is that something aks does or has it done that where you can run linux and windows containers yes it can now and you can add or there is um if you able to add nodes or add windows nodes onto your cluster then you'll need to configure aks with windows credentials at the beginning actually they might to change that but when they first allowed that then you needed to describe your windows credentials for those vms but um once you describe them then you should be able to add and remove windows nodes just the same as linux nodes okay that's awesome because uh there's been multiple companies before my new jump to microsoft that was kind of a big hindrance from using aks because they needed to run they wanted to move some of their legacy apps you know kubernetes so it sounds like we can now so that's cool awesome so um in order to get or yeah easily connect to your cluster you run this get credentials command uh aks get the essentials give it the name and the resource group and that merges the uh cluster context to your working contest current context and so we do i get nodes now i should be able to see the aks nodes so so does it so it changes your current context to your aks context but leaves your local context alone right yeah it just adds it to this file and you don't have to switch to it right if you run this command it's pretty much doing this which can show you if you want to go back you switch context to default or whatever so you can list your contacts here this is that location okay got it cluster and this is the online and then if you want to change you just say use context and give it the name um cool so we don't have anything running right now um but what i did do was deploy an nginx controller and i just used the helm install the next okay go ahead when do we install home oh i have it so first you install helm and then you install the nginx deployment or the chart i should say and i did this because in our local development or local environment we use this bare metal deployment and so and this uses the node port which allows us to access it from our host and so using this chart it uses a load balance type of service i got a question for you one thing um so a couple of new things that i'm seeing um the dash n i believe means namespace right yes and can can you tell me like teach me about that like why why name spaces okay yeah so namespace really is just psychological logical isolation and you can further um isolate if you wanted to based on namespace but you'll have to do all of that manually but the reason that people use namespace um is to kind of well either to separate the different um logical components so in this case we have the controller um the nginx controller as its own thing and i don't want it to be um coexisting with the other resources because once i start deploying things i can easily delete a namespace create a new namespace and things like that and so this is a constant thing and so i just rather have it in its own right so kind of what what i'm mapping it to mentally is kind of like a resource group where it's like a logical group yeah as far as azure goes okay and then i actually haven't installed helm at all like i haven't even used it um i've heard it's like some sort of package manager for kubernetes um is that pretty much right yep yeah so actually in one of our conversations you were talking about um how we would go from using these or it was the opposite because my pr actually had my docker repo in it but how it would go from the docker repo to local and vice versa and so these images as we'll see or not these won't will probably get an error image pull because um this part doesn't exist and so i do have them pushed to my docker repo and so i'd go in here and i'd have to change each and every one of them but if i had like something like a helm chart then uh i wish i had one i can show you but you would be able to just change one file one location and it'll template out the yaml for you yeah that was actually one of the things i looked at immediately was how to template you know templatize basically these animals and it doesn't look like you know that's easily uh discoverable as well um you know how to how do you go to say you know put a different uh you know acr url in front of this um go ahead there's a thing um what's it called it's a coop control someone tell me what it is customize customize right there so it's called a helm chart not a package okay not manifest gotcha is is the chart the actual yeah the chart the chart is the manifest right yes gotcha so there's a bunch of things that you can um describe but this is generally the structure of a chart so you usually have a directory with the chart with whatever chart you're trying to temp create a template for and so in these values is where you can specify different custom values so here you can specify the repo like change of the repository here and the way that it does that is in here and if you look in the templates this is actually all of the yaml that is created um depending on certain things so there i bet you if we look at certain things they'll have a condition on it so this is only created if you have admissions webhook enabled um and let's see you can do like deployment here this is i think enabled up by default and the image you can concatenate different values together to create the actually the actual image um but yeah so this is just the syntax of helm templating cool thank you okay so i deployed that it was the service type was load balancer which if you create an azure it creates a load balancer for you um in your cluster resource group so actually i'm going to refresh this cluster resource group how do you get here again i forget um so yeah yeah this is the resource group i deployed to and then it just creates one prefix i see the research group the cluster name and then the region and it made show me it made um vm skill sets and a virtual network public ip address two of them i see one for the dashboard maybe or the api server and then one for yes kubernetes got it well this one is the one that i think we just created i'm learning azure i'm actually not sure what this one is for my guess is the api server because one because one is for like coupe control to even work with your kubernetes cluster this one uh yeah you know what it's framed ingress right i see yeah but okay so and also this route table i think is created specifically because um it's using the azure networking uh interface or yes is the default but you can specify different networking interfaces if you wanted to that's the default and so if we go here now with just the nginx deployment we're hitting the default backend which comes default which is what we want to see at least we're hitting this correctly and so if i go in here i want to basically not deploy this because we already have something nginx there for us but we still want to create these rules and everything is pretty much the same except for this so we'll want to change this to because this is the endpoint public endpoint of our ndx controller so how does it know to go to the port though you know the api port or yeah the api port uh yeah so in these pads we specify the service port that we're expecting it on so they're all hitting kind of the same ip but then it's translated to that port it's forwarded to this service at this point great yeah cool now because we're our context has changed this is going to point it to aks okay yep so we're getting that image pulled back off because we have those images don't exist and so i'll change it to my my public repo which i have these images pushed to gotcha and and so it's yeah okay so my normal process probably would be do a docker build push to uh docker compose build or whatever push to acr and then deploy or then apply cube cube cuddle apply so it would pick up those latest images okay it'd be interesting to see what the you know the cd pipeline for kubernetes project i mean that's not you know not something we need to cover today or whatever but you know to say you know let's say we have this all set up i mean it's you know auto github or some repo and we want to automatically deploy changes to an environment you know just that kind of workflow is kind of i think probably the next step is what i'll explore yeah and one thing to note is that this is um considered this is not considered best practice and to just leave it as latest all the time we'll actually want to specify an exact image tag here so that you're you know remaining consistent and not pulling the latest which could be anything okay which means you need more tools like helm right yeah so that you can or i mean if you're using customizing you can just change the value in the customize cell yeah you gotta generate a version somehow and like ugh yeah i usually use i'm old fashioned i have a powershell script or a sh script i use and it gets the job done you know i have to pipe it so i have to run the command and then pipe the output to the apply command but it works i gotta say like watching this this is this is extremely painful just like the amount of stuff we have to be that has to be done to make this run um i agree it's kind of insane yeah it's involved not for the faint of heart [Music] but once you have it all there and then it's pretty pretty and that's like i guess that's why it's so important to have your ci cd in place yeah i was literally just gonna say that without cacd you're kind of dead in the water the thing is like once you have a cluster set up ready with ingress so i guess some of this was was setting up the cluster to begin with if you have a cluster and you have ingress and you're adding services and that bad issue is like when you're bringing the whole thing up it you have to add so much stuff and one thing that occurs to me now is that your local dev kubernetes manifest it can't be the same as your remote one that's kind of a blocker it feels like yeah also think about i mean every single day of like me over the past couple weeks has gone through this right they've felt this pain exactly like i felt so yeah tight solves all these problems i mean it isn't the the panacea obviously but like it makes most of this ping away yeah so so let's let's celebrate we got this on aks it looks like it's all working it's a question did we put the ip address in the config file is that what we did and this is the ip address of the ingress right cool now um um let's say i make a change and i want to you know run that in kubernetes again i need to i need to now like build my containers apply uh my deployment well first of all change it the context back to local if i want to debug local um remove that vita tag uh you know all of this stuff just to do a single change right um [Music] well yeah i guess there are ways to to solve that is you can have a directory for your dev your local you can have a directory for your for your prod um and that's actually how you can solve that with customize actually so in in in and dan talks about this thing called scaffold which it seems like helps with that local inner loop and david is working on this project called thai um so i i would you know i want to spend at least just like a couple minutes talking about each of those just because i feel like i'm going to be doing that a lot within a couple weeks and i selfishly want to learn um but also i think it's a it's a good part of the debt cycle at least the inner loop debt cycle so the other thing yeah two just wanted to throw this out there is like um adopting the get ops model for first the icd which basically uses the get ops um i mean the github or repo as the source of truth and you have an opera clusters whether that be a dev or prod or a local cluster that continuously checks a repo and so for this this is just an example i have a dev and a prod environment that i want and i currently just imagine that there is a operator running on a prod instance that's pointed to this directory and then i have an operator running on a dev cluster pointing to this directory and um this kind of uses um the helm operator but just ignore that for now and just consider these just regular dmls that you're used to this could just be regular yellow that you're used to and in the prod customization i'm just like well i don't really want to change anything in the base just do it as is in the dev one i want to also deploy an nginx controller that has this stuff but also instead of you like you like renamed it to tmp or whatever exactly okay interesting and then you can also patch any of these yamls with so right now i have a different reference to a chart but you can um do a different image tag or a different image so one question about um about this i always wanted to ask someone um do you check hard versions into this thing so you check in specific versions right of the images um so yes to different branches i mean there's a bunch of different uh workflows that you can do but yeah we have so so the flaw is that somebody checks first control source code a new version gets produced on on the container registry and then somebody updates this file something some process will say like i have version 10 now put a version 10 somewhere check it into this this repo and then something else we'll run on coupe control apply this or help yeah or helm install this into cluster control so you're actually checking hard values like for the specific deployment in source control um yes i mean yeah and then you don't store any sensitive information i think i mean except for secrets yeah yeah can i ask a question real quick to v you mentioned uh the operator is that one that like your group wrote or you wrote or is there one out there that automatically can check because that's interesting i haven't i hadn't heard of that approach before yeah this the flux operator um by weaveworks is actually the one that people use the most and um yeah it's a cn cf sandbox project and it has a lot of contributors to it and people have been using it more and more these days um so this is the one that i use i'm talking about um and i can send yeah very nice okay yeah operators are one of those still mysterious to me things um i see the value for like setting up you know you want to shard a mongodb database for example and you could just install their operator i get that but now i'm going oh that's kind of cool you can do what you mentioned okay excellent thanks dan do you want to just give us the the the pitch on scaffold yeah sure um i actually have one up and running here so be pretty quick to show while they're getting set up i just wanted to take a quick moment to ask you to give a like comment subscribe if you like what you're seeing thanks a lot let's get back to it yeah so the idea with scaffold is and i'm interested with what david's going to show because it might really nicely tie into this i suspect but you know if you're building for instance a lot of microservices and you kind of need that in a kubernetes environment to get these services running like they really should be running the challenge is now if you're developing your app against those you either a do a lot of port forwarding because as we talked about earlier everything would be a cluster ip by default and you'd have to set that up and that's kind of a pain but the other problem is you know if i come in and i'll just do a real simple example here and here's the uh index.razer which is the kind of home page we've been looking at and i changed this to you know azure demo two well now i have to you know from the docker file here this is a an alpine nginx alpine image now i have to go through the publish process rebuild everything and you know that takes a little bit of time especially on these front end projects where you're pulling like packages down angular react view stuff like that and so the idea with scaffold um you can go to scaffold.dev and you can run a scaffolding knit command i'll go to the get started here and i'll just show you if we go to working with scaffold so only a handful of commands scaffold and knit you can basically point it at your project and the docker files and things that are there it can generate this yaml file that i'll show you in a moment uh it it's okay i tend to just do what v mentioned earlier i have some files and i just copy paste tweak it's almost easier i think um but that that's what that is now the next one is this scaffold dev which i'm going to show here real quick um in fact i already am running it that will do a couple things so first off once you have this scaffold yet another yaml file right yeah you have all those kubernetes ones you know you have docker compose and all that stuff this is kind of what it looks like it's a real simple file now it it does support a lot of different builds though um i won't go into it but if you go into i'd have to find it in here they i think it's down to references they have a pretty robust um schema and so like i'm doing the docker you'll see right here but they do basil and ones i've never heard of and stuff like that so it's pretty robust that way but the idea is that if i'm a dev and i am now let's say coming into this you know razor page which ultimately needs to go into a container it'd be kind of cool if i could just save and then watch down here in my terminal um see how it picked up the change and now it's redeploying just the kind of delta if you will that's needed only that one container not all of them yeah exactly so instead of running docker compose up yep i just run scaffold dev and it's pretty much doing this exactly you know normally you'd have to either go down or you'd have to stop and remove that one container because you got a new image i mean there's you know there's a lot to it so you're saying like i probably don't even need docker compose at this point for this it kind of depends on where you want to run things if you're going to run in now i'm on docker desktop and i have the you know just real quick here uh if we go to preferences i have the kubernetes there's just a checkbox you can check you know which you've already seen i know john um so i have that enabled um i'm not in the experimental experimental now has 118 i noticed but this image i'm not or this machine i'm not once that's enabled if i just wanted containers running then i would say docker compose is fine because there is some knowledge you have to have with scaffold about you'll notice right here at the bottom right it's pointing to your you know what v just went through all the yaml so it's not like you could just use this and then go yeah i don't have to know kubernetes because at some point you're probably going to hop over and do uh you know a get all or something into a deep i guess situation right but what's nice about it is it will automatically sync up and then i didn't add it here i put a quick github link so this project i could have done it for this one too that what you'll find though is if you change a file like in for instance a react or an angular front-end type app and if your docker file is building a production image then it has to re-pull all the packages and now you're looking at you know what three to four minutes in some cases to build that image not a good dev experience right yeah so what you can do there is they also have this this sync functionality i mentioned this in the chat last night that i wouldn't have time to do i got this going like 10 o'clock last night yeah um but what it'll do is it'll monitor the dist folder which in this case this is an angular app and anytime that changes it'll automatically um only deal with that particular path in the container so it's basically a way to sync the files without having to totally rebuild the image no did you have to do you have to change your docker file at that point to say like mount the uh you know local folder or anything no okay no no changes there it just does some mat it's a little bit of sleight of hand magic i'll admit um that they're doing so that's cool yeah like you see right there all of your node uh you know your node packages node modules all of that doesn't need to be recopied exactly because that'll just kill you if you're trying to do live development against that i mean you like your boss would be like what are you doing i'm getting another coffee you know yeah because i'm building five minutes right yeah okay gotcha so um the idea here is all you have to do though you'll see in the artifacts is you give it the image and this is of course a local image in this case uh context is just your root folder and then here's the docker files that uh john i'm guessing you created yeah so all i did literally was i went and side by side looked at what you had in the docker compose i copy and pasted a scaffold file i had and then i just tweaked these items here and then i pointed to your uh manifests that are up here that v went through so it's using the instead of the emv file it's using the config the kubernetes config right yeah yeah so this is using the config maps yeah this it's also in a nutshell it's all kubernetes on my desktop yep but with the power to leave the like for instance if let's say david did you know 15 micro services yeah and i'm just worried about the web app part well now i don't have to worry about redeploying everything take it all down bring it back up i can just work on my one part and you know let me do one more i'll save and then it'll it'll detect that and we're done it's like literally it's that fast yeah no that's great i mean that would even on my little project that that change would take minutes yeah yeah because in docker compose you're gonna stop and start everything pretty much i mean i could just run one container and i'll do all that but okay yeah that's cool yeah so in a nutshell uh that's scaffold and you know there's a lot more you can do of course but that's the nutshell version nice yeah thanks does that so i know you said you're you're using using the local cluster right now but does it work for clusters in the cloud you know i that is a good i it's funny to say that v because earlier i was going i wonder if this would work with aks because it'd be cool to hook up to what you had you know uh i don't know the answer that i haven't tried that the only thing i guess i'd worry about is there will be times when it does have to re-build and push the image right and you know it would just come down to how fast i guess your network latency is there but i'll tell you what while david's going i'll see if i can find info on that david you want to jump into thai and see what that's about while they're getting set up i just wanted to take a quick moment to ask you to give a like comment subscribe if you like what you're seeing thanks a lot let's get back to it the inception of the title was about trying to basically after me after i learned kubernetes um me and ryan nowak on the internet team who has now changed teams um we kind of played with it and said you know there's a lot of of boilerplate that you kind of have to learn to get something simple going so the intent was how could we basically make you go from donetco to kubernetes as fast as possible um so we ended up doing was making this tool that basically um had a local dev experience and then had a way to deploy to kubernetes without having to understand or learn kubernetes um at least that was the intent right so i have an app here it's called front-end back-end um the front-end is a simple ethernet core project it has um it's a simple application it has a route it prints a bunch of information it calls the back end so front end it is an app it calls the backend application back-end just returns um some information about ip and stuff over json um so very simple all right um if you if you were to run this locally by hand what you do is you would launch two consoles you would run two applications you would pass the ip of the back end to the front end manually via configuration so we basically said what if we just made all of that automatic and we had conventions for flowing config from one up to a different app and we had a way to run multiple applications so thai actually does support running apps without um by default if i tie ignore ignore the yaml for now if i tie run what i get is a local experience so it builds the application it builds a project it understands.net it runs the project and it gives you a local dashboard for viewing the application so if i open up this dash this and this address you'll see i have two services one front and one back-end and a bunch of urls so when running locally the other super annoying part is port conflicts right um when when you're in containers it's it's easier because they have their own space but you still have to map the container port to your local machines port and that is like conflict hell right yeah so thai tries to basically automate this for you and and generate random non-conflicting ports so you can hit your endpoints so here's my back end here's my front end it's running close the back-end api here are the logs free service and you also have metrics so i can look at the back end and see like dot-net performance counters essentially yeah um so you get an experience right where you're like kubernetes but you don't have to actually coding as kubernetes um so that's like step zero um so i just point so i just point it to my cs project files yeah and just do just run tie yep tie around so you you can point to a project or a solution and if you need more control you can actually create a tiamo because if you run tight in it so tie itself is a command line tool there's tighten it tight run type build type push tight deploy tight on deploy right um so you can init to create this manifest the manifest by default has um points to your project so it it'll read the solution file and and gen is for you i can also add things like containers so say i had a front end a back backhand and redis i could add here like you know name is redis image redis and it would run redis right locally i could even expose bindings this is basically a think of it as a compose file but it understands projects natively and it has more conventions that are kubernetes like so for example um just now when i made this application with front and back end somehow the front end found the back end's address even though the port is gen randomly how does that work right so normally in kubernetes everything in the same name space can access each other via via dns so to mimic that what we did was we added this super lightweight extension method says net course configuration that that is get service uri and all it does is it reads environment variables via convention that type passes into the to the orchestra to the application on launch that says when you launch these services here's the backend here's the front and here's the worker here's redis so application code can just call get service uri redis and it will resolve the right um ports and addresses locally and remotely all right so the intent is that you write this code once and it will and the the orchestration process will do the right thing to get the right addresses no matter where you run that's nice that's so much easier i mean i i could see it earlier while you're going yeah this is a lot of yammel it's a lot of stuff right yeah and and it gets much harder so for kubernetes what ended up happening was you end up having to author a docker file and a coupe manifest and then you have to build locally build containers locally push somewhere and then like run right i said to myself like why couldn't we just run locally because normally in these environments people run their apps locally and then they deploy kubernetes it's only when when you hit a certain size limit or or or you can't test your app locally because you need so many uh so many other services to run that maybe that doesn't scale right but for for a good majority of people that only need to test their part of the application when running in a bunch of these um scenarios you run your apps locally in a debugger with your tools you want to use the tools that you love and learn the whole time right while dabbing um and then when you're finished and you want to deploy you can you can type tie deploy um dash i is interactive so so it'll prompt me for for input if it needs stuff and the intent here is that the intent here is that it'll generate for you a docker file it'll build your image it'll push to docker hub or acr it will genicube manifest and it will control apply to your current context impressively so it basically generates the docker file the manifest um and it run it it infers a bunch of those be those um settings from your project because it knows the base image because if you're done a core 3.0 guess what we know the image is docker hub blah blah blah 3.0 right so so do you do this do you support blazer yet uh not and someone complained about this not working in a first-class way um i complain um yeah yeah i mean the vs code right now uh docker file gen for blazers broken um for sure um it just it basically generates um a a blazer uh servicenow right yeah yeah yeah yeah uh so i did a whole analysis and sent that to you know the blazer team and all that stuff uh but yeah so i was just thinking for my project um you know if i let's say i want to do my own docker file and there's a docker file in my project um will it honor that yeah so you you can control the docker image yourself if you want to you can you can specify an image a project a container sorry a docker file and we're adding support for azure functions soon um so the intent is that is this working this is like docker is so flaky sometimes hopefully it builds this is something that's discoverable right now like there's type yeah it is currently an experiment as part of dot net five so it's brand new and i'm just being built um we're pro we're transit to demo it at kucon just to show everyone what we're doing but the intent is to have a class of depth tools around this flow because everything else just just seemed like like much more work to be honest i agree like this i can get all my stuff up and like you said i could just debug right in my tool i don't have to worry about all the other stuff right yep nice does it have hot hot reloading like scaffold yeah so for local running you can tie around watch this is a brand new feature that we just just added okay um and it will basically watch your product watch it so this when you run locally you're not in kubernetes you're running on the machine with with a process with or with containers um and then when you deploy you're gonna find kubernetes so when i do ty run can i also at that point say i don't want to use you know that process i want to use or i want to use a container instead yeah you can do this okay type run docker and it will take your application and put it in the container and run it this was hanging on me just know so okay i gotta figure out through where it's failing just building um other cool examples that we have just in in the repo itself um here's an app that actually is the docker voting sample for cats and dogs so you show a voting screen to somebody you vote capture dollars it gets put into a a redis um list and then there's a background worker pulling the list and then um storing up bits and redis and the results page just just use this signal to show the results in in real time so i have like a voting sample it has the voting application it has redis and here's the port it has the worker um environment variables and then bindings for this for postgres so i love the uh string replacement stuff built in that's yeah it just works right yeah yep yep um yep yeah we have to do that for for stuff like this right um so yeah the the the intent is to make it like comp very much like dr compose but then you can take that experience all the way to deployment by having the same manifest um cool in in so can i run say on my local kubernetes cluster not aks you're saying i can right you can yeah and that's just the what is it deploy command yeah and it just does it honor the aks context yeah it does okay gotcha yep in in.net only right for this so it was madefor.net the the escape hatch is you can you can specify a docker file if you want to so for example like here's and this and this is very much like blazer where the angular app uses nginx um the front end has a container right here and genex npm build and npm install nginx and then the same thing right same idea um and we also have support for ingress so if you look at where is that ingress you can say like specify the ingress rules and we translate these rules into what you saw in in um in the cluster with the intent being that if you want to test that out that application flow locally you can just run this locally and it will spin up it tie itself will implement the ingress the ingress for you um but the intent being that it'll give you a real a real enough environment so you can verify these these rules um and then when you deploy it'll translate this into the right things so it works on on kubernetes so as an example of what it generates so you can see like here's an example right it just spits out a bunch of these things gotcha this is the gend yeah a service a deployment all the right labels and ties based on your service names it versions um it actually appends the version to the app based on your assembly name your assembly version so if you have code that versions your assembly based on like git git version yeah it'll pop that into the actual like container image and then put it in the manifest um it injects these environment variables into your application to basically do surface discovery between services so the front end has a has a um the back-end port and the back-end host right um yeah i mean after spending weeks with kubernetes now um i can definitely see a need for this yeah um i agree no joke yeah after spending years i agree [Laughter] like i i i'm i you know i'm just pulling my hair out constantly on what seems like mainline scenarios um that you know prevented me from building apps you know i'm stuck on some kubernetes thing for a week when i could have been building features and you know anything to take that away would be great i i think my my hypothesis of this whole thing was kubernetes was kind of built from the operation operator side where managing vms is hard i know everyone is trying to shrink it everyone's trying to take that big thing and shrink it for devs so there's mini coop there's uh coupe idiom there's all these things to kind of shrink onto that machine to make it work but there's so much friction and going from like your local that environment to that local kubernetes um yeah so tools like scaffold right try to solve it for you but by trying to automate more that flow but i do think like if you were gonna do if you're coming from first principles just run apps locally you just want to run more than one thing and then have that same topology work somewhere else so here's the thing like so all of my whole experience i went from building an app to docker compose to compose yeah to you know scaffold uh you know ak like all of that is basically replaced with tie right because i just build my apps and then run thai like i don't need docker compose i don't need compos and i don't need skype right yep that's so cool yeah i think next steps for me just do a reaction video like let's get i'm gonna you know get my you know just get my app running until and just see see if i can get it running what's uh david what's the uh you mentioned net five so is is it a go on this yet or is it still it won't be like it it won't be production ready in five but my guess is during six we'll end up having people work on it more so so now we're getting feedback we're basically like doing surveys doing um customer development with people who are using it and we have a bunch of customers consuming and giving us feedback um and then we'll do a report at the end and go like people this is needed basically very nice yeah if you if you need any feedback uh i'm more than willing to say this is needed [Laughter] yeah the same how do we would we be able to play with this yeah somehow okay i'm sorry it's actually open source so oh perfect let me show this sharing i'm not sure anymore right let me share my screen so uh github.net slash type um you can install it where's the thing documentation so i honestly when i looked at this yep i my first thought was oh great another yaml [Laughter] and it would be cool if there was if there was a three-minute you know demonstration of why this is good yep you know and maybe it's even just uh you know here's docker compose here's what i have to do now docker compose compost scaffold like all of that okay now what here's what that looks like i said the funniest thing during during our customer interviews was seeing the reaction of people who understood why this existed and then the the opposite reaction where people who were basically had their tool chain built already based on kubernetes and a bunch of their scripts and powershell and stuff and how they were kindly i kind of have a thing that is janky but it works which is what dan was saying he's got his he's got his stuff you know yeah this looks pretty well i just like the fact that you could just run the app normal and still bring everything up you know because that's that's really half the battle is i mean i guess in visual studio you could link up all the projects and set the start order and you know we've had that for forever but what you're doing takes it to the next level yeah here's here's my so so i maybe if i were to just start with ty like let's say i'm just getting into this and you pitch tied to me i'd be like yeah cool whatever but because i felt the pain you know i get it so how do we get customers to that point of you know understanding the pain not having to feel it per se that's interesting yeah um you know pulling their hair out for you know whatever and then and then lead them to something like this that's that's kind of what i think the gap anyway so no you're right you're right anyway so i yeah let's uh let me let me take a look at that for sure and i'll do a follow-up but yeah it's good to see both perspectives and to learn you know all the different tools and everything that we have to do i mean just the some big takeaways the helm thing something i'm going to learn about the templating customize prometheus and i think grafana all of that stuff is just you know i feel like these are just tools that are tacked on that because of the operator-centric kubernetes start that you know there's a ton of these open source things that kind of just that popped up because of that focus yeah and finding them knowing when to use which one all of that stuff um you know like i didn't even know all of these things exist before this call so it's good to you know it's good to do that i wonder is there a resource that lays everything out for people um you know with not just like a flat list of you know here's here's all of the kubernetes related things but more of you know a gradual progression you know like yeah here's here's how you get started here's the next step you know it could be a good list i'm not aware of one that does that approach because yeah in this field like if you ever say you're bored you're just not trying hard enough because there's so much like you said and yeah i haven't seen anything that walks you through that the rest of you know of anything it's a future dan pluralsight course yeah there you go there we go in the in the making okay cool um i definitely got out everything that i wanted to get out of this um experience so thank you all so much uh v for putting in the time uh all the upfront time to to get it all working and help me help me learn all this stuff listening to the different tools that was awesome yeah yeah thanks because without all the yaml and stuff we wouldn't be able to do much so expert yeah i'm well hacking right there [Laughter] you know dan and david thank you so much for joining uh your insights definitely appreciated and i i learned a ton so i appreciate it awesome thanks for having us thanks for putting this together john really cool yeah thanks john yep all right we'll talk to y'all soon all right all right yup you too bye
Info
Channel: Jon Gallant
Views: 992
Rating: undefined out of 5
Keywords: azure, kubernetes, dev, code, microsoft, kompose, skaffold, k8s, aks
Id: YkEl16UsuHA
Channel Id: undefined
Length: 100min 24sec (6024 seconds)
Published: Tue Jul 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.