From the course: Google Cloud Professional Cloud Architect Cert Prep (2025)
Running minikube
From the course: Google Cloud Professional Cloud Architect Cert Prep (2025)
Running minikube
- [Narrator] If we take a look at the official documentation for Kubernetes, you can see there is a section called Hello Minikube. And it has a tutorial that walks you through how to set it up in a environment. One of the better environments to explore Kubernetes and containers is GitHub Codespaces. So I have a repo here, nogibjj/coursera-applied-de-kubernetes-lab. And if we select this code icon here, you can see that if I wanted to, I could create a new codespace. But since I've already got one enabled right here, I can actually go ahead and switch over to that codespace. And this allows me to run both Kubernetes via Minikube and also compile docker containers. So let's go ahead and take a look at how this would work. So if I go over to this environment here, you can see there's a series of steps. And the first thing that I'm going to do is I'm going to either push a container in the case of my own deployment or I'm going to use a pre-existing container. Since I'm going to go through the official tutorial here, I'm going to go ahead and select minikube start. And this will start the Minikube system locally in this environment. And again, what's so great about GitHub Codespaces is I don't have to worry about creating runaway processes on my machine. It's in a hosted cloud-based environment and it's actually mapped directly into the repo that I'm working on. So it's a very good one-to-one relationship. And actually while this is launching and running, another thing I could do is I could create a new terminal and I could also monitor what's happening by running htop. And this is always a good way to see what's happening on your machine. And you can see in fact that it's preparing Kubernetes. And if I run this, we can see, there we go, look at all those resources that are actually being run. Now this is a very powerful machine. It's a 16-core machine here and it has lots of RAM, but in this particular scenario, we've been able to get this thing started. Now that Minikube has started, we can also enable the metrics server here. So if I type in this command or just paste it in here, we can also start this metric server. So the next step would be to go ahead and create a dashboard --URL, so we can take a look at what's happening. All right, now that we've got this dashboard here, what we can do is also open this up inside of GitHub. And if I follow this link, you'll see that it's able to show us a very comprehensive dashboard here. That's pretty neat. That shows us what's going on in terms of our Kubernetes cluster that's running locally here. So we have workload status, we can see there's a deployment, a pods, a replica set. And from here we could just go through and play around with the different things that are running. You can see that there's a pod right here called hello-fastapi, something I'd set up earlier. And we can also look at different services as well. And what's useful about this is that I can basically control my entire system by looking at this dashboard. Now what else can we do here? Well, the other thing to do would be to go ahead and create a deployment for our service. So let's go ahead and do that. So I'm going to create a new deployment here and this is using a default container that lives in this registry called registry.k8s.io. And if we go ahead and paste this in, there we go. The deployment is created. Now I could look at the deployment one of two ways. I could actually go through here and look at the dashboard if I wanted to by looking at the deployment. And we should be able to find it there. And there we go. We see it's hello-node right there, or I also could do it from the terminal. So if we go through here and we run this, we can see that kubectl get deployments. You can see I have two deployments that are running. I also can go ahead and do the same thing from the terminal as well. Say get pods and we see the pods that are running. And then if I want to expose the service, so basically use it, I can also go through here and paste this in. Now that the service is exposed, I can also view it from this kubectl terminal right here and there you see where it is. And then I can also go ahead and look at what is the actual service that I would actually want to connect to. And so in this particular location here, one of the things that we can do is grab in exactly this IP address here and go ahead and pull it up. Now there is another command that we can do that's kind of a nice little command to do. And it's basically this minikube service --url. And so I'm going to go ahead and type this in here. So I'm going to go ahead and say minikube service and we're going to call it the service name that we created earlier. And this will show me the URL that if I wanted to preview it, I could communicate with. So again, because I'm in GitHub here, I could just hover and wait till the follow link shows up. Go ahead and select that. And it says, do you want to open to an external website? Let's go ahead and do that, and we'll be able to see our running service. Finally, another thing we can do is we can also just curl this and get access to the service. There we go. We see that the service is active and it returns back a timestamp. Now to clean things up here, what we could do is run these commands to get everything stopped so we can say hello kubectl delete service. Let's go ahead and run that. Let's go ahead and stop the deployment. Let's go ahead and run that. And then if we wanted to, we could also stop minikube as well.
Contents
-
-
-
-
-
(Locked)
Integration, containerized microservices, Kubernetes and GKE, compute choice, storage choice9m 48s
-
(Locked)
Using Google Cloud Functions6m 45s
-
Running minikube6m 37s
-
(Locked)
Running minikube with FastAPI for Kubernetes development7m 23s
-
(Locked)
Getting started with Google Cloud Run4m 42s
-
(Locked)
Load testing with Locust3m 25s
-
(Locked)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-