# AWS

This article describes the steps to create a Kubernetes cluster on Amazon Web Services (AWS) cloud using AWS EC2 instances, and using Platform9 Managed Kubernetes (PMK).

## What you’ll need

* Access to the inbox of a valid email address
* AWS account that meets the [Pre-requisites for AWS Native Clusters](https://github.com/platform9/pcd-docs-gitbook/blob/main/other-docs/pmk/5.14/docs/kubernetes/aws-prerequisites/README.md)

## Log in to your Platform9 Account

Log in to your Platform9 account. Once you sign in you’ll be directed to your account's dashboard. This is a summary of all Kubernetes clusters, nodes, pods, and cloud accounts associated with your Platform9 account. If this is a brand new account, there may not be anything associated… yet!

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/PT4VdHyQbA8EruQpfKjg/300dr2zyvti44z6qelyohk1sqlzdauy26kjltbq6b36157oegewou85l4fcfqqw3.png" alt="Platform9 – UI - Dashboard"><figcaption><p>Platform9 – UI - Dashboard</p></figcaption></figure>

## Connect your AWS account with your Platform9 instance

Before associating your account make sure it meets the minimum requirements, [read more here](https://docs.platform9.com/kubernetes/aws-prerequisites#pre-requisites-for-aws-native-clusters). You’ll need an SSH key-pair before running the provider wizard.

From your dashboard click the "Add Cloud" button and choose "Amazon Web Services" as your cloud provider type. Name the new provider something memorable like 'my-aws-provider' and provide your AWS key credentials.

{% hint style="warning" %}
**AWS IAM Policy**

Ensure your AWS IAM User has the correct IAM access by using the [Cloud Provider Checks](https://pf9.developerhub.io/kubernetes-docs/kubernetes/cloud-provider-iam-check) CLI or by adding the Platform9 IAM Policy by downloading it [here](https://raw.githubusercontent.com/platform9/support-locker/master/pmk/aws-policy.json)
{% endhint %}

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/GFELTry8uh6v1J4VrIby/sk90bpd6cmutgw7jibe9kkfzb7sdcbyoi9bkk2woobr4iz4uudtl2pnele1e1jsh.png" alt="Platform9 – UI - Add New AWS Cloud Provider"><figcaption><p>Platform9 – UI - Add New AWS Cloud Provider</p></figcaption></figure>

When you click "Next" your AWS account will be validated for correct permissions.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/23FL3H8CC5iWo0OumKZn/pw13hmwoihl2ua2s89ee98i2y16iycsgl4rpd8mwcy0hbo2lpnfslj3x67mhazls.png" alt="Platform9 – UI - AWS - Validating Cloud Provider Access"><figcaption><p>Platform9 – UI - AWS - Validating Cloud Provider Access</p></figcaption></figure>

Once validated, choose the AWS region, route name, and SSH key-pair to use when creating your new cluster. As you choose a region, your routes within that region will be loaded automatically.

{% hint style="info" %}
**Why are routes required?**

In order to route traffic to your cluster, a valid domain name must be used.
{% endhint %}

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/kUJC7xninVaTBWwUadGF/z1e72ri05c565kfklm1xbazmx9c2vzcdsaksfnc88cznea5jxnzxegkn81g6gwj7.png" alt=""><figcaption></figcaption></figure>

"Complete" to create your new cloud provider and be directed back to the cloud providers listing.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/4Ng571vK0rIaSALbwIO1/07329ibbwnwexze9oz4srog9usfxylggoxyl3xd2r2avav51dy0acgrxjqbmpn26.png" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Cloud Provider Created**
{% endhint %}

## Create a simple one-click cluster

From your dashboard, click the "Add Cluster" button and choose "Amazon Web Services" as your infrastructure provider. Choose the "One-Click Cluster" button to get started.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/691N5r2pm7hpdHPsXryi/x87szawqofhzbwgr1w5i3d9vyveqsa7a6q4hxhux8x6i4dfb6cer01pzlprfsns4.png" alt=""><figcaption></figcaption></figure>

Name your cluster something memorable like "my-aws-cluster" and choose the appropriate values to tell the Platform9 system where to create the cluster.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/LoMkSkdQZENexGsmtfzQ/60baz53l7h8ba6mkx1goytr1suaoh38dbny1z2fy0ndrenwj3oc4l6satuky1sys.png" alt=""><figcaption></figcaption></figure>

"Complete" to begin the creation of your new cluster.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/xMMXJEjiNMk36phucSvY/ub7r01pwi3sx0a9ivl68wljewwu6n24y4dntuqqlpuv2q9lr1x1peraoxda6cohk.png" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Info**

The Platform9 system will create a single EC2 instance, promote it to be a Kubernetes master node, and enable your workloads to run on it. Routing will be automatically configured as well as full observability.

Sometimes this can take a little time depending on many things. Behind the scenes the PMK packages are being installed, along with other needed services.
{% endhint %}

After creation successfully initializes, you will be directed to the "Node Health" tab where you can watch the progress.

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/0B9BEF3icM36iCPPixLz/8ras9da88hvdtohsrosbbfwjqzmp9462t0518db4nntiwpo9davh39966ke9j43x.png" alt=""><figcaption></figcaption></figure>

As the deployment progresses, the screen will update with steps completed and a final message of "Connected" and "Healthy".

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/thRs8Dvacp0fdLhk8iUB/gzn561r5ly4xzvgju50a9wg6ns1qhru40if3bv19ltlj20c95hv8kl4yib48yera.png" alt=""><figcaption></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/dN3UKqOJY9TdzQV1eEIf/blobs/zvSls0y8nUoWEZRkU957/xxiuhov21hjao5bou657h1b9fz200itcsg69rz5y1as5h53w1ylc30u6b7qug746.png" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
**Cluster Created**

Navigate back to your dashboard to see a summary of the new management plane.
{% endhint %}

## Removing a One-Click Cluster From Your AWS Account

1. Navigate to the "Infrastructure" area.
2. Choose the "Clusters" tab.
3. Select the cluster to remove and click the "Delete" icon.

{% hint style="info" %}
**Info**

It will take a few minutes to terminate the EC2 instance running as the Kubernetes master. In the "Nodes" tab, the associated instance will automatically remove after termination.
{% endhint %}

## What's next?

| Introduction to kubeconfig | [Get Your First Container Running on Kubernetes](https://github.com/platform9/pcd-docs-gitbook/blob/main/platform9-docs/v5.2/kubernetes/tutorials-first-container/README.md#Deploying-a-new-version-of-the-App) | [Integrating External DNS with Kubernetes](https://github.com/platform9/pcd-docs-gitbook/blob/main/platform9-docs/v5.2/kubernetes/tutorials-integrating-external-dns-with-k8s/README.md) |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                            |                                                                                                                                                                                                                 |                                                                                                                                                                                          |
