CAPA false-positive reconciliation failures because capa-iam-operator deletes IAM principal too early #2715
Labels
area/kaas
Mission: Cloud Native Platform - Self-driving Kubernetes as a Service
kind/bug
provider/cluster-api-aws
Cluster API based running on AWS
team/phoenix
Team Phoenix
topic/capi
IAM role
nodes-nodepool0-<name of WC>
gets deleted as soon as theAWSMachinePool
goes away. But CAPA still needs it for reconcilingAWSCluster
– which can get reconciled normally for a few minutes before it gets deleted. CAPA puts an IAM policy on the cluster's S3 bucket which references the mentioned IAM role, and since that role is deleted too early,AWSCluster
reconciliation fails to reconcile the bucket (failed to reconcile S3 Bucket for AWSCluster org-giantswarm/andreas84: ensuring bucket policy: creating S3 bucket policy: MalformedPolicy: Invalid principal in policy
) and even marks theAWSCluster
as non-ready withLoadBalancerFailed
as meaningless error. Also, its logs are filled with useless errors that only confuse.Proposal: We could check in the
isRoleUsedElsewhere
function whether the role is used in the S3 bucket of theAWSCluster
, or just wait until theAWSCluster
goes away (no finalizer needed for that) before deleting.Issue was found in #2714, but is not causally related.
The text was updated successfully, but these errors were encountered: