Skip to content

Don't run API server if not needed#4428

Open
caseydavenport wants to merge 3 commits intotigera:masterfrom
caseydavenport:casey-enterprise-apiserver
Open

Don't run API server if not needed#4428
caseydavenport wants to merge 3 commits intotigera:masterfrom
caseydavenport:casey-enterprise-apiserver

Conversation

@caseydavenport
Copy link
Member

Description

For Calico OSS, if we aren't using an API server just degrade and return.

For enterprise, we need to run the Pod but disable the aggregation API server container and associated resources.

Release Note

TBD

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.

Copy link

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.

Pull request overview

This PR introduces support for running the API server pod without the aggregation API server container when using v3 CRDs instead of aggregated API resources. The main purpose is to avoid running unnecessary API server components in Calico OSS when not needed, while maintaining the ability to run other containers (like query server) in Enterprise deployments.

Changes:

  • Added RequiresAggregationServer configuration flag to conditionally enable/disable the aggregation API server
  • Modified deployment logic to conditionally include containers and resources based on whether aggregation server is needed
  • Updated test infrastructure to use ptr.To() utility and improved error messages with type information

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/render/apiserver.go Core logic changes to conditionally render aggregation server resources and containers
pkg/render/apiserver_test.go Added test coverage for non-aggregation mode and updated test setup to use ptr.To()
pkg/controller/apiserver/apiserver_controller.go Added early exit for Calico OSS with v3 CRDs and wired up RequiresAggregationServer flag
pkg/controller/apiserver/apiserver_controller_test.go Refactored to use options.ControllerOptions struct instead of individual fields
pkg/render/common/test/testing.go Enhanced error messages to include resource type information
Comments suppressed due to low confidence (1)

pkg/render/apiserver_test.go:1

  • While removing blank lines, a duplicate assertion was exposed at lines 1862 and 1863: both check d.Spec.Selector.MatchLabels for the same key-value pair. This is redundant and should be removed.
// Copyright (c) 2019-2026 Tigera, Inc. All rights reserved.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@radixo
Copy link
Contributor

radixo commented Feb 12, 2026

LGTM

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.

3 participants