giantswarm / roadmap

Giant Swarm Product Roadmap
https://github.com/orgs/giantswarm/projects/273
Apache License 2.0
3 stars 0 forks source link

Use IRSA for `external-dns` #1101

Closed alex-dabija closed 2 years ago

alex-dabija commented 2 years ago

Story

-As a cluster admin, I want external-dns to use IAM Roles for Service Accounts (IRSA) instead of Kiam in order to improve the security and stability of clusters given that Kiam is now deprecated.

Background

Current state:

Changes

njuettner commented 2 years ago

I spent some time thinking what we need to do in order to make it work.

Main tasks:

cluster-operator:

We need to add the values AWS account ID (this value might also added to cluster-apps-operator for CAPI) and a IRSA flag in cluster-values. Cluster-operator already checks if the annotation for IRSA is set, so it can enable the IRSA flag in cluster-values.

AWS Account ID is needed because we need to use the full ARN arn:aws:iam::ACCOUNT_ID:role/CLUSTER_ID-Route53Manager-Role. Unlike kiam we cannot skip the first part and only use the role name 😞. I tested this and it's not possible so far.

The values can be picked up from external-dns and maybe other apps.

aws-operator:

Because we add the IAM role for Route53 we need to modify it slightly to add an additional trust relationship to allow external-dns assuming this role. See https://github.com/giantswarm/aws-operator/blob/master/service/controller/resource/tccpn/template/template_main_iam_policies.go#L125-L135