Menu
O mnie Kontakt

W najnowszym filmie na kanale "Just me and Opensource" autor zabiera widzów w podróż po narzędziu o nazwie kubedoom, które łączy grę komputerową Doom z nauką zasad działania Kubernetes. Wspomina o swoich doświadczeniach z grą Doom w dzieciństwie, wyjaśniając, że mimo iż nie jest najlepszym graczem, pomysł połączenia nauki z zabawą jest dla niego bardzo interesujący. Idea kubedoom opiera się na testowaniu odporności aplikacji na Kubernetes poprzez zabijanie podów, co zapewnia zarówno rozrywkę, jak i praktyczne korzyści.

Autor szczegółowo przedstawia, jak skonfigurować klaster Kubernetes, używając Rancher K3D na lokalnej maszynie, oraz nadmienia, że istnieją również inne filmy na ten temat na jego kanale. W filmie omawia instalację Nginx jako przykładowe wdrożenie oraz przedstawia potrzebne oprogramowanie, w tym Docker i przeglądarkę VNC. Tutaj podaje konkretne wskazówki dotyczące uruchamiania aplikacji w Dockerze oraz połączenia z VNC, aby uzyskać dostęp do graficznego interfejsu gry.

Po udanym skonfigurowaniu klastra oraz uruchomieniu gry, widzowie mogą oglądać zmagania autora, który stara się zabijać potwory, które reprezentują jego pody w klastrze Kubernetes. Zwraca uwagę na możliwości korzystania z cheats, aby ułatwić sobie grę, co również dodaje element zabawy do jego nauki. Autor zmaga się z wieloma potworami, co ukazuje nacisk na wytrzymałość i administrację klastra na poziomie zabawy.

Podczas gry, autor wyjaśnia kierunek i strategie, jakie stosuje w celu przetrwania, a także demonstruje, jak można dostosować grę do własnych potrzeb. Zmieniając nazwy przestrzeni, może wywołać różne ilości potworów, co wpływa na trudność gry. Wśród komentarzy znajduje się wiele śmiesznych, osobistych wstawek i frustracji, które czynią ten film nie tylko edukacyjnym, ale również zabawnym.

Na koniec filmie autor zwraca uwagę na statystyki, które są na poziomie 9110 wyświetleń oraz 190 polubień w momencie pisania tego artykułu. Podkreśla, jak ważne jest łączenie nauki z zabawą oraz eksploracja nowych narzędzi, aby rozwijać swoje umiejętności w obszarze IT. Zachęca widzów do subskrybowania kanału, aby na bieżąco poznawać nowe, ciekawe tematy.

Toggle timeline summary

  • 00:00 Wprowadzenie do wideo i narzędzia kubedoom.
  • 00:04 Przypomnienie gry w Doom i koncepcja nauki Kubernetes.
  • 00:30 Wyjaśnienie testowania odporności aplikacji poprzez strzelanie do podów.
  • 00:41 Rozpoczęcie demonstracji i sprawdzenie klastra Kubernetes za pomocą kubectl.
  • 01:15 Przegląd lekkiej konfiguracji klastra Kubernetes.
  • 01:48 Tworzenie prostego wdrożenia nginx do zabawy.
  • 02:21 Wprowadzenie do kubedoom i jak integruje się z Dockerem.
  • 03:43 Wymóg użycia klienta VNC do połączenia z interfejsem graficznym.
  • 06:30 Szczegółowe polecenie Dockera do uruchomienia kubedoom z zamocowaniami.
  • 07:38 Tworzenie wdrożenia nginx do gry.
  • 08:21 Instrukcje dotyczące łączenia się z klientem VNC.
  • 09:00 Testowanie początkowego połączenia i elementów rozgrywki.
  • 13:55 Decyzja o zakończeniu gry po niepowodzeniu w nawigacji.
  • 14:19 Ujawnienie kodów oszustwa, aby szybko awansować w grze.
  • 15:41 Zastosowanie kodów oszustwa i omówienie mechaniki rozgrywki.
  • 20:50 Podsumowanie doświadczeń z rozgrywki i wideo.
  • 21:23 Dyskusja na temat używania kubedoom do testowania odporności w przestrzeniach nazw.
  • 21:44 Ostateczne myśli i zachęta dla widzów.

Transcription

Hello viewers, welcome to this video. In this video, we're going to take a look at an interesting tool called kubedoom. So when I was a child, I remember playing this game doom. I don't know how many of you remember playing this doom game. I was not a very good gamer back then, even though I'm not a good gamer, but it sounds like an interesting idea to learn Kubernetes as well as to play your interested games. Okay, so there we go. So we have doom here, and we have our Kubernetes cluster. The idea here is to test the resiliency of your application by killing pods randomly by shooting pods. And so you are testing your applications resiliency as well as having some fun playing the games. Alright, so let's get started. I'm going to move that to its own workspace so that we get a bigger terminal. And let me show you my Kubernetes cluster, kubectl get node. So I've got a three node cluster with one control plane. This is running using ranchers k 3d kubernetes in Docker containers and a video about k 3d couple of videos actually about k 3d in the past. Okay, so if any of you are interested in k 3ds, just search in my channel for rancher k 3d. And you will get some, I think two or three videos around on k 3d topic. Okay, that's about k 3d. So we have a working cluster, I haven't got anything else. If I do kubectl get all in the default namespace, that's the the kubernetes service. That's it. I don't have anything else. I do kubectl get pods dash a sorry, dash a for all namespaces. You can see basically it's a it's a very lightweight kubernetes cluster, you can't expect a fully blown kubernetes cluster with ranchers k 3d. But it does its purpose. So we've got a cordiness, we've got local path provisioner, metric server and traffic. Okay, so that's not the point here. So we have a working kubernetes cluster, we're going to create a simple nginx deployment and play the doom game. Okay, for this, what you need is, as I said, you need a working kubernetes cluster, it can be anywhere, it doesn't have to be in your local machine. So my kubernetes cluster is running on my laptop here, but it doesn't have to be on your local laptop, you just need the ability to be able to connect to a kubernetes cluster with kube config file. Okay, so let's take a look at what kubedoom is and how we go about running them. Okay, so if I just search for kubedoom, this one storax kubedoom, the github link here, so that's the one and basically what we will be doing is running a Docker container locally on our machine and it's going to mount we are going to bind mount our dot cube directory to slash root dot cube the roots root accounts dot cube directory inside the container. So the container will have access to the kubernetes config file like what you have access in your host machine, the container will have the access because we are buying mounting the dot cube directory. Alright, so like I said, the kubernetes cluster can be anywhere in your dot cube directory, you have the kube config file, if you can connect to any kubernetes cluster from your machine using the kube config file, so does the container. So the container will have access, whatever access you have in your kube config file, if you have cluster admin, if you have admin access or anything, make sure you just use the right kubernetes cluster, you don't want to be running kubedoom against a production kubernetes cluster. Okay, so double check your kube config file. So that's what the Docker container will be using the kubedoom image will be using. Okay, and apart from having a kubernetes cluster and Docker installed on your machine, because we're going to be using Docker to bring up the container, you also need a VNC viewer. So when you run this Docker container, it's going to spin up an application. And then the way to connect to the graphical interface of the application is through the VNC client VNC viewer. Okay, so in my case, I have few so VNC viewer, I do which VNC viewer I have user been VNC viewer. So that comes from the tiger VNC client. So I installed tiger VNC viewer, not the server, but just the viewer client. So I can use the VNC to connect to a remote machine. In our case, this Docker container, the kubedoom Docker container, I also have so when you install tiger VNC viewer, you get this VNC viewer command line. And the the option to connect to the way you connect to a remote desktop is through this command VNC viewer viewer, the server name where your application is actually running and the port where it's exposing Okay, usually it starts with 5901 or 5959, whatever higher ports are. So that's the command line way of connecting to a remote VNC session. Okay. And when you install tiger VNC server, you also get tiger VNC viewer, the graphical thing. And again, you specify the the server name, the port number you want to connect to and you will get connected to it. And apart from that, I also have a remote viewer. Yeah, that's the remote view viewer. It works nicely the interface blends with the the norm team that I've got the GTK team that I've got. So I prefer to use the remote viewer. So what is remote viewer? I do which remote viewer it's user been remote viewer. And if I do apt file search remote viewer, I'm just trying to find which package I installed that provided this utility. And you can see work viewer. So on my system, I have KVM libvert and all sort of virtualization softwares packages installed on my machine. So it's the work viewer package that provided the remote viewer. So whatever VNC client you want to use, make use of it. And I prefer using work viewer and the remote viewer from the work viewer package. Okay. Right. So what next? Let's go back to the documentation. So what we're going to do is run this Docker container, we are connecting to the host network. And then we are bind while mounting the volume, the directory dot cube directory inside the container under slash root dot cube, minus minus RM to remove the container when we exit out of the container, or when we stop the container minus it for interactive, we give it a name. And then that's the image name. And we are using the latest version of the image. Okay, so optionally, if you want to get restricted to a particular namespace, what it's going to do is, when you run this Docker container, it's going to give you it's going to show all the parts in your cluster as little monsters in the cube doom game. Okay, so where is it? So all your parts will appear as these pink monsters in your game. And when you first read when I first ran this the Docker container, because I had a working cluster that had lots of deployments and demon So there were lots and lots of parts, I was overwhelmed with the number of monsters, because basically the number of parts equal to number of monsters. So they killed me within like a couple of seconds. So I wasn't as I said earlier, I'm not a good gamer, especially when it comes to shooting first person shooting game and things like that. So what I would say is if you're starting just go with the default namespace to start with in our default namespace, we didn't have any deployments. Okay, so kubectl get all in the default namespace. There's nothing. Okay, so I'm gonna create kubectl create deploy nginx kubectl get all okay, so container is getting created. So we have an nginx deployment to play with, which has one replica, okay. So if I restrict this cube container to the default namespace, I only have one monster to tackle with. Okay, there's also some cheat that you can do with the doom, which we'll come to in a minute. But first, let's try and run this Docker thing. So it's mapping port 5901 inside the container to 5900 on your local machine. So I don't know why they choose 5900. But if you look at down here, start the VNC viewer and connect to localhost 5901. But it won't be 5901. If you use this option, it will be 5900. Let me show you. I don't know whether they might need to update the documentation here. Definitely when you try and connect to 5901, there won't be anything listening on 5901. It's 5900. So that's the port that's mapped to your host. So 5901 here. So that's the port in the container. And that's the port in your host system. I don't know why the document says that you need to connect to port 5901. Anyways, let me tell you, let me show you how you can connect to it and what happens when you connect to 5901. Okay, so let's copy this command. And I'm going to paste it here Docker run. Okay, so everything is fine. Let's run it. I'm also going to open up another pane so that I can run kubectl get pods. Okay, so we have that one pod one replica from the nginx deployment and we have this kubedoom docker container running. So now we should be able to connect to that container using VNC viewer. So I'm going to use as I said, remote viewer. And as you can see, I've already made a connection and it's showing up in my recent connections list. So it's basically the protocol and the server. In my case, it's a Docker container running on my machine so I can use localhost and the port is 5900. But as per the documentation, if you try 5901, let me actually show you something. Let's start NLTP. You can see there's this port x11 VNC listening on 5900 and there is nothing on 5901. Okay, let me try and connect to 5901 and see what happens. Nothing I'm able to connect to the graphics server because there is no process listening on port 5901. So I wasn't sure why the documentation says you got to connect to 5901 unless there is a typo here if they wanted to port map 5901 to 5901. So instead of one, there's a typo zero, in which case you can use VNC viewer viewer from the command line or you can use localhost colon 5901. But if this command is right, you're mapping the host port 5900 to the container port 5901. So you should be able to connect to localhost colon 5900. Okay, let's connect to it. And it's asking for a password, which should be in the documentation and which is this one ID behold. Okay, let's try that ID. Behold. Okay, so we are inside the game, I accidentally wasted six of my bullets, I think. Okay. Okay, bear with me. I'm not a good gamer. Let's see. Okay, so control is for firing and then you use the arrow keys for navigation. And then these bastards here are not the actual part they start to shoot you. Come on. Okay, that's gone. I think there's somebody behind me shooting me. Let's try. I'm, I'm sure I won't last long in this one, I might be using the cheat to get to the parts quicker. Okay, so let's try I don't know where to go. I think maybe Oh, come on. Okay, that's good. I'm going to climb up the stairs and see. By the way, if you want to pass the game, press escape, and then escape again. To get back into the game. I think if I go here, there should be some somewhere that I can go. No, not this place. Nope, not this one. I actually don't know where I'm actually going. Okay. All right. I think I actually played this game before. It was taking there was a way that I can actually go but I think I forgot where I'm actually going. I think there must be a door to open. Okay, let's see. No, it's not here. Where's the door? Where's the door? Is this the door? Nope, not that one. Okay, let me tell you. Okay, I'll tell you what, I'm not going to play this game because I'm definitely not good at playing these sort of games. So, I'm going to escape and I'm going to quit the game. Press Y to quit. Okay, let's close this. Start the docker container. Let me show you a cheat sheet. Right, you should now see Doom. Now, if you want to get the job done quickly, enter the cheat IDSPISPOPD and walk through the wall on your right. You should be greeted by your parts as little pink monsters. Press CTRL to fire. If the pistol is not your thing, cheat with IDKFA and press 5 times for a nice surprise. Okay, let's go back to the game. I forgot almost one thing. I need to pass somewhere here, anywhere the namespace minus E namespace equals default. Okay, so when I use the cheat sheet and go through the wall, I just save one monster because I'm running just one replica of the nginx container. If I don't specify namespace equal to default, there'll be a lot of surprise. There'll be a lot of monsters waiting for me, which I don't like. Okay, so let the containers come up and here, let us just watch the pod. Okay, remote viewer, connect to the recent connection. The password is IDBEHOLD. Okay, so in here, I'm going to enter the cheat sheet. What's the cheat sheet again? What's the cheat IDSP? Okay, I'll come to that in a minute. But before that, I'm going to apply this cheat IDKFA and press 5. IDKFA and press 5. Cool. So now I've got a bigger gun. Let me fire it once to see how it looks like. Control the fire. Okay, I think it looks okay. So now, before applying the other cheat, let me show you that you can't actually go through this wall without that cheat. Okay, so the monsters are actually on the other side of this wall. So on a normal workflow, when you play this game, you have to shoot all those monsters, all those people there out there, and then there will be a way you need to open up a door and then you have to come around this building to get to the monsters on the other side of this wall. But if we use the cheat, what's the cheat again? IDSPISPOPD. Okay, IDSPISPOPD and press 5. No. Yeah. Okay. Yep. I've gone through the wall because I entered the cheat. Ah, there's the monster. There's the monster. Okay, I've killed and on the left you can see it terminated and the container, new container is getting created. Where is this new monster? There we go. Okay, he's gone and on the left you can see it's terminating and a new container will start because it's a deployment. So as you keep killing the pod or as we're playing the game, as you keep killing the monster, you will see new pods getting created. So that's the idea of this game. I'm going to stay here right in this place and I'm going to keep firing. That's it. It's a safer place for me. So as you can see here, I'm just dealing with one monster, just one pod. If I didn't include the minus e namespace equal to default option, that would be loads of monsters here and they will get me in a matter of seconds. Okay. Come on. Or do you want me to come closer to you? Okay. No. Okay. That's gone. And a new container is getting created. Okay. Lost monster. Okay. Go away. Let me close this game. It's not very interesting, but again, I'm going to show you something else, right? So if I close this kubectl delete deploy nginx and let's say instead of a deployment, I'm just going to run a pod. Okay. kubectl run nginx. So that's just a pod. It's not a deployment. If I do kubectl get all, you don't see any deployment or demonstrate or anything. It has just spun up a pod, which means that it's nothing. There's no controller or anything to watch the pod. So if I kill the pod now, the pod is gone. That's it. All right. Let's run the game again in the default namespace and then go to our remote viewer. Connect password is ID. Behold. And the cheat to go through the wall on your right is I D S P I S P O P D. And now I should be able to go there. And this time I'm not going to apply the other cheat. I'm just going to use this shotgun and see if it actually works. Uh, yeah. Nope. It takes a little bit of time to kill the monster with this gun. Uh, go away, go away. Uh, there he goes. He's gone. He's gone. Okay. On the left here, if I do kubectl get pods, there's no resource found. That's that's gone. That's because it's a pod, not a deployment. So just to show you how it's going to look, um, if you run it without the default namespace, you will see a whole lot of pods. Okay. Let's run that. And here, if I do kubectl get pods dash a C one, two, three, four, five, six, seven, eight, nine pods. Let's see how good I am in killing all those pods. Remote viewer, local host 5,900 password is ID behold. And the, this time I'm going to apply both the cheat one for the weapon ID K F a press five. Okay. We've got a bigger gun and also ID S P I S P O P D. Right now I can go through the pod. And if I go through this wall, sorry, if I go through this wall, there'll be nine monsters waiting to take my life. Let's see how many I'm going to kill. Right? Nine monsters. I'm not sure whether they are shooting at me or not, but that's the fun here. Okay. Not bad. Not bad. Not bad. I think they're not shooting at me. My health is going down. Yeah, I'm down. I'm down. Yeah. It took a good 10, 20 seconds to, for those nine pods to kill me, nine monsters to kill me. But anyway, that, that was a fun. Okay. Hope you enjoyed this video. That's all I wanted to show you in this video. And there's one other thing before I wrap up. That is if you want to use cube doom to kill namespaces instead of pod, you can use killing namespaces. You just need to pause, pause, minus mode namespaces. Let's say you've got like hundreds of namespaces, or let's say you've got like five or 10 namespaces and stuff dealing with pods. You can test the resiliency of your Kubernetes cluster itself by deleting the entire, entire namespace and see how your application behaves. I, I guess when you delete the namespace, that's it. Your application is gone. There is no, there is no resiliency. This is just for game purpose, I guess. Okay. That's it for this video. Hopefully you enjoyed watching me play the doom game. And I certainly won't be doing this so often. It's just to, just for recording this video and show you guys how to use this game. That's it. Okay. I will see you all guys in another video until then keep learning and keep on learning. Bye-bye.