Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EventBridge ec2 event reconciliation and rule creation to eks managed control planes #3752

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/eks"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/gc"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/iamauth"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/instancestate"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/kubeproxy"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/network"
"sigs.k8s.io/cluster-api-provider-aws/v2/pkg/cloud/services/securitygroup"
Expand Down Expand Up @@ -253,6 +254,14 @@ func (r *AWSManagedControlPlaneReconciler) reconcileNormal(ctx context.Context,
return reconcile.Result{}, fmt.Errorf("failed to reconcile control plane for AWSManagedControlPlane %s/%s: %w", awsManagedControlPlane.Namespace, awsManagedControlPlane.Name, err)
}

if feature.Gates.Enabled(feature.EventBridgeInstanceState) {
instancestateSvc := instancestate.NewService(managedScope)
if err := instancestateSvc.ReconcileEC2Events(); err != nil {
// non fatal error, so we continue
managedScope.Error(err, "non-fatal: failed to set up EventBridge")
}
}

if err := authService.ReconcileIAMAuthenticator(ctx); err != nil {
conditions.MarkFalse(awsManagedControlPlane, ekscontrolplanev1.IAMAuthenticatorConfiguredCondition, ekscontrolplanev1.IAMAuthenticatorConfigurationFailedReason, clusterv1.ConditionSeverityError, err.Error())
return reconcile.Result{}, errors.Wrapf(err, "failed to reconcile aws-iam-authenticator config for AWSManagedControlPlane %s/%s", awsManagedControlPlane.Namespace, awsManagedControlPlane.Name)
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/e2e_eks_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ variables:
KUBERNETES_VERSION_MANAGEMENT: "v1.22.9" # Kind bootstrap
EXP_MACHINE_POOL: "true"
EXP_CLUSTER_RESOURCE_SET: "true"
EVENT_BRIDGE_INSTANCE_STATE: "true"
AWS_NODE_MACHINE_TYPE: t3.large
AWS_MACHINE_TYPE_VCPU_USAGE: 2
AWS_SSH_KEY_NAME: "cluster-api-provider-aws-sigs-k8s-io"
Expand Down