Skip to content

Move Calico API server from calico-apiserver namespace to calico-system for OSS#3989

Merged
caseydavenport merged 5 commits intotigera:masterfrom
vara2504:oss_apiserver_ns
Jun 18, 2025
Merged

Move Calico API server from calico-apiserver namespace to calico-system for OSS#3989
caseydavenport merged 5 commits intotigera:masterfrom
vara2504:oss_apiserver_ns

Conversation

@vara2504
Copy link
Contributor

Description

Release Note

Component Migration: To support a minimal footprint and simplify resource management, the calico-apiserver component and its associated resources have been moved from the calico-apiserver namespace to the calico-system namespace in Calico OSS .

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@marvin-tigera marvin-tigera added this to the v1.39.0 milestone Jun 14, 2025
@vara2504 vara2504 force-pushed the oss_apiserver_ns branch 2 times, most recently from cb6feab to 307061b Compare June 16, 2025 00:56
@vara2504 vara2504 marked this pull request as ready for review June 17, 2025 16:03
@vara2504 vara2504 requested a review from a team as a code owner June 17, 2025 16:03
} else {
// Create any Calico-only objects
globalObjects = append(globalObjects, globalCalicoObjects...)
objsToDelete = append(objsToDelete, c.cleanupDeployment())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleanupDeployment ensures cleanup of the calico-apiserver deployment during OSS to EE upgrades, where the API server is replaced by the tigera-apiserver deployment.

oldNamespace = "tigera-system"
deploymentName = "tigera-apiserver"
)
func (r *ReconcileAPIServer) canCleanupLegacyNamespace(ctx context.Context, variant operatorv1.ProductVariant, logger logr.Logger) bool {
Copy link
Member

Choose a reason for hiding this comment

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

Will this clean up calico-apiserver if you upgrade from oss(operator v1.n-1)->ee?

Should this method iterate over both namespaces instead to ensure the removal of both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should handle cleaning up the calico-apiserver deployment, as both the calico-apiserver deployment and the tigera-system namespace are removed once canCleanupLegacyNamespace is true here in getDeprecatedResources.
https://github.com/tigera/operator/pull/3989/files#diff-88957f5c859486b2cbf260254b87b36b75fadbc99bfd38c01ea29dc0ac22a260R2340

If we're switching from OSS to the enterprise variant, the OSS namespace will need to be cleaned up anyway, and I believe EE doesn't have a dependency on the OSS apiserver component to come up. This means we can directly clean up the calico-apiserver namespace. (correct me if i am missing something).

We only need to iterate over the namespaces when migrating the APIServer between namespaces within the same variant. This is because, in order to run the apiserver inside the calico-system namespace, we need to create some allow-tigera policy rules in calico-system, which requires the apiserver deployment to be up and running in tigera-system.

@rene-dekker
Copy link
Member

rene-dekker commented Jun 18, 2025

Vara, should we also make it so that we no longer have a different name for the deployment based on the Variant? I.e. remove func resourceNameBasedOnVariant(), APIServerServiceAccountName(), ProjectCalicoAPIServerServiceName(), ProjectCalicoAPIServerTLSSecretName() and normalize the name to be calico-apiserver?

@caseydavenport caseydavenport merged commit e072c81 into tigera:master Jun 18, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants