aws / amazon-vpc-resource-controller-k8s

Controller for managing Trunk & Branch Network Interfaces on EKS Cluster using Security Group For Pod feature and IPv4 Addresses for Windows Node.
Apache License 2.0
79 stars 53 forks source link

add node os label in CNINode and run finalizer routine for linux only #388

Closed sushrk closed 6 months ago

sushrk commented 6 months ago

Issue #, if available: N/A Description of changes:

  1. Adding node OS label to CNINodes to run the finalizer routine for Linux nodes only.
  2. Added retry to get CNINode during node reconcile: When CNINode is deleted, node update is triggered and since CNINode is not immediately found, the controller updates the node to be unmanaged and adds node to delete queue and removes the trunk, this is a regression bug. CNINode is shortly re-created by the CNINode controller, so added retry with backoff to GetCNINode which prevents node being unmanaged.

Tests:

  1. CNINode creation: Validated new CNINodes are created with required fields
  2. Node deletion: Validated finalizer routine is only run for Linux nodes
  3. Reconcile tests: Edit CNINode to remove required fields and validated it is updated correctly

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.