[Cassandra Cloud-Native Workshop Series] - #5 Cassandra in Kubernetes NA|LATAM

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] [Music] and welcome everybody and we're going to get started here in just a moment but before we do that i wanted to give you a moment to just listen to this new edm track that we dropped last week from datasets accelerate this one is a database themed it's an original database based song and i'm actually going to drop it if you like somebody drop the link in the discord and the youtube chat and there are a couple different songs that are all database originals so just take a moment [Music] and well hello everybody how are you doing i got cedric here with me and hi everyone happy to be there i've also been joined by patrick mcfadden today our guest speaker mr mcfadden can you say hello everybody oh hello everyone i'm in the moon today what's going on patrick is officially in the moon and so welcome everybody to uh our cassandra workshop series week number five for cassandra and kubernetes so today we're gonna have all sorts of fun not you know if you think about in the past weeks what we've done um we've been building up this application and now we're going to change gears just a little bit right we're going to start putting our cassandra clusters in kubernetes this really hits on the cloud native way like using modern orchestration you know uh capabilities and stuff to be able to launch clusters um using something like kubernetes so we're going to do that today and then this is going to we're going to kind of continue on this theme for the next coming weeks so patrick patrick you came on here as a guest today you've got some things you want to say what do you what do you want to say to everybody what do i want to say what do you want to say this time yeah yeah no well i mean this is a big deal for the entire community right now we've been working on this quite a bit um over in the project um kubernetes and cassandra are definitely have a strong future together and with the operator project that we're working on there's a lot of operators out there but we want to do more inside of the project but there's also a lot of stuff that's happening in kubernetes which i'm pretty excited about um kubernetes has gotten to a place where it's pretty good for application infrastructure there's a a great community that's formed up i would recommend everyone checking out it's the data on kubernetes community um it's not a data stacks community it's a separate one but i we're you know doing a lot to support it um it's i think this is our the next big wave in kubernetes um kubernetes has uh has got a good establishment but man we could take it a lot further and so there's stuff happening um inside cncf uh kubecon is coming up here pretty soon it's a virtual event um i i'm doing a um a talk there there's going to be a couple other things that are going to be happening um this is a and i would really love it if everyone got involved in the community because this is where we do the best work is when we create stuff together awesome well thank you for that patrick and uh we will we will see maybe maybe patrick will show up again a little bit later uh during the stream and will i be in a moon well it depends it depends if you really want to be in the moon you know how about this if you want to see patrick on the moon again you guys can give us a bunch of thumbs up and we'll see if we get to see patrick in the movie again hold on hold on i don't know if i got to say this i'm sorry but jim prophet over on youtube just said scuff tom arnold yeah all right so here's a fun story um i actually was in the newark airport in new jersey and the gate agent at my airplane was convinced i was tom arnold and i could not tell her i wasn't and she tried to get me a first class seat um so that happened and i'm like i'm not tom arnold she's like of course you're not so thank you i appreciate that uh next time i travel first class i'll be thanking tom alright so with that why don't we go ahead and get into the material thank you patrick um we may see if he shows up again a little bit later if again if you all want to see him then you can kind of give us yeah give us some thumbs up and we'll bring patrick back put me in a cluster i'm containerized i can get deployed anywhere all right let's we'll move on see patrick we'll see you later bye alrighty so mr cedric why don't we go ahead and get started so um first thing here is if you can all see this screen and cedric you may have some comments about this um this is an image that that we added in to just gonna you know give you a feeling when you're when you're when you're deploying both yeah so we are going to do this today we are we are going to fly this this ship today uh we're going to do that all together and as usual we are supported by our whole cadre um of our advocate and community team i am david jones lardy and we have cedric lavone today and as usual though we have all of those folks that you see are actually down in the discord in the youtube chats who has no audio oh that was weird okay i didn't change anything are we we have audio again can you guys hear cedric all right well uh when you turned me off that i think that turned everything yeah guess what guess what patrick you're staying with us today all right it was because yes it was because of you this is you know this is what we call fail fast everybody um this is we we tried something new today and uh and it looks like that caused a little bit of a hiccup but now patrick you're just gonna be with us today so there you go all right can you guys hear patrick and cedric can i oh you're just close to me per trick actually yeah i'm not audible what about now okay so betina says good okay good we're in so we're just gonna leave patrick here so patrick you have to be good today you have to be good i'm not doing anything to see here all right so let's go ahead and move on so i don't feel comfortable now that's awesome yeah i'm sorry i put them so close to you guys all right so this title yeah this side i guess all right so so at this point you're probably pretty familiar with our structure if you've been following along with us during the series where we're going to have some housekeeping that we start off with and then we're going to jump into some of the the fun with kubernetes and cedric is going to bring you through all of of that material and and as we get a little bit further into that we're going to have some fun by doing this stuff live so a bunch of you have requested cloud instances where the alex and team have actually created these for you where you can go and experiment with this with us and then i'm also going to be doing the stuff live with you and we'll we'll talk a little bit more about what all that looks like and then the last part there as we start to spin up our cassandra clusters in kubernetes we're going to go one step further and we're going to integrate it with grafana and prometheus to give you real-time visual dashboards to be able to report on the health of your cluster all there in your kubernetes cluster we're going to do this all today so this is like totally exciting um so with that as usual um you know if i'm assuming right now you're either watching us on youtube or twitch those are our two streams um we are we do prefer to answer questions in discord we can have a much better chat experience there but we're also going to feel things on youtube as well um so those are the two places that you can talk to us today is going to be mostly either on your local machine uh if you follow along with me in the repository or you can just watch as i go through things and do this on your own as homework later or for those of you that have the cloud instances we'll be using those as well okay so first thing let's go into mentee so if you could please go to mentee.com and the code will be 58.55 i'm going to go ahead and start this up don't mind if you see me do something behind the scenes i should have done earlier there we go all right let's go ahead yeah 58 code yes i see all the thumbs up so yes please give me those thumbs up so we know uh that everybody's there and while we're waiting for that by the way um some folks mention that we're really small today that's true part of the feedback we've noticed that you know sometimes we block the material and so we purposely kind of size it today so yes we're very small but we did it so we can actually fit in the material um so if it's too small give us that feedback too we'll we'll figure it out yes it's only a four digit code today 58.55 yes for the dude all right i'll get a couple more going and yes the application 90 meter is free all right yes it is yeah mentee is free we're not gonna we don't charge you for any of the stuff or put you in a paywall or anything like that all right now it's open source i did try to uh position myself so everybody can see the thumbs up this time all right let's go ahead and go into the first survey question and which where are you in the workshop series let that fill up a little bit oh yeah we have a good set of people who have completed all four weeks all right nice look at that that's a strong showing awesome nice wow that's great i i hope everyone is taking advantage of it too because this is the whole point we want you to learn something you know and by the way for those who are still working on you know week one two or three that's okay i mean this stuff has been built to be pretty much self-service go at your own pace um and all of the videos everything that we do here live is always recorded and is on the youtube channel you can watch it at your leisure at any time all right so thank you for that binge watching watch all the weeks all saturday [Laughter] all right go to the next one how much experience with docker oh so we have some folks who've never heard about it no never used that's a good chunk right there yeah yeah i'm not that yeah not that many people use dog everyday oh you're gonna love this then yeah yeah this is gonna be like the best kept secret you've never heard of yeah i couldn't agree more actually all right good i once i learned about docker i did that's exactly you know to that point patrick um i don't think i used to i would just go find systems install them do vms whatever i don't use them anymore since i i run my whole home automation network now all right so i think that gives a pretty good idea so it sounds like the majority of folks here really haven't had much experience with docker so we're gonna have fun with that all right let's go into the next one there we go and then how much experience with kubernetes i have a hunch if we have a lot of folks that don't have a lot of experience with docker um i wonder what this one's gonna look like i expect this to be low yes k-8 uh vj yes k-8 equals kubernetes thank you for pointing that out it looks like um yeah we will explain that in a minute but yeah k-8s uh pronounce k-tes oh is it pronounced katis that was kate's like kate's kates i just think yeah i do say the word i i i just yeah okay so this isn't surprising right you know it looks like again we have most of folks who are maybe familiar with it but they haven't used it or anything you are going to get a crash course today let me tell you um you know in a matter of fact for those who are using it every day in production and use it regularly for dev um i think it would be really cool if you kind of you know if you if you have any applications that you want to share or things you want to talk about drop in the discord tell us about it let's let's see what you're doing all right let's go to the next one and then especially that very small sliver of you who say they're actually using it in production or dev now we've been a little surprised uh we've noticed that we have more windows users um uh in the series than i think we originally anticipated so we do have more people asking questions yeah we have a lot of folks asking questions on windows [Music] and there we go let these numbers come in this means bill gates one that's just you know yeah so it's it's probably balance uh so we had a question um will we get enzone of course oh yeah especially today alf the time is undone oh and you know um skivus makes a real good point said oh i should be multi-choice um funny enough i thought i had that as multi-choice but apparently not so yeah you're right it should be it should be that's it because i actually run linux in os 10. you're still running os 10 patrick seriously that's what everyone wants oh wait oh you know what i just did i just went i just went to the 90s you just showed what i just went we're just gonna move on let's move on alright thank you for the question what are you running on yeah yeah all right all right so thank you everybody for uh now stay in the mentee don't forget to stay in the mentee because later on we will have quiz fun and again you can win some fun swag so yes you do want to do that all right all about the swag yes all about the swag alrighty so with that let's get into some kubernetes basics and i will be quiet and let cedric take it from here yeah so let's do this and so the idea is me not to take it too much time so i will go to the basics just only what you need to get started do the end zone so we are doing uh virtual machine for ages and the idea was to simplify the development because if you have a template it's easy to deploy an existing application with all the parameters and all the binaries but with virtual machine you still have an issue look at that the operating system is still there so i think it's about 10 years ago came the containers originally it was called lxc so contact linux container that allow you to split processes in the linux to have dedicated process processes with his own cpu own resources network and with the same infrastructure you can do more than simply virtual machine and this is the reason why you may have heard already about containers or do that you can do more with the same infrastructures and containers are mature enough to still having a way to set up with fine granularity cpu network resources disk what you would like to limit for your app okay next slide can you go to nick yeah there is just some lag yeah yeah of course as usual okay so the most famous containers stack is tools is docker uh today we will use docker i think now it has win with the competition so in the docker environment first you do have a server with we we call docker daemond okay the docker demand have a rest api and you will interact with the docker api using docker command and docker command is simply a cali each time you type a command you send a post http request to the rest api and the server will start the container for you okay simple like that let's go to next slide for some more vocabularies more keywords all right so this one seemed to be complex it's not that much so i told you about templates uh right before well templates in the docker world are called images okay you will pull meaning download an existing image on a repository like a repository of libraries you may use when you develop java node python you tend to download libraries here you download images and then you ask docker to start the images in the engine and you will get a container so the container is really something running based on an image but the image itself is immutable okay today you will download image start using cassandra images we won't touch the image we simply start containers based on the image and i should say in the in the coming weeks i want to say next week uh when we're building more and working more with the application deploying that to kubernetes that we will create an image for that if i'm correct from what i've picked up from patina and team um so we'll we'll start to play with that a little bit next week directly yeah totally today we are shipping cassandra in containers and kubernetes next week we will ship the existing application in the same kubernetes cluster to have everything at the single place correct next slide patrick you should you should sing during the youtube like you have 20 seconds every time we are way too serious now okay all right yeah exactly yes all right all right so um cassandra is available as a docker image for you know again ages i mean for more than multiple years you can have cassandra in containers but then if you ask to run a container for cassandra you will do docker run and you need to provide quite a lot of parameters because cassandra is stateful obviously you need to store your data so not only you need to provide environment variables with dash e expose port to the outside using dash fee but also provide volume which is persistence uh close to the to the customer so it's quite a long command and the first tool you can use to implement is using what we call docker compose next slide all right so docker compose is the tool that will read a yaml file here you do have a yaml file and it will instantiate some containers based on the value so now you don't need to provide all the parameters in the command line you simply say docker compose up dash d and it will start everything but even here you can notice that even for a simple cassandra cluster with three nodes we need to make the distinction between cassandra seeds which are used to bootstrapping nodes remember week one ds201 you'll learn about that and regular cassandra nodes and so when you scale nodes or when you scale seed it's it's not behaving the same and also you will learn that there is the two minute rules before nodes you don't want to start all the node at the same time and this is the reason why in the command line four lines before the end we have introduced a slip we you know if i want to scale my essential node i will have to sleep 60 seconds then 190 seconds i need to wait between two nodes to bootstrap that's a custom hardwood so even with this very very small yaml file you might figure it out that deploying cassandra in a docker has a lot of rules and rules you need to know what i do first what i do next what i need to wait and so next slide kubernetes will be there to help okay so and so kubernetes is really just there is an open source very famous system for automating deployment scaling and management of containerized applications whoa what a big name what does it mean yeah maybe the next slide is better to understand what it does okay so not only is uh automating the containers deployment but it's handling a lot of things for you the purpose of kubernetes is really to deploy your wall infrastructure based on a state you provide again it's a yaml file you feed kubernetes with this yaml file and at each time kubernetes will check what is the current state of your system against what is the state you try to achieve and if if something missing cassandra customer creators will do what it takes to make that happen so if one of your container just failed and it's totally down and in your deployment file you expect to have three instances of your container kubernetes will detect that and will spawn a new one to replace and with this behavior in on the not only start and stop the containers but also do some service discovery load balancing cell feeding as i told you storage when containers need some volume then kubernetes with help to mount this volume and handle how it works not go back to the small details let's see under the hood what is kubernetes inspire structures so next slide please okay you know that's just an overview for now the idea is ready to provide you the keyword to to to understand how how it works so in kubernetes you do have a cluster it's a distributed system so what is your price so the cluster is kubernetes cluster so next there you will first have a master and for kubernetes the master is also called the kubernetes control plane and this master will provide a rest api oh that really sounds like docker engine providing also a rest api right and you would have one two multiple node or workers and this is what i i put there in green so if you go to next animation you should see that in my kubernetes cluster i do have control plane and node worker all right moving on to doodle okay so don't freak out i did not look okay i simply opened the control plane here so i told you about the state so etcd is a backing store where you will handle the state you do have the control manager with a eternal loop that will check what is deployed what is the expected state and will try to reconciliate and to reconciliate you will ask the scheduler to do stuff okay and on top of that you do have the rest api each time you as a human want to schedule something or start something you will execute a command with the cli called coup ctl and it will invoke the rest api and do some stuff i've opened the control plane now let's open the green box in the button next slide all right here it goes so now again it's not as complex as it might look i love how each level just goes deeper and deeper yeah you know boom boom and now i [Laughter] one to each other so the workers or node or even sometimes called minion are where you will run your uh application you can have one to multiple workers um something to notice we need one worker per cassandra node when we want to deploy cassandra i just told you that now we will come back soon with that so you will need multiple workers to run your customer cluster inside a cluster first you do have the couplet which is the node agent and the coup proxy that will use as a proxy between you between the node and the other node and also the control plane and it's also reflect the service in the kubernetes api so each time you want to do something you will invoke the rest api at the master and the master will use the coop proxy to interact with nodes okay this is how it works how it communicates then what about containers well inside a worker you would have one two multiple pod okay and a pod is a collection of container so some sometimes people just don't realize this they think that one container is one point no no no in one point you will have one two multiple containers and to be honest today you will have multiple containers inside the pod sod is a collection of containers that can run on a host okay it's created by clients and scaling into host alright i think i do have the vocabulary of the infrastructure let's move on and we are moving on with something more logical from physical infrastructure we are moving to logical infrastructures and this is the reason why we put master node at the bottom okay now you don't really have to know where is hosted which pod kubernetes will do the magic for you each time you ask to a pod to start kubernetes will figure it out on which worker it needs to be so incremental there are multiple namespace okay provide a scope for name and this is a way to trigger a command against all the resources inside the same domain the same namespace so today we will create a namespace and we will do all operation inside the namespace and when we are done we can totally drop the works the namespace and everything will be removed at the same time there are three default namespace when you start a blank new kubernetes cluster coup public default and group system and today we will work with cass dash operator so it has nothing to do with master and nodes we will simply ask we simply ask grant us to create the namespace and the name phase will live on all the pieces of that good cluster all right let's move on for second kind of primitive yeah that's really teaching in the beginning okay second part is all about storage remember i told you with the state full container you need volume because you need to save your data well in kubernetes this volume are called persistent volume you will first define a storage class which is some kind of the specification the definition of your disk do i want to have my disk on is ssd drive what is the size of the disc how do i react when the pod goes down and the body restart it's all defined in a yaml and you will provide all the settings so depending on which cluster cabinet test cluster you are running locally distributed in a cloud provider each time the storage class is dedicated to your kubernetes implementation so spoiler alert once we will have created the namespace the first time to do is the first times to yeah the first things to do is to create the storage class once you do have the scourage class well each time you ask for a volume we will instantiate the storage class to create a persistent volume and we will use something called a persistent volume claim to associate a volume to a pod so the pod will all the containers in the pod would have access to this pvc all right by the way we are going to see examples of all the stuff that cedric is talking about right now in these last set of slides we're going to see examples of all this as we start walking through actually building up our cassandra cluster within kubernetes yeah i don't expect you to be the kubernetes expert after two hours but at least we're not going to quiz you on memorizing all the stuff that cedric just said but yet again you would have the slide in github so your job to just read that and you know analyze that okay speaking of that kubernetes is open okay part of the cncf organization totally open and what happens when something is open well everybody tried to implement his own version and look at that it's just huge so many ecosystem client way to start or stop the containers with containers d multiple api multiple backend and i simply show you some theory but each time i you know let's say a control plane there are multiple implementation of the control plane so don't worry today we're just scratching with your face and give you the proper keywords and with that next slide it's not good jokes when we have so much delay there you go there's your replication lag from uh you know if you ever wanted a good example of what it takes like time in the wire to go from the us over to uh to somewhere in france there you go all right so yeah that's what just a joke telling you you are not like neo you go to the workshop plug the cable on your brain and you know kubernetes unfortunately this is not how it works um so let's move to the next slide so for today because there are multiple uh implementation of kubernetes we have to pick one and to help you to use one we could have chose one of existing in the cloud like gke ibm open openshift aks eks you can see there are multiple offer based totally cloud-based or platform as a service but there are also kubernetes smaller version uh distribution that can be run on your laptop so one uh pretty famous is mini cube another one is kind and the third is red hat code ready containers to run the cassandra cluster we need multiple workers and there is one limitation with mini cube which is the most famous that you can simply have a single worker on your laptop it's not enough and this is the reason why we pick kind so your job first part of the exercise will be to install kind uh or start using cam if you are using a cloud-based instance we have provided for you kind is already installed if you are using your laptop all the commands you need to pass are available for you to install kind in windows or mac os and linux as well so cedric there's other choices too i think we should talk about i mean just just mention so that yes if you're new to kubernetes you'll see that there are uh kind is one way to do this you can also use microcase um which is from the canonical folks and then minikube is also something you may run into but these are all ways to run kubernetes on your on your local machine totally totally and if you go to next slide david you will see that we have chosen some tools for you uh but if you already have a kubernetes cluster running you can try to deploy all the yaml files in your own cluster as long as you create your own storage class right anyway right as a matter of fact for the storage class and i'm actually going to touch on this as we go through the instructions and the readmes today we did provide three of them we provide gke mini cube and kind but yeah to that point if those of you out there that that number who are using kubernetes in production or in development if you have different environments it'd actually be a really interesting data point you know just to do it for us to take the same stuff from the github repository that we're gonna look at here in week five and apply it to your kubernetes cluster your environment that would be very interesting to see how portable is it really right because it should be um you know but other than the storage class there so that'd be very interesting to see if anyone gives that a shot yeah no no feedback yeah and you know one limitation maybe would be the the power you need to run the kubernetes cluster on your laptop those thing is pretty you know pretty easy so i would i would expect you to have at least two two strong cpu and two gigabyte of ram just for kubernetes yeah at a minimum and where's that github link well we are funny enough patrick what were you going ahead were you going ahead yeah funny enough no yeah because you couldn't ask in the in the chat like where's that link and i'm like funny funny so we're actually gonna go ahead and it's always the same everywhere and it is the same so so yeah for those of you who've been following along with us in the series the link hasn't changed right it is still the sander workshop series github repo we'll drop it in the chats for you as well um this is a week five so make sure to navigate to week five uh but it is it is the same repo that we had um and you'll see for this first exercise this is the uh this is the the first place to start so again you'll see our casino workshop series week five let me go ahead and just drop this for everybody just in case you need it yep and i think on this i will let you drive now david right you know they let me drive that gets scary it gets scary when i drive okay so here's what we're gonna do um so i am going to start bringing you through what is actually some of the homework right but we're going to talk about it as we go through there is you know you'll you'll find as you start to navigate through um the the files and the instructions in here it it looks like a lot right there's a lot of stuff going on but here's what's going on it's not just because like oh my god kubernetes is is so um so complex and so terrible it's that we're bringing you through a journey all right so we're going to start by uh you know getting you know starting up a regular open source cassandra cluster and then we're going to make some modifications we're going to change the size of our cluster we're going to make some configuration changes all these types of things that we're doing are to illustrate some of the power like what you get with something like kubernetes for my admins and from my operators out there you're probably gonna like this section um because there is a lot that we have to deal with think about what happens when you size a cluster yeah cassandra is always on it's very easy to add nodes but there are things that you have to worry about uh things like seed nodes configuring that rack awareness all sorts of stuff this stuff is being handled by the cassandra operator for you so again as we go through these you're going to see a lot of little steps but it's because we're using that to illustrate essentially what we're doing now a whole set of you i think like 600 uh 600 folks or so uh requested that they get the um the uh cloud instances that we've created for you i believe at this point i've been watching some of the chat i believe the emails are out um i believe you should have those i confirm okay okay good wonderful all emails have been sent now you should have the credential in your inbox and if you didn't fill the form you still have some you still have a chance go to discord and add jackfryer some spare instance we do have a few for you yes so if you're um uh so um uh so yeah so if you do have a windows machine by the way i just want to really point this section out the beginning of the readme um especially not just windows but like if you're on wind10 home edition or on older laptops you may not be able to install docker or you just simply might not have enough resources to try to do what we're doing today we are going to spin up a full three-node cassandra and data sex enterprise cluster you as cedric just mentioned there are some base requirements for kubernetes itself um so we do have those instances if you did not request one and you you're like oh wait i'm on wind 10 home or i've only got a you know laptop or 2 gig of ram or something like that um go ahead and just ask and we'll get you uh we'll get you one of the instances okay all right so with that what i'm going to do is in the beginning here there is this whole section of doing things like installing docker installing docker compose and all of that i'm not going to do those here right those take a minute if you are going to do this locally and if you're going to try to follow along and you don't have things like docker installed and such feel free to go ahead and do that you know obviously we're gonna this is actually gonna be part of your homework anyway um you may not be exactly where we are or maybe you just wanna watch but what we're gonna do is we're actually gonna skip down to step six right and this is actually uh after we've installed in kind by the way we have provided instructions in windows mac and linux for all of the stuff there so if you don't have docker if you don't have kind or whatever if you follow the instructions for your particular operating system you should be able to move along just fine but i'm going to skip down here to right at 6 now for those of you who have the cloud instances that you requested everything has actually been already done for you up to step seven so you don't need to worry about anything until step seven you should already have your kind clusters all right so first thing hopefully by the way uh give me some feedback i've tried to ensure that my terminal like the font size is big enough so you can all read it um just let me know though if it's too small okay yeah maybe do i need to already go bigger make it bigger yeah for the folder for the terminal at least yeah let me just we'll just super size it all and yeah the the form should not be accessible anymore we have created 600 instances a few hours ago based on the on the phone field so if you need one now we would you wouldn't go to discord and ask drag fire for spare one but we don't have androids spelled so first first there first uh okay so what i'm essentially going to do is i'm just going to go exactly through the readme we're just going to follow along and we're going to do this live so since i already have kind installed i'm going to just see this now i have not created any kind of clusters yet i've just installed kind at this point so if i start here at step 6 we're going to see now the first thing we want to do is we are going to create our cluster now i'm going to go ahead and do this and then let's take a look at the file let's just look real quick this part is a little bit fun here we go so you'll notice that all of these links that we provide you'll see that these are coming right out of the repo right so for those of you who want to follow along locally make sure at this point that you've already cloned the github repo um i'm assuming you've probably done this in previous weeks if not just as a quick reminder um if you go to the cassandra workshop series itself the base cassandra workshop series here and you go down where it says code in github you can either copy it download it whatever but all of the files and everything that we're going to be working with locally are going to be there in your directory so i'm going to go to set up your cluster look at zero one kind config just to give you an idea because i like to put these things together set up your cluster zero one client kind config and then bam okay yeah go ahead yes now so i just had a couple of questions what is kind so we explained kind means kubernetes in docker so this is a local international of kubernetes simply put right right okay now one thing i want to point out notice real quick is i'm installing or i'm creating the kind cluster okay based off of this configuration file so this is the file here that we're loading up here per the instructions and notice what we're doing we're defining the api server port um what the roles of the nodes are going to be and what's interesting is if you take a look at what's going on docker you're going to see that now that we've started this up i actually have or all the corresponding workers control planes things like that right i just want to kind of bring that together a little bit so you can see oh okay i have this configuration file i'm now applying that here when i create my cluster and it is putting these things in place so we've done this now in each one of the cases you'll see that this output i've got output here it should look something like what you see there now they're going to be some differences as we go through some of this just because your local installation um you know there's going to be slight differences that show up that's okay the key thing is it should look pretty darn close to what you see there now if i say get kind clusters you'll see okay i have this cluster called kind cassandra wonderful and you could also get some other information about this if you remember a second ago we talked about the api 45451 right so you can see this will give us some of the information a little bit more information about our cluster based off that configuration and we'll see this in the expected output as well and then last part if i get my nodes now by the way notice um again you know no one expects you to either know the cube control commands or memorize all these off the top of your head i always always recommend um if you are going to experiment with kubernetes and do things with docker and stuff go read the documentation right but we've provided a lot here for you to kind of at least give you an idea of well how do i get started how do i start querying things right you're going to start to see some patterns in some of the cube control commands and how you start getting data out all right so i've got my workers i have my control plane let's move on now for those of you who are on the instances that we created for you the cloud instances this is where you're going to start all right so first thing we want to do and cedric talked about this is create a cas operator namespace right so that's going to be important because it does help kind of keep everything in that we're going to work with for our cassandra cluster in that namespace and i should see that it's been created and i do see that then also as he talked about we have a storage class right we want to take a look at what we have there now this first one here is this just the standard default um that comes with you but as cedric mentioned cedric i don't know if you have any more you want to say about this when it comes to your storage classes you do want to ensure that your storage class is configured properly for the system that you're on so in our case we are going to implement one that is based for kind uh like i said we have provided those for cube and for gke i don't know if there's anything else you want to say there cedric yeah so when you create your kind uh kubernetes cluster there is a default uh storage class and but what we did here is we simply replicate the default storage class in kind because for the castle high cluster we need a named a properly labeled storage class so we simply duplicate the default one maybe if you open the yaml in the storage class one things to to to be aware is the starting position which one do you want or um kind yeah let's open the kind one yeah yeah it's just blowing that up yeah that's you know the yeah it's you know waiting for customer consumer this is what you need when you're working with the state food app like customers yeah as a matter of fact i believe that that's been pointed out here as well um right here that when you're using cassandra cassandra and kubernetes with cassandra operator that you need to use the weight first customer uh not immediate right because then they won't come up properly apparently and this is the area too that i was referencing if you are using mini cube or jke at some point then we have provided some storage classes for you as well so what we're going to do here is now we're going to take this command we're going to use control again notice that we are specifying our namespace and if i would use the correct key to cut and paste that would help there we go yep that's what happens when you don't use the right key to cut paste let's try that again oh no what's going on stop okay yeah so notice here that um i am saying dash n for my namespace i'm going to apply this storage class to that namespace i go ahead and hit it now i have the new storage class right it's actually that easy and if i go ahead and take a look at that you'll see now i have a new storage class named server storage because that is how we configured it here in our yaml and later on by the way you're going to see this come up when we're working with cassandra the cassandra cluster okay so this point you've got the initial setup going right we've got our kind cluster we have our namespace we have our storage class and matter of fact if you remember going back to one of the slides that cedric had i'm gonna say it's at the same time yeah so the storage class uh again a question about just what we just explained a few minutes ago so storage class is a definition of what what is a disk in the kubernetes you know all the specification definition of what your disk so the size here you can see um you know the volume binding mode reclaim policy you know really all the specification when you need disk to attach to when you need to attach disk to your pod right and if you notice here if you take a look at the screen um this is essentially kind of a depiction of what we've just done right we have our namespace we have our server storage but we haven't built out anything else just yet okay so with that let's see so that that essentially finishes what we've done for that particular section you know i'm almost wondering cedric if we shouldn't have people start up their cassandra clusters and then move into the next section of slides what do you think okay let's do it that way that's what you could yeah yeah yeah all right so what we're going to do next now if you're here with us um we're going to go to the working with cassandra operator this is after we have created our storage class you just click on the little instructions here that'll bring you to the next readme i should also point out that at the top of all these you'll see these sections we have multiple sections here we're just doing installation prerequisites we're now in the cassandra operator one we have a metrics and prometheus grifana that we'll get to and then there's a bonus section right we're not going to do it here live but if you want to follow for homework it's a really good section to check out where you can use a kubernetes dashboard as well um so we are in the working with cassandra operator section um and now we're all going to follow these now what we're going to do is we're going to get to a certain point we're going to go back to the slides we're going to give some things time to load up so okay great so we have our name space we have our storage class now we want to install the cast operator right this is going to start all the awesome magic and work to get our cassandra cluster going now there's a bunch of stuff that just spit out in the screen right again you'll see it in the expected output again where is that coming from what is that right so if i take a look at here go to cassandra i wanna say that we use one three today yes we use one three today that over where i can see it now i wanna say something about this don't be afraid don't be afraid um you're gonna see a lot of yaml parameters in here and you might be like what like what and um if you start to take a look at what's going here in these parameters a lot of them are pretty simple what's the description what's the name of this right and if you think about it from the regular kind of administration you have of whether it's a cassandra database any database or you know any kind of system like that you have all sorts of configuration parameters and things that you need to set up and that kind of deal like it's no different here right the only difference is that we're kind of setting these it's more encapsulated into a smaller set of configuration files that are kind of configuring our whole ecosystem right so it looks like a lot but i promise you as you start to kind of dig into what's in there you'll see that it's it's not rocket science it's it's very doable all right so we've created that now if we watch get pod so check this out in the uh section there was a thing about installing watch now if you haven't done that don't worry about it right if you have it if you don't have this it's totally fine watch is just a convenience utility what it does is if i were to just do this without watch check this out just cute control i'm just going to get an instant response but maybe something like this maybe i have to wait for something to come up and i don't want to have to keep issuing the command over and over and over so watch is just a really nice convenience i'm actually going to leave this up here so we can watch what happens as i'm applying these new commands again if you don't have it it's no big deal yes and for everyone uh you know saying that oh we're just typing a bunch of commands what is the cast operator that's coming we just switch from ends on uh and slide because it takes a few minutes to start the the casino recluse so david just triggers some comment to let the cuban the cassandra cluster start properly but we will go back to slides in a minute and i will do my best to be you know exp deep dive about what is the cast yes yeah totally totally all right so for this next piece here um this is something i want to point out notice that when we did the coupe control against the cass operator and we said get pods right we see that we have this one here now this is one of those areas where your name is going to be different from ours so you see the example here and that's why in the instruction it says cast operator your id so make sure that when you do this part that you are then taking your name and pasting that there at the end of course adding a space spaces are useful yeah i love like eric ramirez just you know flooding the chat telling we yes the cloud instance will last for 24 hours because remember we just started i don't know almost 1 000 machine for you guys so yeah we cannot we cannot let them fall i see i wasn't watching the chat now i looked over and i see it that's great that's great so so now i just did uh essentially describe the pods that are in my particular cast operator um and again you're gonna get a whole set of really nice output here um you know you can take a look and look at what you know what's the various configuration what state are they in um that kind of deal now i'm going to kind of skip over some of these these are just optional commands that we've thrown in here and again as i mentioned a lot of this is very step-by-step giving you these exact commands just so you get a feel for things you know again this is part of the homework to kind of dig in and and see what kind of stuff is available here um so we're just trying to give you all the dairy all the very um you know kind of options okay this next section create a single node cluster we are now going to create our cassandra cluster that i think from seeing some of the comments in the chat this is the part that some folks have been waiting for so now we have our base stuff in play watch this so what we did again now this is cool if you take a look at the ammo this is cassandra 12 cassandra so if i take a look we'll go to uh i'll just go back here this one so i'm starting a one-note cluster now for those of you who have ever done anything with the cassandra cluster before some of this should start to look really familiar right i have things like a data center name by the way do i need to blow this one up let's do that um i have things like a data center name dc1 i have micah sandra version 3.11.6 i have the size of my cluster it's just one at this point remember i mentioned we were going to reference back to that storage class name here it is so we defined the server storage originally and now we're making that connection between those things if you're familiar with things that you might see in the cassandra yammer things like the password authenticator the cassandra rule manager your heap size and such right you can set these parameters to you know start up our nodes that's all we're doing is we've now created a cassandra node and using these particular parameters and if you notice in my watch i have this code control name spacecast operator get pod so we started a pod this is where my cassandra node lives and now it's initializing ah here it goes it's starting to run and let me pull this back just a little bit there we go right we should get to a point where that says ready to to and right and once you get into if you want to look at the data center creation because in there we did create our data center dc1 and you want to look at that this is another way where you can do a get now get w by the way uh it will watch this is actually notice that it did not um end my feed here it will actually watch this so this is a way that coup control does have like a watch parameter in there if you don't have watch itself but this will let you essentially watch you know what is going on the data center its creation and you can get more details a lot you'll see a lot of the get command get commands described commands you can use for that and speaking of here is describe right and we're just waiting essentially for this last little piece all right while we're waiting for that cedric do you think it's a good point good time to go back to the slides then oh yes it's more than time because no people just freak out there is yeah they're like wow what is the all right relax everyone yeah yeah you know i i really appreciate that everyone is uh trying to learn this it's clear that there's a lot of folks that don't know anything about kubernetes but it is the future yep yeah and i want to you know one thing to point out before because uh centric moves on right is that you know if you've ever managed a cluster or database or something like that apparently i have my slack notifications on so be nice team but um for you know anyone who's ever administrated a system before any kind of again any kind of database you have all sorts of configuration parameters all sorts of things to worry about think about hooking up your application over some network some network infrastructure that's there all this stuff that you have to do in your it teams it's all being done within kubernetes right so just kind of keep that in mind for a moment and you're going to start to see as we do things like change the size of our cluster and and change configuration parameters once you have this up and going how much easier it is to do it this way than it is to do it yourself manually all right i'll be quiet cedric go for it all right so i was explaining you what is a namespace the logical grouping of resources so everything you create in community is called resources and each resource had its own category the first thing i explained you the category of the storage what is the storage place specification explaining how to create disk on kubernetes so now let's see other resources and the purpose is to go step by step and up to the operator the class of operator okay next time okay so when you create a distributed system [Music] you can either use a primitive code replica set which is you know i want three containers of these stateless uh containers so i want three instance of this stateless application like a web service and so it will work exactly as i told you in the beginning if one of the instance just crashes kubernetes will restart the the container just to be back to the three containers we expect this is a replica set and it's stateless but when you deal with database replica asset is not what you need you need something called stateful set when you define a stateful set and not only you told cassandra how many times you want to start the container but each time you say oh this is a disk to mount to this container and so when i start a stateful set i say i want three containers and on each one i will attach a persistent volume remember i use the storage class as specification i instantiate to get a persistent volume and i mount the persistent volume to a pod using the pvc persistent volume clay okay that is a stateful set moving on okay waiting all right uh i think you can go with the animation i won't go too much into the detail with this one but you need to understand that uh kubernetes cluster is kind of a black box and all the workers are isolate once and if you want one node to communicate to other you need to create some names abstract names and those are called services if i create something called a service it's an abstraction of multiple pods and so when i try to contact the service i will do some low balancing between the pods that are behind instead of just contacting one pod with its name i'm using a service and this is the service that will load balance my request to all the pod with the label so matching the cells in ingress is a way to open a cluster to the outside this is exactly what we will do next week um so i won't go into the detail we don't need ingress let's move on that's enough stuff for today um i'll also have a blog post on that next week as well um cedric so there's gonna be a lot of resources coming on that yeah yeah yeah a blog post on ingress or what what's the blog post on patrick on service mesh oh cool yeah yeah more more information okay um so look at here what we have we have the pod so remember the orange the pod the one running multiple containers attached to a pod we can have some config map so this is a configuration files key value key value okay incremented they are called config map and anything related to secret user password maybe cloud secure bundle we did the the past week could be defined as secret in the kubernetes world so when i will create a cassandra node not only i need to have the storage but i also need some configmar to provide all the parameters needed to start cassandra and some secrets to have user and password already there but sometimes even with all that stateful set service configuration storage this is not enough four kubernetes to orchestrate properly a complex application or distributed system and let's admit that cassandra is quite a bit quite at least to administrate so if we can simplify that with kubernetes let's go for it but kubernetes needs to know the rule and so if you move to next slide we will introduce called a custom resources when the default resources are not enough for you to explain to kubernetes how it works you need to create something custom resources so here look at the spec block in the yaml so by the way all the resources we have we are currently creating kubernetes are defined in yammer kubernetes is the ocean of yaml and especially for the custom resource you would have a dedicated blog called spec for specification and there you will define what have the parameter to your custom resource at datastax we have defined what is a cassandra data center this is our custom resource and we are providing a specification so now in the castle in the kubernetes cluster we will create some instance of the custom resources and finally if you go to the next slide we will introduce the operator and an operator in kubernetes is something a daemon that will listen a custom resource okay so the operator is constantly listening the constant the custom resource each cassandra data center but also listening some some events coming from the control plane could be a test master and also be able to read the states of the system by reading etcd backing store so now the role of the operator is to say oh you asked me to run a three node cluster in cassonne for instance i give you a yaml file telling you that i want a custom resource data center one where there are three nodes the operator will match with check how many nodes do i have in the casa cluster right now oh i only have one so i need to add two okay to match the current state but i cannot add two nodes right away remember in cassandra there are rules the two minute rules for instance i like to remind these rules and so this is the job of the cast operator to start first one node wait listen for even telling that oh the cassandra node has been started the cassandra node is bootstrapping the cassandra is ready to take some requests okay now i can ask the crd custom resource definition to start the third node and when david later on will do the end zone you will see that now we have started because he has started a one node cluster so we have defined cassandra data center but soon by providing a new yaml we will simply scale up so all the all the rules you might apply how to start stop how to bootstrap how to do the repair those are all operation all function you can invoke through the operator the operator is not only there to manage the good health of your custom resources but there is also embedded functions ready to go to act on your cassandra cluster so i hope i was clear and sharp enough yeah i think we can move on daily do you have your cluster your cluster yeah let's take a look it should be up by now yep there it is so the single node cluster yes so yeah before the mentee go see your cluster and you know with get pods and describe and everything show people what you got there where is the cast operator where is you know all pieces that are just right so we have to make things easy yeah so we have the get pod right so we've got our cast operator that we created originally and then here is our single node that is in fact ready right if i were to go ahead and use the describe again now just to point out we do say this by the way um in in the readme you'll find that we sometimes reference cass dc as compared to like you know standard data center there have been some shortcuts that were put into the configuration that's all this means but it's all referring um to the same cassandra data center that we created so i've got this command here so now i can see that there's more details for our data center i'm gonna try to i was trying to find one that might be um useful for folks to kind of pull out of here right okay so you can see things like remember those configuration points um things like the password authenticator cassandra authorizer our heap size the version all that stuff is set in our uh data center uh configuration and now we get these statuses right so we've we've co completed it at this point um so we see that we have our pod with our cassandra node running and we'll see we get these statuses using the describe command all right so now i'm just scrolling down by the way i did see some questions um on the installation for things like windows the prerequisites now if you remember in the very beginning i skipped over a section i skipped over so i'm just going to go back real quick because i want to make sure folks are on the same page so in the very beginning if you go back to week five notice where i'm at i'm at consent your workstation week five that's where we are today the very very beginning boom this section installation prerequisites so for those of you who are installing local if you have a cloud instance you don't need to do this this is actually part of the reason why i skipped um but if you do have if you need to install docker docker compose coupe control all of this stuff we've provided instructions for every one of the os's i actually i did see some questions about windows i know we have a lot of windows users on here i actually ran through all of this again recently on my windows machine um and all of this worked you know just as the instruction states so if if you do find that you're on one of these and you don't have something like docker we understand some of you are new to it the instructions are here some of them like this might point you to you know docker's instructions for something um but all of them are enough to be able to get things installed and running okay all right so with that we have our single node now um i'm gonna you know again we're actually signing i also see some folks um you know that it can be a little bit hard to keep up we don't expect all of you to be able to do all of this right along uh right along with me we're really kind of doing it in this way so you guys can ask questions and at the same time you can always play the video back later we are actually going to assign what we're doing right now as homework as it is this is actually the homework this week um so you'll have time to kind of you know again go through the commands and everything my goal here today is to get to a point though where we've got a full cluster that's supported by metrics and you guys can see what that what that actually looks like and that this is in fact achievable okay so cedric you were just actually asking me a moment ago to get more information about the cluster i don't know if there was something else you wanted me to do there um but uh yeah just just to describe of the dc just to see oh you have yeah all the ml files so you just say i will create a onenote cluster so that would be neat to see the yammer to create this one node just to see oh this is what we are deploying oh okay you want the ammo for it yeah okay i thought i oh i didn't have it up okay my bad my bad here let me get that hammer my bad i see what you're asking for now you want yeah because it's it feels too magical even to me you know you want this one i believe yeah one node yeah one node yes yes so if you look at this uh file so the first things to notice is at the top so the line number four kind so we are creating something called cassandra data center this is the custom resource the one that as customer expert we know all the rules to manage a custom hack cluster then you got metadata named dc1 so you might now already know that it would be our data center name that mean with our operator we can have a cluster of cassandra with multiple dc okay then below you do have spec cluster name that mean you can also with the same operator have multiple clusters right so here we we do have a cluster name cluster one with a single data center called dc one we are using cassandra image 3.11.6 by the way 3.11.7 has been released on monday i think i see the the crew from the apache telling that it was out and size line 13 is really what told us we simply want a single node now if we apply the very first the very same file but changing only line 13 telling now i want i don't know size three then the operator will notice that your new state ties three does not match current state with only one and it will start the two new one and see storage class we provide this storage class name server storage read one once and we provide here size five gigabyte which is the size of the disk we have just attached to the node okay yeah thank you for that okay all right cool thanks cedric all right so moving on a little bit i'm just going to scroll through some of the the reading material for you later um okay so this next section here we're at number three here matter of fact i can give you a link so let's do it just in case just to make sure folks are on the same page if you're following along that is okay and one thing i want to say uh we are seeing some requests that are coming in from folks to maybe keep their instances their uh their online instances the ones we created for you for longer than 24 hours uh if you have or if you if you do have the request i'm going to drop an email right now um alex alexander velichniff um go ahead and email alexander valencia or alex uh if you do uh need a cluster that would stay up i'm sorry i need an instance at cloud instance that'll stay up for more than 24 hours yeah we do have a lot as was mentioned before we are creating like a thousand of these so it's a lot of stuff for us to be able to keep up indefinitely or anything um but if you make that request we'll we'll try to make things happen for you okay so in this next section we're going to do something really cool uh notice here uh cedric talked before about secrets right so i'm going to use cubecontrol again with my namespace and i want to get the secret for the cluster uh the the the cluster1 superuser here so when we execute this and i did already put it on the screen that is the same command i have here the two things i really want to point out are this password and the username this is the password and the username that was stored in the secret now these are base64 encoded right so if we want to find out if we want to decode them we can use a command just like this now the cool thing is this first one since the username that we're going to use for our cassandra cluster is the same no matter what you'll see that matches here if i go ahead and base 64 decode that really you know i get cluster one super user wonderful but what about the password well for the password what i need to do is if you notice this command this is one of those cases where if you just copy what's here you're going to get a different password than what your own system is showing so if you just say echo you grab the password that we got originally when we pulled out the information from the secret i go ahead and paste that in and then i'm going to decode that as well base64 decode this echo and by the way what i'm typing i is right here i'm not you know it's there you go it's all right here um if i hit that now i will get the my password so now what are we gonna do with this right well this is where this starts to get really cool because for those of you who are used to running cassandra nodes without something like kubernetes right kubernetes is this layer of abstraction that's in the way it's like well how do i get to my nodes well this is one way you can get to your nodes by the way this exec command this dash id is something you'll see in docker and you can use it to execute commands against against some of the resources that are in kubernetes or docker and notice what we're saying is i want a bash prompt so notice what just happened here i just actually came in um as root as a root user uh to my node to my pod that has my cassandra node i'm now in a bash shell with that and i can use this now to do things like say run node tool status and again for those of you who are used to running cassandra clusters yourselves you should be familiar with node tool right so right here i'm at the very prompt and and i have access now to my node just like i would if i had done this directly on my on my system or on some system as compared to being within kubernetes and you can see that i do have one node here um that is up and david i was here's something i would add into this is that um it's really an anti-pattern to go into the shell of a container yes there are some things you may need to do um but the way containers are supposed to run is that you when you set them up and run them you don't have to interact with them they should be ready to go from setup with the ports and the storage um this is a good example but i just want to really be clear like this is not if you're shelling into a container you should stop and ask yourself why yeah no that's thank you for making that point that's a very good point okay yeah um yeah i will jump in just because you just stopped speaking of the the the cloud instance so remember we have started 1000 instances and obviously we cannot keep 1000 instances running so if you want this instance to last longer than 24 hours send an email to alexander.volasnet to make your instance uh leave a bit longer okay we cannot let 1000 instances which you know quite powerful to when all that stuff lasts for three weeks cool all right thank you all right so the next part now that we are in the anti-pattern the next thing we want to do is we want to actually see the you know what's going on with with our nodes we want to do something with our database right so notice here i'm going to use sql sh now the key thing is to notice that username is the cluster 1 super user again that was base64 encoded and the value that we saw up above but then this password now again this password is going to be the password we decoded on our local instance so what i'm going to do is i'm going to grab the stuff before the password and then if you remember up here i decoded the password from my secret so i'm going to grab that and now i should have a sql sh prompt right so i'm in the database at this point so for those of you who've been following along with us from week one on and we've gone through some of the cassandra fundamentals you've already experienced what it's like to be in the shell um so you'll notice we have some commands here first one is we're just gonna go ahead and create a key space called killer video one um now by the way i do wanna point out uh that notice i am copying in this case we're we usually we give you these blocks that you can just cut and paste directly uh but in this case we actually left um these little pieces in here so you kind of know where you're at you know which shell you're in you'll see where this comes into place so just make sure that you're copying the stuff that is after uh the character here all right let's see this so notice all i'm doing is creating a key space killer video one with my replication to dc one and one node done and then if i describe that oh whoops my bad yes there we go now you can see i have a killer video one key space in all of my key spaces then if i go ahead and use that right so now i'm switching into that particular key space i want to create a set of tables and insert some data just literally copying that whole block pasting it right in here boom yeah there it goes just creating tables yeah so i just created a user's table of videos table i've inserted some data into both of those that was it and if i select star from users i missed an e there we go you can see i have data in the users table same thing if i do select star from videos right i've got data in my database this is what i would expect as a point so i'm interacting now with the node that i have but this isn't so we're just about to get to a point though where it starts getting really cool and this is where we scale this cassette or not cassandra you're cedric not cassandra cedric cedric was talking about earlier how we have this configuration point um how we set in our data center configuration that we have a size of one node now this to me is where we start to get into some of the really cool stuff with kubernetes and what you can do with it and why it's so powerful um so what we're going to do here is this next command this diff notice what this is going to do this is actually comparing two of our yamls so i have one that's one nodes and the other one's three nodes now check these out so even though it shows us what the difference is right here that's what the diff is doing i just want you to see this to make that connection right so here we're looking at cluster one nodes i have a size of one and if i go back to cluster three nodes the only difference is the size is three all the rest of the configuration is the same just the size of three right so now what i'm going to do is i'm going to apply it notice that as i go to apply this to cluster three nodes watch what happens up here watch up here boom two nodes two pods actually just got added right now those are actually going to not just start up two more cassandra nodes but my seeds are being handled bootstrapping is being handled all the normal things that from an administration standpoint that you would have to do that's being the networking all of that that's all being handled so this now really starts to get into you know you see it's like oh my god i see all these you know yaml hell and kubernetes and all these configuration options how would i possibly know what all that stuff is this is too complicated and like i said before we're really encapsulating the same exact kind of configuration points that you would have anyway in your in your cluster you know in your regular cassandra clusters and you're just encapsulating them in the yamls and such but then you get so much more power because of the flexibility you have to not only be able to size up and size down your cluster on the fly and let kubernetes do its thing but something else that uh cedric mentioned earlier if you have like you know a pod or something like that if you have a machine die or something kubernetes will automatically heal that for you right there's all sorts of power you get out of starting this particular base now eccentric i think while we're waiting for these to come up because again these are real cassandra notes they do take a minute this probably is a good time to go to the mentee unless you wanted to take a different direction here uh no i don't have any questions especially on the chat right now so i feel that's time to all right let's do it so i'll give everyone a moment for those of you who are following along if you've gotten to this point and you have your three notes going again it's going to take just a moment um so that's why uh that's why i'm just going to give you a moment and then we'll go into the mentee while we're doing the mentee we can let this do its thing all right let me oh when i see folks there i love how everyone stays in the minty that's great all right here we go all righty all right i'll wait for some thumbs up so give me thumbs up let me know let me know that you're ready right whether you're just following along you just want to do the quiz you've got your your three notes that are spinning up and it's going to take a moment yep let me know you're ready we'll watch for some of the numbers oh i see a question while we're waiting for folks to get into the mentee i see a question from stuart linney we apply to yaml for three notes cassandra but it's only creating two pods is it because the seed node already initialized yeah we already had one node we already had one in place so we only needed to add two more on to give us the total of three yep um now i see another one from karen maybe cedric you have how do the seed nodes get updated well i mean like i would i would think that at first i mean you've already got your seed your initial node's going to be a seed um yeah i think the operator will create will mark a cassandra node as a seed for each rack as we did as we did not provide a rack we are using a default rack so all the nodes are in default and this is why you do have default in the name of the sts and all the resources you are created and so when you add two more nodes the nodes will know what are the seed using a dedicated test services this is what we call headless services yeah it's some kind of label on top of seeds and if we need to scale seeds it's also done by the operator so i see a really neat question from stan over in discord i think patrick i i think patrick and cedric i was just looking at that were you i i was going to say i i bet we're going to have some fun one some fun conversation on this one the question is what is the reason to spin up cassandra high performance database and kubernetes cluster compared to cassandra and bare metal i'll just start with one thing and i'm going to leave it i know that patrick and cedric have something to say about this you can spin up kubernetes on bare metal as well right there's there's no requirement that it has to be in the cloud or anything like that um to to me i think the benefit of kubernetes piece is what you're getting from the management side of things um but i know that i can tell patrick that you were itching for a response on this one well no i think well eric and bettina are doing an awesome job answering it but um i'll give i'll give a longer answer for everyone i mean part of it what i read was like why would you put a high performance database in cassandra in a kubernetes cluster like almost like it would degrade it uh and no it shouldn't um it should run just as fast as if you ran it on bare metal um the the answers that you're getting which i i will reiterate yeah it's about it's about creating a single control plane for your entire application so if you think about from ingress to uh to application tier like where you're running your app servers and containers uh for microservices and your database layer if you're able to deploy that in a single deployment and manage it in a single control plane um think about how much better that's going to be for everybody um we we already know there's large companies already doing this um you know the uh this is what apple does this is what a sky uk does um it's it's just how you run something like this at scale yeah yeah by the way um i do see one quick thing and then we'll get into the quiz um i do see uh trekker ghost and discord how to start over i assume what you mean is um and correct me if i'm wrong by the way i'll try to watch your response here i assume what you mean is if i did something funky in my criminalized cluster or whatever or you know following along and i need to start over how do i do that at the very end in a matter of fact in the readmes i want to say it is at the end of the metrics and performance readme if you look at the section it'll actually have how do i break this all down right so we we kind of bring you through a journey and that's how do i delete everything and get back to a starting state so if you really do need to do that you can just go to the metrics and performance section go to the very end it'll show you exactly how to bring it all down and then you can start over if you need to hopefully that answers your question okay so with that let's get in to the quiz quiz time all right mentee now at this point um you should get oh well i saw my screen flash that was interesting there they go all right so and again this is your chance to win some cool swag all right so again don't forget with the questions look at your phones or wherever you're running mentee there could be lag in the video a docker container is an image of software stored on disk lightweight standalone executable package of software a file used to configure a docker instance or something to store fission when coming back from a day on the boat [Laughter] i don't want to tell you which question or which answer i'm laughing at but maybe you can guess all right awesome yes yes good i'm glad mostly you're off whoa yeah whoa what what so many people jumped on that that was so fast yeah we're gonna see the timings here in a second uh yeah did we get somebody who actually said yes we did yeah it is something indeed that you do contain your fish but yes yes it's a lightweight standalone executable package of software very good all right let's see and this is my always my favorite part of these is leaderboard to see what happens here oh i love about cake that's great pod maniac that's a good name all right pop maniac you better win but cake cake has the fastest time with peru and pod maniac i mean i'm only saying pod mania because that's a good name for today's theme so yeah look how tight these are this is this is not it's like at all and again for the questions look at your phones or wherever you're running it menti don't watch the video in docker how do you enable persistent storage of application state the state service volumes persistent file layer or you don't need persistent storage it doesn't exist nothing is real nothing yeah we enjoyed creating the squeeze you should just put three questions up at this point yeah it's never the fourth answer yeah the fourth answer is always always a funny one just just you know and then you can always tell who the jokers are that answer so yes so it's volumes right so if you want persistent storage application state and this is also really important cedric talked about this a little bit before but if you imagine what happened what would happen if we didn't have persistent storage of our data and i have ss tables and commit log you know commit logs and everything like that stored somewhere and then for some reason i lose a pod i don't want to lose all that that would just kind of defeat the purpose and so by having this persistent storage of your state and having persistent volumes now i know that i've got my files over here and in that volume and my pods can interact with that so it's actually another way that kubernetes is able to self heal i could lose a pod and i can just bring up another one in its place and all of my data and everything is still there so it's really really powerful here's another point in here too is that this is about docker and um to the point of performance if you're running cassandra in a docker image you need to use uh you need to use the volumes the external volumes you can't use the storage inside of docker um in a lot of reasons but mostly it'll just be like a potato [Laughter] that's great you might as well just run it on a raspberry funny all right let's see what happened to our leaderboard we have the birthday kate laura with amber oh wait wait i'm sorry i spoke too soon we gotta wait for the timings oh oh it did switch up a little bit but laura is still on top with uh cerebral and j12 where did oh where did it see this is how this game can change at any moment uh ambush like right there it was too tight it's too tight yeah all right let's see we're going for this yeah but laura shot out ahead all right again look at your phones don't forget look at wherever you're running mentee for the question in kubernetes what is a pod a machine a worker machine and a kubernetes cluster a set of replicas a collection of containers that can run on a host i honestly have no idea and this is the first kubernetes question i ask so pick from one of the three yeah pretty much pretty much awesome yes it's a collection of containers that can run and holds you know i am actually really happy about this because um uh kubernetes is not one of those kind of technologies that you can just like jump into in an hour and know it completely and uh you you everyone's doing a great job of you know i'm glad that so far the majority of folks are getting it right so yes it is a collection of containers that can run on a host and some of those questions are a little tricky but almost right yeah yeah or the answers i'm sorry some of those answers are almost right like a set of replicas a worker machine and a kubernetes cluster they're almost trying to be tricky maybe too tricky but you know we try yeah all right let's see what happened here and did laura hang on no i hope oh oh oh yve or you oh yv yv yv yb oh but laura's right there laura's right right there laura you can still do this i'm not biased still in the game but now yeah now we're we're just rooting for you all right j and j-12 as well j-town's right there that can okay it's gonna be a fun next one in kubernetes what is a service a program that runs in the background a policy that describes what net traffic is allowed for a set of pods a named abstraction that defines a set of pods or something you order in your room at a hotel no comments on that one patrick i'm just so surprised i was waiting for the lag and everything what else am i gonna say i mean now this one i'll admit this one was tricky this is one of those questions that is it's close like those are closed but yes it is a named abstraction that defines a set of pods yeah um and yeah and you know i'd say once you start working with services a little bit more um especially when it comes to say like exposing ports and such i think it'll i think it'll become more obvious of what that is and how it plays in here um but yeah that that tells us right there though i see that kind of spread and that tells us maybe we could be we could do a better job of defining that for everybody tells me that there's a lot of people that are [Laughter] uh that's great all right and let's see what happened in the leaderboard i always get so we need suspense music here oh wow it's just we've we've got this battle going on in the in the top three oh man it's it's so tight right now i think last week somebody win by wine one photo the data stacks kubernetes operating timing you got to be fast right the data stack operator for apache cassandra describes what network traffic is allowed for a set of pods represents a customization of a particular kubernetes installation automates deploying and managing open source apache cassandra or datasacks enterprise and kubernetes and it's so wonderful oh my god i thought you'd never say so i don't even get that one fourth one it's like huh what you well you know data sex created the kubernetes operator and do i have to explain the joke patrick yes i'm sorry okay let's see how many people can give a thumbs up if that's a terrible joke anyway anyway yes anyway yes it automates deploying and managing the uh open source of patrick cassandra or data sex enterprise in kubernetes hey i don't see any thumbs up so apparently it's a funny joke patrick all right let's see what happens yeah they're not paying attention yeah anymore they want to win the quiz all right let's see what happened here whoa whoa that was close it's gonna be the speed yeah it's the fastest yes yeah very good job so for the top three folks congratulations yes congratulations make sure to reach out to jack fryer if you're one of the top three folks to get a nice swag box alrighty so with that that's all poor vj i finished 52nd oh i love all the hearts by the way thank you for the hearts yeah i'm sorry parts are wonderful next time oh vj was right there i didn't see oh no really i know vijay you're just i think your numbers are going up every time so that's good but those were hard those real hard it's awesome yeah you know just maybe practice at home all right all right so moving moving back over to what we're doing here um okay so notice now we have our three node cluster yay that's really cool right um so again we were able to just change one configuration parameter in our yemo and apply that real time and it kubernetes actually went round robin went and replaced all of those actually i'm sorry not in that case i just added the two nodes on bootstrapped did the whole deal there okay so let's see so now if we go ahead and um take a look at our anti-pattern from before like what patrick said if we go to our prompt or bash our bash shell here and if i run a no tool status again just like i would for a cluster i should see that i have three nodes in there and there they are right so i do have my three nodes in cassandra um and again all networked and everything now what i'm gonna do i'm looking at the time we've got roughly 20 minutes left right um so i do want to ensure that we get to some of the uh the fun parts here um so really what this next section is going to do i'm just going to kind of give a quick explanation what's going on um so we have already gone through and logged in with cqlsh we have executed um some sql sh to create a key space create some tables put some data in there and such now check out what this next thing is doing right i'm actually going to do this one just because here we go so i'm using that same login as before i'm in cqlsh i'm going to take a look let's take a look at our key space the one that we created before this is what i want to point out notice our replication strategy now we have three nodes but i only have a replication factor of one right so i probably want to increase that from all the things we've talked about throughout the series to replication factor of three so that's what we're gonna do here right we're gonna go ahead and down here we're going to alter our key space and notice i'm just changing it to a replication factor of three that's it it's all the same stuff killer video one dc one replication factor of three now when i describe the key space you'll see that i have a replication factor of three right um so something that's pretty interesting then if we go ahead and we change our consistency to quorum and then if i turn on some tracing now for some of you who've been managing cassandra cluster for some time or if you've caught on to if you think about it when you one of the really cool powers about cassandra is that i can just change my replication factor and now i get this automatic automatically boom it'll start replicating to those nodes i don't have to do anything else really but if i have existing data in a system like we do now we did insert some rows right well that data is going to exist on one particular node but when i change that replication factor it just doesn't automatically restream that stuff around you either have to execute a command to stream the data or rely on repairs or something so what we're going to do is we're going to set our consistency to quorum i turn on tracing and now i'm going to select some data now i'm not going to go through the whole thing what i want to point out though is something that's really cool since we used a quorum if you remember back to week one i believe when we went through the cassandra founder metals we talked about one of the neat benefits you get when you read and write a quorum right on the reads is you get that digest check you get this check comparing to see do i have any stale data or anything like that compared to my nodes and it will automatically perform a read repair so well since i only changed my replication factor i probably when i do this at quorum i'm going to have one node that is stale um it's going to do a check here let me see i should see a read repair in here it's up a little higher that's when you turn on tracing there's a lot that goes on by the way here we go right so it's reading doing any merging it needs to is it going to make me a liar i'm going to be a liar live no i'm not seeing my read repair that i would normally see oh wait no there's my mismatch that's well that's that's may not be it where is my repair there's a lot in this trace though i'm somehow not seeing the read repair i don't know if i'm just skipping it cedric or i'm just not seeing it i'm actually surprised i should be seeing a read repair here anyway i wonder if i'm just going too fast it's not really a read repair but you still access multiple nodes meaning that the data is available on multiple nodes yeah because you just what you did you simply added two more nodes change the replication factor so what happened now all the data leaves on all the nodes and so when you try to read something with a column you will get multiple answers from the node you need so two over three yeah yeah now yeah that's right that's that's that is what we're seeing that's interesting because before um when i was playing with that oh was it there and i just missed it i i by the way you guys was it there okay i did miss it okay i was scrolling too fast because i was like uh i need to go back okay let's see they're telling me to scroll back up let me see where is the i can't believe i missed it i love love yeah right you're like wow we came on to this cool workshop to look at them scroll through logs that's wonderful yeah pipe grip repair i'm missing it i so i'm gonna move on and you're being asked to zoom in both of you both eric's are seeing it you're you know i unfortunately if i zoom in anymore i lose uh the ability to do much of anything else but we'll do it we'll do it okay hopefully that zooming what see there you go that that looks initially yes initially with reaper yeah oh is it literally saying i oh my god it is i could not see it the whole time anyway anyways the last thing here i i just i literally was skipping over the whole time thank you everyone for bearing with me with that everyone is cheating yeah it's just like that was that was pretty funny okay so here's what i'm going to do again in lieu of time because i want to get on something a little bit more uh fun notice this next one here so if i take a look at the diff we're gonna do another comparison where this time it's still the three nodes set up but what we're doing instead of adding or removing nodes we're actually changing a configuration parameter right maybe something you find the cassandra yammer or whatever now again if i apply this then what kubernetes will do is we'll actually round robin it'll it'll restart these it'll like terminate them and create new ones with new configuration and it'll do it on the fly and it'll do it seamlessly right so it's actually really neat and powerful because again that is another way that it greatly simplifies what happens if i need to make a configuration change or something i can literally make the change just apply it like we would here right if i actually executed this command um and then it would handle that operation for me right so it's pretty powerful stuff all right so here's what i want to do though um at this point i'm trying to think of i'd love to show the metrics collector stuff um i think we can do it in the time we have but it's going to be tight um yeah would be tight yeah so it's going to be tight so so again for everyone's like wait a minute why are you moving on or something i'm trying to follow along we're assigning all this for homework as it is um but you can try to follow along with this as well if you would like so what i'm going to do is i'm just going to skip i'm skipping some stuff that actually talks about the configuration parameter or the commit log 1 here to change to 11 000. again the whole point of this part of it is you would change it you would see it restart all your pods with the new configuration if you then look at the configuration you would see that this change has been applied right that's the point here but what i'm going to do is i'm going to skip forward to the metrics management and visualization one and we are going to stop now what you're going to see here is if i take a look we're just changing another configuration parameter say stopped true so when i apply this is actually going to stop my current three-node cassandra cluster the second i do that if you give it just a moment we should see [Music] we should see terminating there they go boom now in this case since i'm stopping all of them it's not going to do in ron robin just going boom you're going down right it's going to stop all of those and wait for that to terminate yeah eric did that zoom work better for you if you could let me know in the chat that'd be great yes and tdh uh in discord says would any config changes cause a rolling restart yes yes absolutely i'm kind of skipping over that right now but that's exactly what i was just talking about a moment so if you did make a configuration change you would actually see that each one of these individually you would see like one with two of them would be running right and then one would terminate it would restart when it was up and in the system ready to go the next one would terminate so yes it would do a rolling restart okay so now i've stopped we see that my nodes are gone i'm gonna go ahead and remove that data center okay good the zoom is better okay all right so now if we take a look i've removed the data center um oh i stopped i'm not going to have that yeah all right so for this next section now we're going to get into the piece with prometheus and grafana what i'm going to do is i'm going to start some of the stuff up and we're going to talk a little bit more about what those are but just as a quick overview prometheus and grafana are tools that are used if you want to say you know pull data and metrics and such from your system in this case obviously cassandra and then if you want to be able to visually depict those metrics and some kind of nice tool that you can use to you know be able to get nice updates every five seconds 30 seconds look at things over days or whatever and essentially do some analytics on the performance metrics you're getting out of your system so what i'm going to do is i'm going to just start this up the install doesn't take so much time but the prometheus operator does take a couple minutes and then we'll actually get into the section with prometheus and grafana now by the way i don't know how many of you are familiar with prometheus and grafana um if not we're going to introduce it to you here they're really nice tools you can use them with a lot more things than just cassandra you're not limited to cassandra or something like that and they're great for visualizing the metrics of your system so they're just really kind of good tools to know about in general all right we'll wait for the olm operator i don't know if patrick and cedric if you guys have anything um about those two any kind of fun stories or success stories while you're waiting um for this to install because you need filler because things are starting you don't want to have very much pretty much yeah we i'm all about the question but yeah that's pretty we need questions let's see do we have do we have some questions uh well there was there's some questions about like the rolling restart and you know how this works i i i put it in discord but yeah everything we do one is about keeping cassandra up a hundred percent so rolling restarts don't terminate yeah i see the question from muhammad ar and discord right so what's the use of terminating the whole cluster at once well for a case like this where we're experimenting and we're just going through this process i you know maybe i'm in my development system uh this isn't something uh you know a cluster that i intend to keep up 100 of the time or something that would be where i use this but you're absolutely right just like patrick said right if this is a real use cluster then that kind of defeats the purpose of cassandra so yeah it is a lot like i said before when we first started today a lot of what we're doing here is we're offering you you know we're just kind of bringing you through a particular journey so we might be doing a couple things that you wouldn't do with the real operations of a cluster um but we're just doing it here to to bring you through that particular journey yeah and i also found some questions about gmx or can i use other system like promoters like elk stack so what's happened at the cassandra level we do have a agent there a node agent close to cassandra that expose matrix into collect d probe so anything that can connect to a connect d probe could read the the metrics so that includes elka with some polling um i think logstash can can plug to collect these stuff and get things elk logsdash splunk yes one of my favorites i haven't actually been splunking for a while that splunk was awesome um by the way while we're waiting for the prometheus operator just something to point out here um so this is just kind of a depiction of what we've been doing today right so from what we've learned in previous weeks about cassandra and and what cassandra is right if you see up here in the top um we've got our cluster you have our data centers you have some racks nodes whatever now in this case we have very simplistic case with just one and three node uh data centers in a cluster but we're essentially taking this and we are putting this we're implementing all this within this kubernetes space so that's what we've been doing today yes and we have this fun bitmoji of cedric saying yes he chooses to accept it and again talking about some of the features of the cassandra operator right and hopefully you're seeing some of those making configuration changes right it'll automatically handle the road rolling restart um it's you know the seeds and the way that's handled with rack awareness if you're using racks it'll automatically handle your seed configuration for you even in the basic cluster without the rack it will handle your seed configuration for you um and it also gives you options as it says here uh things like if you um where you're storing data in a rack safe way to ensure that you have one replica per cloud az you know still scales up racks evenly with your new nodes all sorts of things it'll automatically replace your dead unrecoverable nodes i mean all this kind of stuff is stuff again you'd have to manage yourself if not using the operator and we're just doing that and this is just essentially kind of depicting the places that we've gotten to but i'm going to skip some of these just because um we've been skipping over some of the material a little bit and let's see where are we yeah but for you to look at the slides this is what we create step after step you see the resources created in the slides yeah that's pretty neat as well yeah and if you want i mean it's gonna oh did it oh yeah i didn't think so yeah by the way if in fact you are at the step where you are creating the prometheus operator and then you go okay i did that and then you go to create the instance and you see this right here all it means is the operator the prometheus operator is not up yet right this one does take a moment to come up and some of them do right if you think about it you've got to pull down resources you know these are containers inside of them right you're running actual real applications and everything so what will happen is when we're watching our pods up here once that is ready you'll actually see a pod show up um and then it will start start up and you'll see it says change so if you do see an error like this all it means is the prometheus operator is not up just yet just gotta wait a little bit longer and then it will come up yeah that's something i when we were first doing these i remember i was like running into that i was like oh duh the operator's just not ready is all it is so once it once it comes up you'll see it so question uh cedric or patrick do you see any interesting questions or anything while we're waiting uh at the moment this is simply congrats because most people like the content so that's make us very happy you know um i think i think you're ready to go i'm catching up with a question yeah yeah i i think in general here what i'm getting from today's workshop is that a lot of every everyone is pretty new to kubernetes um and i'm excited that you're giving it a go yeah um continue this journey if you would like to know more let us know in the chat let us know in discord like he here's some topics we'd really like to know more about we're very happy to teach more of this do more workshops and be specialized especially um i know this is a new topic for a lot of folks and um it is the future okay that's all i heard okay cool all right still waiting for mike yeah this is this is like my favorite part waiting for the the one thing is the prometheus operator once it comes up it's all like smooth sailing from there so somebody does have it sometimes yeah someone does have a question i saw a couple questions about um what is prometheus and grafana right um so while we're waiting for the operator i'm actually gonna scroll down here to the bottom we have some images to at least give you an idea um so prometheus is a really nice tool that you can use to kind of like scrape data and pull it from endpoints in this case it's going to be our our nodes right our cassandra nodes so once this thing comes up we'll be able to let's see if i can get this image going oh that's not gonna work at all it'll be better when i can actually that was anticlimactic right there uh i was hoping for a better uh more zoomed in image but if you get an idea imagine all the metrics that might be available on a system things like you know disk storage cpu utilization in the case of cassandra there's hundreds of things you could be looking at and prometheus is going to be the tool that you use to talk to that right over collecti and be able to to pull that information now prometheus does offer some basic graph capabilities you can kind of graph whatever it's not very pretty though and it's it's not i don't know if patrick cedric if you have anything you want to counter with that it's it's not the tool i would probably use to do my analysis it would be the tool i would use to figure out what metrics do i have available and what data is there you know totally that's simply the backing store for time series so properties is really storage and also collect so you do have some probe that will collect matrix coming from outside putting there in prometheus basically why and this is the reason why we most people use also graphene yeah connecting the rest api coming from prometheus to draw some nice dashboards right and that's what we're seeing here so these grafana pictures again these are in the uh the github repo and the readme so now we've got prometheus there and between our nose and prometheus it's collecting the data grafana talks to prometheus and then plots this stuff very nicely right and yeah something that we can do something with right and act on by the way my operator is up as i mentioned before here it is we see i have the promote this operator so now i can start that instance and yeah so you might notice that even prometheus and grafana work the same as the cast operator meaning we need an operator the basic primitive accumulated this are not enough to under the prometheus you know now when you want to deploy complex applications most of them you are using operators yes and by the way as i'm just going through i see a question in here how is dse op center different from these grafana dashboard cassandra that's a great question op center is a monitoring management platform for data sex enterprise right yes there is some monitoring capability in there there is some dashboards that you can use to pull out data from the metrics the big difference and this is something i'm so glad you asked this question um the big difference with what you're seeing or what you're just about to see with prometheus and grafana in the metrics collection is that in op center you have to understand and learn what out of a a ton of metrics that are available to you via cassandra which ones are meaningful right you have to do things with that you have to do that yourself the experience that has been tailored or curated in the metrics collector what we're going to be doing here with prometheus and grafana you the dashboards that are provided have actually been more curated to give you metrics right off the bat that are meaningful for you right away with your cassandra right um also op center has all sorts of management pieces in there right i can start in stop nodes i can apply configuration i can use lifecycle manager i can do all sorts of things that's not what graffana does right it's just the visualization of the metrics so you have op center is monitoring and management where prometheus and grafana are really on the monitoring metric standpoint they're not for managing your cluster hopefully that answers your question there okay so by the way we recognize we're at time right it's it's at two hours um i would gander um we probably need about another 20 minutes to get to a point where we actually spun up the rest of the the dse nodes with the metrics collector um obviously this will be recorded so if you uh you know you've got a hard stop at two and you're like okay i've had enough of this for today you can just continue to watch on later yeah do this for homework but we are going to continue on and we're going to get to a point where we can actually show you the full connection so you can kind of see the end result here okay and with that so if you notice um i did go ahead and create the from the prometheus instance that's easy for me to say in the service monitor i'm going to do the same thing for grafana can you install opsiner with grafana and prometheus you know could you technically do it um probably but i would say that and i'm very curious to see what patrick and cedric think on this i would say that using op center with something like kubernetes kind of defeats the purpose i feel like they're not completely mutually mutually exclusive but a little bit why because if you think about it some of the very things that i would do with op center like a rolling restart of nodes applying configuration those are things i can do right here with kubernetes um with configuration right so i feel like in some ways they'd be kind of acting against each other um i don't know if you guys have any feelings on that one the to my point of view there are two parts in op center and it's only available for data sax enterprise right and your operator works with also with ss customer but in op center you do have what we call the life cycle management yes indeed doing the rollback uh during the the backup the rolling restart updating the config checking if all the parameters are okay all right that's kind of overlapping uh what but in obstacle you also have all the metrics you know the prometheus graphana it's it's already done by upcenter so that's enough center was there before kubernetes became a thing so we do have both but if you are running in kubernetes i think you would rather leverage on graphing a prometheus rather than the op center yes yeah i would totally agree cool okay so with that now if you may have noticed i just went very quickly down um and i just applied the operator for grafana the data source now here are these dashboards um there's a whole set of them funny enough we're only going to use one of them we really i think we need to update this to only apply the one but there are a whole set of other dashboards that are available but like i said there's just one that is currently functional now what we should see here at this point i've applied the dashboards and again the dashboard will make sense in a second because we're gonna we're gonna see this and then the instance now this last part when i look at the services in my cast operator namespace i should see you should have noticed up here in my watch a bunch of these a bunch of these pods and everything we're showing up with all the different pieces so it should look something like this if you have cast operator right i should have my web hook service microphone operator metrics all these services and operators that i started up now the last part here this actually gets into exposing out some ports to the external world so what we just did there is we exposed the grafana service to port 3000 and exposed our prometheus operator to port 99e why are we doing that well because now we'll we'll have the ability to access them so we can actually get into the metrics now in this next section i'm going to look at those in just a moment now in this next section what you do right again if you do this for homework you go through this and for those of you who are asking about things like applying a round robin kind of configuration as compared to terminating all of them you're going to see more examples of that here so in this first case we're actually going to start up three datasex enterprise nodes um and you know that takes a minute to do and then you know you get to look at some of the logs you kind of see how that life cycle looks and everything we go through and we do some of the same stuff uh where before when we worked with the secrets if you remember we had a secret that we had a username and password with a secret or that was being stored in the secret um for a cassandra cluster we're doing the same thing for the dsc cluster this is exactly what this is so we go through some of the same mechanisms that we did before where we start up that cluster look at things with dac tool status or no tool status how you however you want to do it and really just kind of see that we have our three node cluster i'm skipping all this for now right and just in lieu of time so what i'm going to do is just go ahead and blow your mind section this is the part to me for especially for anyone who's ever administrated a cassandra cluster before and you have struggled to figure out how you want to do things with metrics or whatever this is one of those areas that is like there's magic here and it is totally cool um which is this is now we've started prometheus and grafana but we haven't oh what's up patrick oh i'm sorry i thought patrick's like david no what do we need to do yeah yeah and then next time i'll just mute my i don't want to take it oh that was great that was great so at this point we've started up the operators but we haven't we haven't hooked it all together right and so now we're just about to do that so i'm just skipping ahead a little bit and what this would have done this enable metric cml this is if you take a look at the configuration you'll see that we have first our three dse nodes that we start but when we enable the metrics we essentially change the configuration to just add this in why don't we go ahead and look at that real quick so we're going to prometheus grafana and dse mini enable metrics oh now you're messing with me yeah i just wanted to see if you still responded okay i mean are you surprised if i don't or if i did do you see no it's a i count on it it's actually entertaining people i think maybe all right all right so here's what i want you to notice so here again you know we we changed from cassandra to deus ex enterprise it's still cassandra under the hood except for with the added deus ex enterprise stuff on so you might notice some different things like our version and such but that's not what's different to enable the metrics collector in datastax enterprise is what you do right you actually add this configuration in here where you're setting this prometheus configuration that's it though i do this thing as long as you know obviously i've got the prometheus operator i've got all that in place then when i apply that it's going to start these nodes up with that configuration if i had three nodes existing it would have gone through and round robin done it where terminates one brings up a new one the new configuration so on and so forth right so in this case though we're going to see it's going to initiate these three pods this is going to take now this part is going to take about 11 minutes um these are full on dse nodes right i'm starting three of them on a single machine i have a pretty powerful machine but in in real use um i probably wouldn't run three dsc nodes on a machine of the size uh yeah yeah especially when used yes and doing some call with both me and patrick and also you know all that stuff you are doing yeah yeah why not i mean let's just load test the entire suite um yeah now while we're waiting this is like one of those extreme computers yeah right right yeah totally so while we're waiting um something we can do you can see i don't know if you guys can tell but my you can tell i'm my machine's lagging just a little bit because there is a lot going on all at the same time um because you're trying to run like you're trying to run an entire aws yeah yeah that and uh our vision our video software and the streaming is the truck mentioned so it's a lot um but um so you asked what grafana and prometheus are right so again we can actually start to look at these tools remember i exposed those two ports we exposed them up here three thousand and ninety ninety so notice if i go to local host three thousand and ninety ninety these tools are here now let's just think about what happened here for a moment okay cedric what you got no no moment of truth yeah yeah so if you think about what just happened here you just execute command from 20 minutes now so let's see yeah well i got to wait for these guys i'm waiting for these yeah exactly yeah right you guys been watching me like pace stuff forever um so the the point i want to make while we're waiting for these real fast is if you notice i did not manually have to install these i didn't go and download a tarball or a zip or do anything like that right this as part of what you get with things like docker and kubernetes there are images that exist out there that were automatically pulled out i hadn't touched that as a black box right so now i have a grafana black box i have a prometheus black box but yet they're being networked and configured and you know connected together so cedric what were you going to say what are you going to say i don't know let's go for it you know we're running already i hope we get all the metric and everything yeah so what i'm going to do um now i already know what the username and password are but i just want to point this out once you get down to the grafana step i mean it's admin secret exactly we do have it here i was going to say you might as well just say that because everyone's going to be like what's possible but it is there in the docs i swear to you it's in the docs um now at the moment not admin admin like everyone at the moment we don't have any data right uh if i go over to prometheus and say status targets by the way everything i'm doing is actually in it's in the readme right that hasn't changed um so if i do this these aren't going to be hooked up just yet our pods are still initializing things you know things aren't completely glued together um what's going to happen though is as our nodes come up and as they have the prometheus configuration then they're gonna start to hook up you're gonna see that prometheus you know there's gonna be like an auto discovery that happens you know they're gonna they're gonna hook up and once that happens once these change to up then you will start to see data show up in rafana we can actually do some over metrics but we do have some time left for these it's going to take them another six minutes most likely to come up and cedric and patrick go completely silent oh patrick you got really small i just i oh i don't know what happened to patrick i'm like you stopped so big and now you're so small we need to close up or you would there you go here this is really sad i mean i'm like i feel like i'm getting abused on here um oh look and you're sharing your entire desktop which you're getting slack yeah wonderful and and yes i was just reminded to um please uh ensure to like and subscribe uh the videos and subscribe to the channels uh we're not quite done yet again for those who are staying with us we're just gonna finish this off um but please subscribe because if you subscribe you'll get notifications of not just this content but all sorts of other content that we have um so that's that's good to do and like the video unless you really hate us don't hate us no if you like it yet please well subscribe because we're constantly putting out cool new information and you're gonna miss it yes and especially i got a question about uh can you do content about graph and you know what david over there doing some graph live stream every tuesday so yeah you should check these out on the youtube channel if you don't want to miss anything yes subscribe yeah that's why you subscribe so you know as a matter of fact for those who are asking about graph since you happen to see my whole desktop we might as well just go for it while we're waiting for those nodes i will go ahead and every tuesday at 12 o'clock eastern time we have our graph code with denise and david where dr denise gosnell who is if you don't know who that is uh she is definitely one of the most knowledgeable people i know uh with graf we go through they actually denise and matthias have released an o'reilly book that if you're getting in a graph you're doing things with graph are probably one of the best primers i've ever seen to getting started with graph and not only does the book really break down graph databases but they created a github repository that have if we go ahead and say github graphbook i'm totally plugging while we're stalling for uh waiting for these to come up yeah so if you go to um github graph book i'll drop it for those who are interested in the graph stuff i'm dropping it in both chats um this this repo actually follows the book and it's not just that it follows the book but it comes with docker images that you can use to load up deus ex enterprise with graph everything completely all baked and loaded for you and a whole set of notebooks that you can step through all of the different examples it is one of the best resources i've ever seen for getting started with graph and with that you'll notice here if you take a look at our um our videos and our channel this is another reason to subscribe you'll see this graph data and code and you show that you'll see those show up in our video so go take a look right give us feedback by the way let us know what you think about that content um because for those of you again and we could get a lot more likes that would help us a lot um you know when people are looking for information about graph or cassandra or kubernetes um the more likes we get the more we're gaming the uh google algorithm and you're helping other people find useful information if you really think this is good yeah let's do it yeah and actually i see gaurav asked a question hey um please send us the graph book um you know i don't know i don't actually have any of those patrick um i yeah it might be on our website i think we might have a pdf download there's something like that i honestly don't know um where that is i should probably find that one out myself yeah it's uh so we're getting close by the way we're getting close notice that i had one switch from upon initializing two running we're just waiting for you yeah i know you know i've allocated a lot of ram and cpus to this thing we're gonna have to get you like a one of those like ryzen thread rippers and you know it's like what does it have like 48 thread or 48 cores you're gonna have no expense a better laptop i guess all right i'm getting i have a gaming laptop that is amazing it has it's a alienware r15 or r16 and that is a really fast laptop but it's also it has like two hours of battery so i'm getting hit for graphic uh urls now folks like oh wonderful okay we're gonna try to get you a link for that by the way i also see this is a this is a neat point by emit in youtube how about creating videos and key questions on data stacks if it's not part yet um now admit art are you meaning questions when you say key questions like what is graph or or when you say data set do you mean deus ex enterprise you're just talking about cassandra in general oh and about cassandra ripper [Laughter] oh by the way reaper we've been cast cassandra 4.0 i think now yeah i heard it i heard about it that would be part of cassandra followers created by spotify uh now managed by tlp i didn't realize that yeah hi to alexander de jabotsky who you know managed most of reaper yeah that's a pretty nice tool to do yeah pamela's like all your processors are running now it's so close you notice by the way the ready state they're not quite there but it's so close so close it's gonna happen oh see so we have one that went to ready two two now it's up so wow it's exciting to watch yeah right now it literally just came up right so we need to give it a moment oh yeah well amazingly you have 350 people still hanging out on the live stream so they're really i like radios [Laughter] oh this is great but this is like you know this is what we're shooting for here and we're almost we should be getting close let's see do we have oh oh look yeah so dana's showing up oh yeah yeah we have us a grab so okay wonderful wow while yes no no while this is loading and everything like that just to kind of take a look now for those of you who are asking uh some op center questions or familiar with some of the metrics in cassandra right and i made that comment earlier that um you know there's a lot of metrics in cassandra and if you don't know what to look for at first it can be kind of daunting like where do i start what do i look at well like i mentioned the metrics collection capability in prometheus and grafana it's not just slapped together like here's promises and grafana and go figure it out these have been curated right so the metrics that are here in fact have been curated to give you a better starting experience of what kind of things do i need to look at now admittedly as you start your way down you're going to notice there are a lot of metrics in here this is not you know it's not for the faint of heart but they are all of them they are going to be relevant metrics right so it saves you that step of having to really like dig through all the different types of measures that are available to figure out what you might need so i would say this is a really good place to start and kind of look at the metrics that are here and get a feel now some of them you may or may or may not ever care about um but there's some like hints or um you know if you're you know if you're adding data centers you want to look at streaming or something or repair metrics things like that those are going to be good to look at right and all you have to do obviously for any of these is just open them up um and david um i would like to point out also we just did a recently we did a blog and some video on a product that we're getting ready to release called faster so vector is our first shot at ai operations meaning all of these configuration values with the metrics you get out of it you're right there's a ton of them but what vectors mean meaning to do is to collect them and give you like an expert level advice about okay here you're you may have a performance problem here's what we suggest to fix that and it'll give you the a and the b um it's like having uh an expert cassandra expert sitting over your shoulder telling you what to do um it's pretty amazing so uh just look you know look for that information it's coming soon but it's all in preview right now yeah and and you know i actually had a conversation with someone on the admin side the other day we were talking about that very thing um and some of the questions he was asking was like you know i how do i know what to look for right how do i know what parameters i need where are the anti-patterns like how do i know what to look for and that's actually something that i'm really excited about for the whole vector piece it was insights before right is that you can look at your your data model and it will let you know if you were you know if you've exposed any anti-patterns and then not only will it tell you that it'll actually give you the links to the docs and like what you can do about it how do you rectify this um there's like some really cool cool stuff there i'm excited okay so check it out all of the processes now are ready are these three nodes already two two estate come back over to my prometheus boom they are all up so if i come here i should start to see if i look at the number of connections clients connected yeah right right you can see the number of clients connected is going up right so obviously there's going to be a little lag behind where grafana is compared to um what's actually being reported out it's not too long but then you start just there goes boom right so now we have all three nodes that are in place and hooked up and talking and that is all completely in my kubernetes cluster right so that is all available there and again i didn't have to manually hook these up yes there's configuration and such but kubernetes is managing this for you and what's even cooler what happens if i lost you know a pod where microphone was or something well guess what kubernetes is going to heal that that's going to bring it back up it's going to reconnect i mean there's just so much coolness factor here but anyway finally that was it um pretty much this is where this particular this week brings you right it brings you to the point where now you've started a couple one cassandra cluster one day sex enterprise cluster you've changed configuration on the fly you've applied some metrics now you're able to do that and then essentially what we do is we finish up with someone was asking earlier well how do i clean all this stuff up right spend all this time to start it and then we're gonna stop it um yeah so then we do provide you the scripts here as well to actually bring these down and uh and clean everything up and get back to your regular state i'm going to free up all the processes on my machine now and you'll start to see things terminating yeah and yeah i think you can go back to slide and i do have two slides yeah which ones which ones you want uh yeah show me back to slide 15. let's go just fifty this one all right okay here you go yeah so the homework for this week uh yeah so the homework for this week uh we didn't put a lot of stress to you we simply ask you to finish the exercise so the cluster will be terminated in 24 hours we have so many if you need more time send an email to alex volosnef daddastak.com we have provided an email and i'm probably sure we will do it again pretty soon validation form of the week you would see is only question from the session today and this exercise pretty easy and i simply had an announcement to to to make for astrakhan so if you go to next slide so we have looked at the agenda and you know the last session of the eight weeks workshop would be august the 20th it's a thursday so we will we ask you put at the end date the august 20th okay 12 psd 12 pm pst last date for submission for the accountant so remember real money to win and i just announced as well that there will be a surprise week night okay called i ask me anything ask you anything it's just jamming a con convo all together just really just have fun where we will announce the winner so we would have sixth day between the last submission to this um eight you know week ninth to get excited and do some jokes and fun and we will we will have a lot of mention of doing it's all about fun you know we've been making you guys you all do homework you know all these weeks and if you want to get a chance to make us do homework then submit an application to the ask trackathon because then we have to go through it all in that six days so the more submissions the more work so bring it on bring it on yeah yeah yep yep yep um all right that was my message for the end do you have something to add folks no i think you know if anything i just want to say thank you everyone for staying with us today we we totally understand if you've never been introduced to things like kubernetes and docker right um it can can feel like a lot at first kubernetes itself is a complex beast but it's also extremely capable and flexible and allows you to do some seriously cool things um so this is just to start right again go through the homework take a look you know we give you the steps um and all the documentation links and everything like that and you know kind of go through it on your own if you can and you'll get kind of a feel for for how long it's working yeah we're getting uh we're getting a lot of questions about the um inside the hackathon if you look on discord there's a link there um i would love here's so this is my personal place i want to make you famous and i want to give you money for doing something really awesome we haven't had a hackathon in cassandra world in a long time this is an interesting time to do it too because there's so much cassandra happening in the world right now um this is a great way to get noticed if you're trying to upgrade your job situation winning a hackathon with cassandra would be a really good yeah that's a good point that's a really good point yes yeah so with that let's like i said bring it on bring on your your hackathon code make the submission again as always if you have any questions or anything chat with us on discord reach out to us on linkedin right um you know there are all sorts of ways we love to chat yes yeah we love to chat we love the feedback we try to improve step after steps so reach out to us one two one chat yeah we we we really need uh your feedbacks about the world absolutely with that everybody thank you so much for joining us today i appreciate you staying on with us for a little bit extra time for us to get that final win and um everyone take care and we'll see you next week see ya goodbye thank you very much bye imagine a being gifted with powers from the goddess of cassandra who grew those powers until she could multiply it will move with limitless speed and unmask hidden knowledge with those powers she was able to fully understand the connectedness of the world what she saw was a world in need of understanding from that day forward she sought to bestow her powers on all who came into contact with her empowering them to achieve wondrous feats
Info
Channel: DataStax Developers
Views: 5,704
Rating: 5 out of 5
Keywords:
Id: GYb4Do3BXOM
Channel Id: undefined
Length: 154min 29sec (9269 seconds)
Published: Wed Jul 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.