fix: add cluster creator access entry #863
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
PR creates
KubernetesAdmin
role and an access entry withAmazonEKSClusterAdminPolicy
policy for that role in the management cluster and any clusters created in the management cluster. I have removed ArgoCD and Atlantis's Access entry as they onlyAmazonEKSViewPolicy
in the default namespace.Related Issue(s)
Access entry is the current recommended way of granting IAM principals access to an EKS cluster. It decouples cluster access policy from the principals permission policy and the account. Permissions are defined in
Access Polcies
and principals are granted access by creating access entries.Our Terraform code for management clusters adds two access entries for two principals ( ArgoCD and Atlantis service Account) with
AmazonEKSViewPolicy
to the default namespace for all resources. Additional the upstream EKS module we utilize hasenable_cluster_creator_admin_permissions
variable which creates an access entry to the principal who creates the cluster. Unfortunately the way it is implemented, the principal ARN for the access entries get updates to the principal running the the Terraform code. In Kubefirst there are two principals running the Terraform code for the management clusterkubefirst aws create
command andWhen the responsibility of managing the Terraform code is transferred to Atlantis,
terraform apply
fails with the following errorThis can be fixed by removing Atlantis’s access entry. But does Atlantis need
AmazonEKSViewPolicy
access to the cluster? No. This PR removes access entry for both ArgoCD and Atlantis.How to test
--gitops-template-branch "muse-sisay/aws-bootstrap-eks-admin"
flagaentry-04-KuberenetesAdmin
. Add the following to your aws configImportant
I am not a fan of a single role in the downstream account used by Kubefirst, Crossplane and users.