# Amazon Web Services (EKS)

{% hint style="info" %}
Infra App connects automatically to most clusters. If running `kubectl` works without any modifications or custom scripts, then Infra App will also work out of the box.
{% endhint %}

### Prerequisites

* Create an [EKS cluster](https://docs.aws.amazon.com/eks/latest/userguide/create-cluster.html)
* Download and setup the [AWS CLI](https://www.google.com/search?q=aws+cli+v2\&oq=aws+cli+v2\&aqs=chrome..69i57j69i59j69i60l4.765j0j7\&sourceid=chrome\&ie=UTF-8) (preferably version 2)
* [Configure the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html) with the credentials AWS user that has access to the cluster

### Generating a config file

[Create a config file entry](https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html) using the `aws` CLI. For example:

```bash
aws eks --region <region-code> update-kubeconfig --name <cluster_name>
```

You're done! Infra App should automatically switch to your cluster. You can switch to it at any time via the cluster dropdown:

![](https://2997771214-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ll2YPh7b5O2frfEMtKk%2F-MKCgCcYJVIZ7pcrzEB9%2F-MKCh7FQ1vexF0q_U-Qu%2Faws%20dropdown.png?alt=media\&token=30d3489a-4646-41be-a070-c847fa7b5a1f)

### Installing Metrics Server

AWS EKS clusters don't include metrics server by default, so real-time CPU & Memory usage metrics won't show out of the box with Infra App.

Follow the [official guide](https://docs.aws.amazon.com/eks/latest/userguide/metrics-server.html) on the AWS docs site to install metrics server on your cluster.

### Usage with custom profiles

In order to use a custom AWS profile to connect to your cluster, you'll need to edit your Kubernetes config file. This file is usually found in:

* `~/.kube/config` on macOS and Linux
* `C:\Users\<your user>\.kube\config` on Windows

Open this file and edit the relevant user object in the `users:` section. add an `AWS_PROFILE` environment variable .

```yaml
users:
- name: arn:aws:eks:us-east-1:00919287195771:cluster/example-cluster
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1alpha1
      args:
      - --region
      - us-east-1
      - eks
      - get-token
      - --cluster-name
      - example-cluster
      command: aws
      # Add these lines to your KubeConfig
      env:
      - name: AWS_PROFILE
        value: <your profile>
```

### Usage with `aws-iam-authenticator`

Older EKS clusters may use `aws-iam-authenticator` to generate tokens. If your cluster uses this make sure it's [installed](https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html) before using Infra App.

### Usage with `aws-okta`

Usage with `aws-okta` is not supported yet, but we are working on it.

### Usage with `aws-vault`

Usage with `aws-vault` is not supported yet, but we are working on it.
