aws / aws/aws-cli

EKS update-config generating incorrect command

Open
#4,337 5 comments 3 reactions 0 assignees View on GitHub
customization eks-kubeconfig feature-request p3
Dominant language
Python
Stars
17.3k
Forks
4.6k
Avg merge
1d 2h
Merged PRs (30d)
13

Description

`aws eks update-kubeconfig` is generating a command with the `AW_PROFILE` environment variable. This is the incorrect variable to setting profiles via environment variable. It should be `AWS_DEFAULT_PROFILE`. Editing `~/.kube/config` manually fixed my cluster access issue.

Here's the broken sample:

```yml
- name: arn:aws:eks:us-east-1:REDACTED:cluster/utility-prod-utility
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- --region
- us-east-1
- eks
- get-token
- --cluster-name
- utility-prod-utility
command: aws
env:
# NOTE: the environment variable is incorrect below.
- name: AWS_PROFILE
value: skillshare-utility
```

Fixed version:

```yml
- name: arn:aws:eks:us-east-1:REDACTED:cluster/utility-prod-utility
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- --region
- us-east-1
- eks
- get-token
- --cluster-name
- utility-prod-utility
command: aws
env:
- name: AWS_DEFAULT_PROFILE
value: skillshare-utility
```

Better fixed version:

```yml
- name: arn:aws:eks:us-east-1:289698421666:cluster/utility-prod-utility
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- --profile
- skillshare-utility
- --region
- us-east-1
- eks
- get-token
- --cluster-name
- utility-prod-utility
command: aws
```

```
$ aws --version
aws-cli/1.16.200 Python/3.7.4 Darwin/18.6.0 botocore/1.12.190
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.