# Running on AWS

This document provides the basic instruction to set up a Kubernetes Cluster on [Amazon Elastic Kubernetes Service (Amazon EKS)](https://aws.amazon.com/eks/)

## 1. Tooling Installation

### **1.1 Install Kubectl**

Please follow this link (<https://kubernetes.io/docs/tasks/tools/install-kubectl>) to install kubectl.

*For Mac User*

```bash
brew install kubernetes-cli
```

Please check kubectl version after installation.

```
kubectl version
```

{% hint style="info" %}
QuickStart scripts are tested under kubectl client version v1.16.3 and server version v1.13.12
{% endhint %}

### **1.2 Install Helm**

Please follow this link (<https://helm.sh/docs/using_helm/#installing-helm>) to install helm.

*For Mac User*

```bash
brew install kubernetes-helm
```

Please check helm version after installation.

```
helm version
```

{% hint style="info" %}
This QuickStart provides helm supports for helm v3.0.0 and v2.12.1. Please pick the script based on your helm version.
{% endhint %}

### **1.3 Install AWS CLI**

\_\_

Please follow this link (<https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html#install-tool-bundled>) to install *AWS CLI*.

*For Mac User*

```bash
curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-macos.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
```

### **1.4 Install Eksctl**

Please follow this link (<https://docs.aws.amazon.com/eks/latest/userguide/eksctl.html#installing-eksctl>) to install *AWS CLI*.

*For Mac User*

```bash
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
```

## 2. (Optional) **Login to your AWS account.**

For first time AWS user, please register your account at <https://aws.amazon.com/>.

Once created the account, you can go to [AWS Identity and Access Management (IAM)](https://console.aws.amazon.com/iam/home#/home) to create a user and create access keys under Security Credential tab.

```bash
aws configure
```

{% hint style="info" %}
Environment variables **`AWS_ACCESS_KEY_ID`** and **`AWS_SECRET_ACCESS_KEY`** will override AWS configuration stored in file **`~/.aws/credentials`**
{% endhint %}

## 3. (Optional) Create a Kubernetes cluster(EKS) in AWS

Below script will create a **3** nodes cluster named **pinot-quickstart** in **us-west-2** with **t3.small** machines for demo purposes.

Please modify the parameters in the example command below:

```bash
EKS_CLUSTER_NAME=pinot-quickstart
eksctl create cluster \
--name ${EKS_CLUSTER_NAME} \
--version 1.14 \
--region us-west-2 \
--nodegroup-name standard-workers \
--node-type t3.small \
--nodes 3 \
--nodes-min 3 \
--nodes-max 4 \
--node-ami auto
```

You can monitor cluster status by command:

```
EKS_CLUSTER_NAME=pinot-quickstart
aws eks describe-cluster --name ${EKS_CLUSTER_NAME}
```

Once the cluster is in **ACTIVE** status, it's ready to be used.

## **4. Connect to an existing cluster**

Simply run below command to get the credential for the cluster **pinot-quickstart** that you just created or your existing cluster.

```
EKS_CLUSTER_NAME=pinot-quickstart
aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME}
```

To verify the connection, you can run:

```
kubectl get nodes
```

## 5. Pinot Quickstart

Please follow this [Kubernetes QuickStart](https://docs.pinot.apache.org/release-0.4.0/basics/getting-started/kubernetes-quickstart) to deploy your Pinot Demo.

## 6. Delete a Kubernetes Cluster

```
EKS_CLUSTER_NAME=pinot-quickstart
aws eks delete-cluster --name ${EKS_CLUSTER_NAME}
```


---

# 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://docs.pinot.apache.org/release-0.4.0/basics/getting-started/public-cloud-examples/aws-quickstart.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.
