# Day 31 : Launching your First Kubernetes Cluster with app.

Today, we will install Kubernetes and will run our first app on it. Let's start.

### **Task 1 : Install minikube on your local**

  
I have followed this link : [https://minikube.sigs.k8s.io/docs/start/](https://minikube.sigs.k8s.io/docs/start/)

Before anything , make sure you have at least instance with 2 CPU.

we need to run following command on linux .

```bash
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
```

then we will try to start it .

```bash
minikube start
```

if it doesn't then you should configure minicube driver. Make sure you have installed docker ,before configure docker aas driver of minucube.

Now run following command.

```shell
minikube start --driver=docker
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685401119408/a3c42ad5-4674-4357-9f20-914a7578ea8a.png align="center")

Now it will start installing Kubernetes in your system.

Congratulation you have installed K8S using minikubes. you can check running pods on your cluster by running following command.

```bash
minikube kubectl -- get po -A
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685401479550/8e2aa680-8cbe-4842-9154-fdaadab6e2ce.png align="center")

## Task-02 : Create your first pod on Kubernetes through minikube.

we need to create pod.yml for this . we will use following yml file for it.

```bash
apiVersion: v1
kind: Pod
metadata:
  name: nodeapp
spec:
  containers:
  - name: nodeapp
    image: patelajay745/node-app-new:latest
    ports:
    - containerPort: 8000
```

To run this pod we need following command :  

```bash
kubectl apply -f pod.yml
```

but if it gives error of kubctl not found like below screenshot then you have install it.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685401848419/3e3ffc9b-e43d-42ad-833c-6210f0020951.png align="center")

run this command to install it .

```bash
sudo snap install kubectl --classic
```

Now you can try : kubectl apply -f pod.yml

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1685401968533/aeb4ae02-bfd2-4144-8f8d-3a422e4b7d4b.png align="center")

You will see your nodeapp pod is running.

you can access you app using : http://&lt;minikube-ip&gt;:&lt;nodeapp-port&gt;

That was it for today. If you have any queries/suggestion please write in comment.

See you tomorrow.
