Skip to content

Conversation

@rbtr
Copy link
Collaborator

@rbtr rbtr commented Jan 31, 2025

Reason for Change:

Removes the legacy Kubernetes init and makes CNI init the code default. 🚮

Reconcile initial state from CNI has been the default (via config) since CNI 1.4.7 (so at least AKS 1.27). It's been in use for so long that we're starting to roll off of it, also, to the new CNS managed state.

Issue Fixed:

Requirements:

Notes:

@rbtr rbtr added cns Related to CNS. release/latest Change affects latest release train labels Jan 31, 2025
@rbtr rbtr self-assigned this Jan 31, 2025
@rbtr rbtr requested a review from a team as a code owner January 31, 2025 23:45
@rbtr
Copy link
Collaborator Author

rbtr commented Jan 31, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Feb 15, 2025
@github-actions
Copy link

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Feb 23, 2025
@github-actions github-actions bot deleted the chore/cleanup-kubeinit branch February 23, 2025 00:01
@rbtr rbtr restored the chore/cleanup-kubeinit branch February 25, 2025 19:26
@rbtr rbtr reopened this Feb 25, 2025
@rbtr rbtr force-pushed the chore/cleanup-kubeinit branch from c942654 to 3b9b475 Compare February 25, 2025 19:27
@rbtr rbtr requested review from nddq and paulyufan2 February 25, 2025 19:27
@rbtr rbtr removed the stale Stale due to inactivity. label Feb 25, 2025
@nddq
Copy link
Member

nddq commented Feb 27, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr force-pushed the chore/cleanup-kubeinit branch from 3b9b475 to 793abc9 Compare February 28, 2025 05:27
@rbtr
Copy link
Collaborator Author

rbtr commented Feb 28, 2025

/azp run Azure Container Networking PR

@rbtr rbtr enabled auto-merge February 28, 2025 05:29
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr requested a review from Copilot February 28, 2025 05:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR removes legacy Kubernetes initialization code and updates the system to default to using the CNI state for pod information. Key changes include:

  • Introducing a new pod info provider in the cni package.
  • Renaming and consolidating packages from “cnireconciler” to “cni” and “cns” where applicable.
  • Removing legacy version-checking functions and associated tests.

Reviewed Changes

File Description
cns/stateprovider/cni/podinfoprovider.go New implementation of the CNI pod info provider.
cns/stateprovider/cns/podinfoprovider.go Updates to use endpoint state from the CNS store instead of legacy CNI state migration.
cns/NetworkContainerContract.go Changes to the key schema for PodInfo, defaulting to PodInterfaceID.
cns/stateprovider/cni/statefile_test.go Package rename from cnireconciler to cni.
cns/stateprovider/cni/podinfoprovider_test.go Test updates matching package renames and function call changes.
cns/stateprovider/cni/statefile.go Package rename from cnireconciler to cni.
cns/service/main.go Updated calls to use the new cni and cns pod info providers and removal of legacy CNI version checks.
cns/restserver/internalapi_test.go Minor test adjustments due to GlobalPodInfoScheme changes.
cns/nodesubnet/initialization_test.go Test updates to use the new CNS pod info provider.
cns/NetworkContainerContract_test.go Removal of deferred reset for GlobalPodInfoScheme.
cns/restserver/nodesubnet_test.go Package and function call updates to use the new CNS and CNI pod info providers.
cns/cnireconciler/version*.go Legacy version checking functions and tests removed.

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

cns/NetworkContainerContract.go:289

  • Ensure that using p.PodInterfaceID as the default key is the intended behavior, and that the PodInterfaceID is guaranteed to be unique. If uniqueness cannot be guaranteed, consider using a composite key or revisiting the key schema.
return p.PodInterfaceID

cns/NetworkContainerContract_test.go:60

  • Consider restoring GlobalPodInfoScheme to its original value at the end of tests (or using proper test isolation) to prevent side effects on subsequent tests.
GlobalPodInfoScheme = InterfaceIDPodInfoScheme

@rbtr rbtr force-pushed the chore/cleanup-kubeinit branch from 793abc9 to 6b5f07e Compare February 28, 2025 06:13
@rbtr
Copy link
Collaborator Author

rbtr commented Feb 28, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr
Copy link
Collaborator Author

rbtr commented Apr 10, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Apr 25, 2025
@rbtr rbtr removed the stale Stale due to inactivity. label Apr 30, 2025
@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label May 16, 2025
@github-actions
Copy link

Pull request closed due to inactivity.

@github-actions github-actions bot closed this May 23, 2025
@github-actions github-actions bot deleted the chore/cleanup-kubeinit branch May 23, 2025 00:01
@rbtr rbtr added exempt-stale Keep this fresh and removed stale Stale due to inactivity. labels May 29, 2025
@rbtr rbtr restored the chore/cleanup-kubeinit branch May 29, 2025 22:51
@rbtr rbtr reopened this May 29, 2025
@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Jun 13, 2025
@rbtr rbtr removed the stale Stale due to inactivity. label Jun 13, 2025
@rbtr rbtr force-pushed the chore/cleanup-kubeinit branch from 143ff7c to e6a9160 Compare June 13, 2025 18:10
@rbtr
Copy link
Collaborator Author

rbtr commented Jun 13, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr added this pull request to the merge queue Jun 13, 2025
Merged via the queue into master with commit 9df7534 Jun 13, 2025
17 checks passed
@rbtr rbtr deleted the chore/cleanup-kubeinit branch June 13, 2025 23:38
sivakami-projects pushed a commit that referenced this pull request Oct 23, 2025
* chore: remove legacy kube-init and default to CNI state

Signed-off-by: Evan Baker <[email protected]>

* refactor podinfoproviders

Signed-off-by: Evan Baker <[email protected]>

* fix lints

Signed-off-by: GitHub <[email protected]>

---------

Signed-off-by: Evan Baker <[email protected]>
Signed-off-by: GitHub <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cns Related to CNS. exempt-stale Keep this fresh release/latest Change affects latest release train

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants