> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Demo Setting Up Namespaces for Different Units in the SkyLine Air Team

> Guide to create a local kind Kubernetes cluster and provision per-service namespaces for the SkyLine Air microservices, including prerequisites and verification commands.

Welcome back. In this lesson we'll prepare the infrastructure for the SkyLine Air microservices by creating a local Kubernetes cluster and dedicated namespaces for each service. This guide uses kind (Kubernetes in Docker) to run a local cluster and covers the exact sequence of commands to verify prerequisites, create the cluster, and provision namespaces.

Why this matters

* Namespaces provide isolation for resources and help organize microservices per team or unit.
* Using a local kind cluster lets you iterate quickly without cloud costs while maintaining a realistic Kubernetes environment.

Tools used

| Tool | Purpose | Docs |
| - | - | - |
| Docker | Runs container runtime and kind nodes | [https://docs.docker.com/get-started/](https://docs.docker.com/get-started/) |
| kind | Runs a local Kubernetes cluster inside Docker | [https://kind.sigs.k8s.io/](https://kind.sigs.k8s.io/) |
| kubectl | Kubernetes command-line client | [https://kubernetes.io/docs/reference/kubectl/overview/](https://kubernetes.io/docs/reference/kubectl/overview/) |
| Helm | Kubernetes package manager (optional for later lessons) | [https://helm.sh/](https://helm.sh/) |

Prerequisites

* Docker — make sure Docker Desktop or Docker Engine is running.
* kind — used to create local clusters.
* kubectl — Kubernetes CLI to manage cluster resources.
* Helm — for later deployments and package management.

If you’re on macOS or Windows, ensure Docker Desktop is up-to-date and running before creating the kind cluster. On Linux, confirm Docker daemon is running (e.g. `systemctl status docker`).

Verify prerequisites

1. Check Docker is running:

```bash theme={null}
docker info
```

2. Confirm kind is installed:

```bash theme={null}
kind version
```

Example output:

```bash theme={null}
kind v0.11.1 go1.17.2 darwin/arm64
```

3. Verify kubectl client:

```bash theme={null}
kubectl version --client
```

Example output:

```bash theme={null}
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.2", GitCommit:"9d142434...", GitTreeState:"clean", BuildDate:"2022-01-19T17:27:51Z", GoVersion:"go1.17.6", Compiler:"gc", Platform:"darwin/arm64"}
```

4. Verify Helm (optional for later):

```bash theme={null}
helm version --short
```

Example output:

```bash theme={null}
v3.7.2+g663a896
```

Create the kind cluster

Create a local cluster named `finops-cluster`:

```bash theme={null}
kind create cluster --name finops-cluster
```

Example output (cluster creation can take 30s–1m):

```bash theme={null}
Creating cluster "finops-cluster" ...
✓ Ensuring node image (kindest/node:v1.21.1) 🖼️
✓ Preparing nodes 📦
✓ Writing configuration 🧾
✓ Starting control-plane ♟️
✓ Installing CNI 🛠️
✓ Installing StorageClass 💾
Set kubectl context to "kind-finops-cluster"
You can now use your cluster with:

kubectl cluster-info --context kind-finops-cluster

Have a nice day! 👋
```

Verify cluster

Confirm the cluster exists:

```bash theme={null}
kind get clusters
```

Check cluster information and your control plane:

```bash theme={null}
kubectl cluster-info
```

Tip: kubectl context

* After kind creates a cluster, it sets a kubectl context (e.g. `kind-finops-cluster`). Use `kubectl config get-contexts` to list available contexts and `kubectl config use-context <context>` to switch when needed.

Create namespaces

We create a namespace for each microservice/unit in the SkyLine Air team. Creating a namespace groups the service resources and is a first step toward resource isolation and RBAC scoping.

Run these commands to create the namespaces:

```bash theme={null}
kubectl create namespace booking-api
kubectl create namespace flight-search
kubectl create namespace inventory
kubectl create namespace payment
kubectl create namespace airline
```

Example confirmation when creating a namespace:

```bash theme={null}
namespace/booking-api created
```

Verify namespaces

List namespaces to verify they were created:

```bash theme={null}
kubectl get namespace
```

Example output:

```bash theme={null}
NAME                 STATUS   AGE
airline              Active   28s
booking-api          Active   36s
default              Active   2m43s
flight-search        Active   28s
inventory            Active   28s
kube-node-lease      Active   2m44s
kube-public          Active   2m44s
kube-system          Active   2m44s
local-path-storage   Active   2m39s
payment              Active   28s
```

Notes and troubleshooting

* Built-in namespaces: Kubernetes creates `default`, `kube-system`, and `kube-public` automatically.
* If kind cluster creation fails:
  * Ensure Docker is running and has enough resources (CPU/memory).
  * Verify no conflicting ports or existing clusters with the same name.
  * Consult kind’s docs: [https://kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)

If you see permission or networking errors during cluster creation, restart Docker and retry. On macOS and Windows, enabling virtualization in system settings may be required.

Next steps
In the next lesson we will deploy each microservice into its corresponding namespace and validate inter-service connectivity using Services and NetworkPolicies. We’ll also introduce Helm charts to manage deployments and values per namespace.

Links and references

* kind: [https://kind.sigs.k8s.io/](https://kind.sigs.k8s.io/)
* kubectl docs: [https://kubernetes.io/docs/reference/kubectl/overview/](https://kubernetes.io/docs/reference/kubectl/overview/)
* Docker: [https://docs.docker.com/get-started/](https://docs.docker.com/get-started/)
* Helm: [https://helm.sh/](https://helm.sh/)

> **[Watch Video](https://learn.kodekloud.com/user/courses/building-kubernetes-finops-ai-agent/module/bd335eac-9e8a-4dc2-963b-1db50f6971f9/lesson/2b667378-4506-44d6-a00a-2564c265ccf3)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.