Skip to content

Environment Setup

In this lesson you will set up Kubernetes on your computer. In the Docker Core module, you have already installed Docker Desktop, which provides the ability to locally set up a single-node cluster.

💡 The following setup steps are demonstrated using Windows, but if you are using macOS, the process will be similar.

First, open Docker Desktop and click on the settings icon.

Open the Kubernetes tab.

Select the Enable Kubernetes option and click the Apply & restart button.

Then click Install.

Now you need to wait for Kubernetes to start.

Along with the Kubernetes activation, a tool was installed that allows you to communicate with the cluster and execute commands in it. This tool is called kubectl and is available in the terminal:

Let's run a few commands. The first one will return information about the nodes in the cluster:

To get extended information, you need to add the -o flag (short for output), and the value will be wide:

Now let's check if we have any pods:

There are no pods in the default namespace. A namespace is a way to isolate pods. We can create these namespaces and specify them for specific pods. You can create a new namespace using the following command:

Now let's view all namespaces:

Instead of typing the long word namespace, you can use the abbreviation ns:

Done ✅