# 3. Deploying your first applicatio

This chapter covers

```
Running a local kubernetes cluster on your laptop
Setting up a cluster on Amazon Kubernetes Service
Setting up and using kubectl command line tool
Deploying an application in kubernetes cluster and making it available across the globe
Horizontally scaling the application                                                            
```

### Deploying a Kubernetes cluster

The Settings dialog box in Docker Desktop for Windows

<figure><img src="/files/9tAsCDxvxgrnNSJozMSn" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/6PYei10YORmbQ8nbSjMS" alt=""><figcaption></figcaption></figure>

To understand where the various components that make up the Kubernetes\
cluster run in Docker Desktop, look at the following figure.

<figure><img src="/files/lAVm87iJ6QELN7M5q9ti" alt=""><figcaption></figcaption></figure>

**installing minikube**

visit --> (<http://github.com/kubernetes/minikube>) for installation guides

Tip\
If you use Linux, you can reduce the resources required by Minikube by\
creating the cluster without a VM. Use this command: `minikube start --`\
`vm-driver none`

* To start a kubernetes cluster, using minikube run, `minikube start`
* &#x20;To check minikube status type `minikube status`&#x20;

<figure><img src="/files/FV43yiq1CZSApQnWvTDT" alt=""><figcaption></figcaption></figure>

Tip :&#x20;

* If you want to list containers using your local docker CLI instance, as in the  \
  case of Docker Desktop, run the following command: `eval $(minikube`  \
  `docker-env`&#x20;

<figure><img src="/files/pb0zQ5MsTx0z2i1XLo6X" alt=""><figcaption><p>Architecture of running a multi-node kubernetes cluster using Kind (kubernets in docker)</p></figcaption></figure>

* when you run Kubernetes using  &#x20;kind, all Kubernetes components run in your host OS. The applications you  &#x20;deploy to the Kubernetes cluster also run in your host OS.  \
  This makes kind the perfect tool for development and testing, as everything
* To install a multi-node kubernetes cluster via kind, visit <https://kind.sigs.k8s.io/docs/user/quick-start/.> Please note that to spin up via kubernetes cluster, need to have docker installed
* `kind create cluster`--> To start kubernetes cluster
* kubernetes cluster architecture in gke is as follows :&#x20;

<figure><img src="/files/rmDBe22EvRgJDNud9tUX" alt=""><figcaption></figcaption></figure>

\--> Refer this  <https://cloud.google.com/container-engine/docs/before-you-begin.>

Creating a cluster using Amazon Elastic Kubernetes\
Service

* To use Amazon's EKS cluster creation , first we must need to install eksctl commandline tool at t <https://docs.aws.amazon.com/eks/latest/userguide/gettingstarted-eksctl.html>
* Creating EKS kubernetes cluster using eksctl doesnot differ significantly from how you create a cluster in GKE. All u must do is run `eksctl create cluster --name kiada eu-central-1a --node`
* If you are interested in what's running on those nodes, you can use SSH to connect to them. The `--ssh-access` flag is used in the cluster that creates the cluster ensures that your SSH public key is imported to the node.

<figure><img src="/files/BsKowDpcCyrmhqEa0DWY" alt=""><figcaption><p>How we interact with the kubernetes cluster</p></figcaption></figure>

* On Windows, download kubectl.exe from  \
  <https://storage.googleapis.com/kubernetesrelease/release/v1.18.2/bin/windows/amd64/kubectl.exe>. To download the  \
  latest version, first go to <https://storage.googleapis.com/kubernetesrelease/release/stable.txt&#x20>;

Interacting with kubernetes cluster&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://charan-techjourney.gitbook.io/charan-techjournal/books/kubernetes-in-action-marko-luksa-kevin-conner/3.-deploying-your-first-applicatio.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
