Skip to content

Commit

Permalink
Merge pull request #3752 from cnmcavoy/cnmcavoy/eventbridge-eks
Browse files Browse the repository at this point in the history
Add EventBridge ec2 event reconciliation and rule creation to eks managed control planes
  • Loading branch information
k8s-ci-robot authored Oct 25, 2022
2 parents 578244c + 5ac3588 commit 82f2c7f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
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 @@ -254,6 +255,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

0 comments on commit 82f2c7f

Please sign in to comment.