---
# System prepended metadata

title: INSTALL BINARIES
tags: [linux, install, aws-iam-authenticator]

---

###### tags: `linux` `install` `aws-iam-authenticator`

# INSTALL BINARIES
0. download

```shell=
curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator 
```

1. Given a binary file `aws-iam-authenticator`
2. create a directory `~/bin` to store the file `aws-iam-authenticator`

```shell=
$ mkdir -p $HOME/bin && cp ./aws-iam-authenticator $HOME/bin/aws-iam-authenticator

# -p  = parent, if not exists then creates

```

3. Add the folder path created above to `.profile` (in my case)
OR `echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc`
```shell=
$ nano ~/.profile
# paste - > export PATH=$PATH:$HOME/bin
```

Now we can execute the binary/program from everywhere, not only where the file is placed.

Try,

```shell=
$ aws-iam-authenticator
```

4. Execute

```shell=
$ kubectl --kubeconfig=config get ns
```

![](https://i.imgur.com/rCt9bgT.png)


----

# AWS iam authenticator configuration

## LINUX 

1. Connect to the corresponding VPN 

2. Install AWS CLI 

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" 

2. Install AWS IAM AUTHENTICATOR 

```shell=
$ curl -o aws-iam-authenticator https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator 

```

**FOLLOW =>** `INSTALL BINARIES` step. (at the beginning of this doc)

3. Create a new directory called eks 
```shell=
mkdir eks 
cd eks 

```
4. Copy the “config” file inside the directory. Get EKS config file from here 
`
https://us-west-2.console.aws.amazon.com/secretsmanager/home?region=us-west-2#!/secret?name=nonprod%2Feks-catalog-svc%2Fkubeconfig
`

(**be authenticated by using your credentials**)

Go to AWS Console and click to retrieve secret value and copy the content and paste in a `config` file.

![](https://i.imgur.com/wObXK9h.png)

![](https://i.imgur.com/h1ZfKgt.png)

5. (Optional). Create a .sh file with env vars from ALKS not to copy and paste everytime on the console. 
`AWS_ID_KEY,SECRET_ACCESS_KEY,SESSION....`
Then verify the ENV VARS with

```shell=
$ env | grep AWS
```

If not, run :warning: 

```shell=
$ source env-variables.sh
```

NOTE:
- In the env-variables change the default region to the region you need to access e.g. us-west-2

6. Execute

```shell=
$ kubectl --kubeconfig=config get ns 
```

You should get the list of namespaces in the cluster 

![](https://i.imgur.com/rCt9bgT.png)

