Skip to content

Commit c358550

Browse files
authored
Merge pull request #2 from ManagedKube/docs
Docs for EKS permissions
2 parents 0ba0711 + f4113d9 commit c358550

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Granting Permissions to EKS
2+
3+
After applying this module to create the AWS Identity providers and roles, theres more to be done in
4+
order for your Github Actions pipeline to have permissions to an EKS cluster. You will need to
5+
give permission to this role to the EKS cluster.
6+
7+
How to identify what the problem is.
8+
9+
# Your pipeline runs and fails
10+
When the pipeline is trying to reach out to the EKS cluster, it fails to authenticate.
11+
12+
![pic](./images/gha-failed-pipeline.png)
13+
14+
You can look at the `CloudWatch` logs and determine what it failed on.
15+
Go to in the AWS console: `cloudwatch -> Log Group -> <cluster> -> authenticator-xxx logs`
16+
17+
Search for the word denied and something like this will come up:
18+
```
19+
time="2022-01-04T21:29:45Z" level=warning msg="access denied" arn="arn:aws:iam::xxxx:role/github_oidc" client="127.0.0.1:34720" error="ARN is not mapped: arn:aws:iam::xxxx:role/github_oidc" method=POST path=/authenticate sts=sts.amazonaws.com
20+
```
21+
22+
This means that your EKS cluster don't have this role mapped and dont know it should trust it.
23+
24+
You will need to add this into your EKS cluster's role map.
25+
26+
If you are using `kubernetes-ops`' EKS Terraform module, you can add it here: https://github.com/ManagedKube/kubernetes-ops/blob/main/terraform-modules/aws/eks/variables.tf#L53
27+
28+
It will be similar to the based Terraform EKS module and add in:
29+
30+
```
31+
[
32+
{
33+
rolearn = "arn:aws:iam::xxxx:role/github_oidc"
34+
username = "github"
35+
groups = ["system:masters"]
36+
},
37+
]
38+
```
39+
40+
Apply this and your cluster will allow this AWS IAM role perform actions on the EKS cluster.
317 KB
Loading

0 commit comments

Comments
 (0)