Over a million developers have joined DZone.

Getting Started With K8s

DZone's Guide to

Getting Started With K8s

This series on Kubernetes kicks off with some basic K8s setup, configuration, and commands to get your container orchestration working.

· Cloud Zone ·
Free Resource

Discover a centralized approach to monitor your virtual infrastructure, on-premise IT environment, and cloud infrastructure – all on a single platform.

Kubernetes, also known as K8s, is a well-known container management solution. The main advantage of Kubernetes that it is open source and production ready. The other advantage is that when there are multiple instances or deployments, they become very difficult to manage manually and require great tools like Kubernetes.

For those who are new to Kubernetes, I will be writing a series of posts as part of the Project Calico blog.

This blog will demonstrate an easy way to run Kubernetes on a Windows machine.
To start with, we need Minikube, which is a tool that makes it easy to run Kubernetes locally.

The very first thing we need to do is to download minikube-windows-amd64 from GitHub. Then, it needs to be renamed to minikube.exe.

We also need kubectl.exe from here, which controls the Kubernetes cluster manager and puts it on the same path.

Getting Started

So, we are ready to start. We will get into the command prompt and run: minikube start. Then, we should get the following:

Image title

So Kubernetes is ready to go on our system!

We can now run the following command to test the status — minikube status — and should get the following:

Image title

Which shows that Minikube is ready and running, and also that kubectl is configured!

If we run the kubectl cluster-info command, we will get the information of our cluster:

Image title

Then we run the kubectl version command to get the client-server version of kubectl.

Image title

We can get the IP address of the cluster using the IP command, minikube ip:

Image title

We can start the dashboard, which is a web console, using minikube dashboard as follows:

Image title

The dashboard will open as follows:

Image title

If we just need the dashboard URL without starting it, we can use minikube dashboard --url=true , which will display the URL:

Image title

We can check the current deployment using kubectl deployments, which will display No resource found, as there is no deployment:

Image title

Let's create a new deployment from the console dashboard by clicking create on the top right:

Image title

We will fill the App-name as test-app and pull a Docker image from DockerHub. This time, let's take a Mule docker image and pull it from there:

Image title

If we check the dashboard, we can see the image is deployed and the Mule runtime server has started:

Image title

We can, at last, use kubectl delete deployments to delete a deployment and minikube stop to stop the minikube in the system.

Thus, you can see it's very easy to use Kubernetes to manage your containers. There are lots of other things that we can do with it, which we will discuss in future articles.

Learn how to auto-discover your containers and monitor their performance, capture Docker host and container metrics to allocate host resources, and provision containers.

cloud ,container management ,kubernetes ,docker ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}