Skip to content

Remove legacy Recipe and annotation-based Kubernetes controllers - #12952

Open
willdavsmith wants to merge 2 commits into
mainfrom
willdavsmith-related-pr-search
Open

Remove legacy Recipe and annotation-based Kubernetes controllers#12952
willdavsmith wants to merge 2 commits into
mainfrom
willdavsmith-related-pr-search

Conversation

@willdavsmith

@willdavsmith willdavsmith commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the Kubernetes onboarding flows scoped in #12204:

  • Remove RecipeReconciler, annotation-based DeploymentReconciler, and RecipeWebhook, including their exclusive helpers and tests.
  • Remove the Recipe API type/CRD, admission webhook, webhook-only Service and TLS Secret, controller certificate configuration, and exclusive RBAC permissions.
  • Preserve DeploymentTemplateReconciler, DeploymentResourceReconciler, and FluxController. Shared operation status types move to operation_types.go; the retained deployment CRD schemas are unchanged. General Radius recipes and recipe packs are not removed.
  • Add focused API/chart regression coverage and update the architecture documentation to describe the remaining functionality. Historical design documents are unchanged.

Reason for change

Implement the removal option described in #12204 without retaining unused controller and admission infrastructure.

This is a breaking change submitted for review. Existing usage, deprecation requirements, migration, and release timing still need maintainer agreement before merging.

Existing Recipe resources would stop provisioning resources and refreshing connection Secrets. Plain Kubernetes Deployments would no longer be onboarded through radapp.io/enabled and related annotations, including connection environment-variable injection. Bicep/ARM deployments and Flux GitOps remain supported.

Helm does not delete CRDs installed from crds/ on upgrade. Existing Recipe objects and legacy finalizers can remain after the controllers are removed. Cleanup using the old controllers can delete backing resources and generated Secrets. This PR does not automatically migrate resources, delete existing CRDs, or strip finalizers. The existing explicit uninstall --purge cleanup entry is retained.

Before release, coordinate updates in radius-project/docs for docs/content/reference/samples/helm/index.md and docs/content/reference/samples/tutorial-add-radius/index.md. Those cross-repository changes are not included here.

Fixes #12204

How to test

KUBEBUILDER_ASSETS="$(go tool setup-envtest use -p path '1.30.*' --arch amd64)" \
  go test ./pkg/controller/... ./cmd/controller/... ./pkg/cli/kubernetes/... \
  -count=1 -timeout=10m

golangci-lint run --timeout 10m ./pkg/controller/... ./cmd/controller/...

# Compile the retained functional Kubernetes tests without running them.
go test ./test/functional-portable/kubernetes/noncloud/... -run '^$' -count=1

helm unittest \
  -f 'tests/controller_test.yaml' \
  -f 'tests/networkpolicies_test.yaml' \
  -f 'tests/helpers_test.yaml' deploy/Chart

shellcheck build/scripts/start-radius.sh

Controller/envtest coverage passes, including after the review follow-up. The affected packages pass the repository-pinned golangci-lint v2.13.2; the unused deletion helper reported by CI was removed. The targeted Helm run passed 85 tests across three suites. Rendering the chart with --include-crds confirmed that the Recipe CRD and admission resources are absent while both deployment CRDs remain. Regenerating controller API code and CRDs left the retained CRD manifests unchanged.

No live-cluster functional or upgrade test has been performed locally. A pre-removal-to-new-version upgrade exercise is still needed before release, particularly for existing Recipe objects, generated Secrets, and legacy finalizers.

File change summary

File Summary of change
pkg/controller/service.go Remove legacy controller registration and webhook/TLS setup; retain deployment, Flux, metrics, and health handling.
pkg/controller/reconciler/{recipe_reconciler,recipe_webhook,deployment_reconciler,annotations,connections,deployment_util}.go and associated tests Delete the removed implementation and exclusive tests.
pkg/controller/reconciler/{const,util,util_test,main_test,shared_test}.go Remove exclusive constants, helpers, fixtures, and webhook test setup; retain supported deployment/Flux helpers and envtest lifecycle handling.
pkg/controller/api/radapp.io/v1alpha3/{recipe_types,operation_types,zz_generated.deepcopy,groupversion_info_test}.go Remove Recipe types, preserve shared operation status, regenerate deepcopy code, and assert Recipe types are no longer registered.
cmd/controller/cmd/root.go, cmd/controller/controller-dev.yaml, build/configs/controller.yaml, build/scripts/start-radius.sh Remove controller certificate flags and obsolete webhook server configuration.
deploy/Chart/crds/radius/radapp.io_recipes.yaml, deploy/Chart/templates/controller/* Remove the Recipe CRD and admission resources, TLS wiring, webhook configuration, and exclusive RBAC permissions.
deploy/Chart/templates/networkpolicies.yaml, deploy/Chart/values.yaml, deploy/Chart/README.md Limit external control-plane ingress to UCP and remove obsolete webhook references.
deploy/Chart/tests/{controller,networkpolicies}_test.yaml Cover admission-resource removal, preserved controller ports/configuration/RBAC, and UCP-only network policy targeting.
test/functional-portable/kubernetes/noncloud/kubernetes_test.go, test/functional-portable/kubernetes/noncloud/testdata/tutorial-environment.bicep Remove the Kubernetes-manifest onboarding functional test and its exclusive fixture.
docs/architecture/{controller,service-interaction-map}.md Describe retained responsibilities without migration or historical-removal sections.

Remove the Recipe CRD, annotation-based Deployment onboarding, and admission webhook along with their exclusive helpers and Helm resources. Preserve deployment CRDs and Flux, add focused regression coverage, and document upgrade and migration risks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Sep 10, 2026

Copy link
Copy Markdown

Unit Tests

    2 files  ± 0    461 suites  ±0   6m 20s ⏱️ - 1m 16s
6 485 tests  - 46  6 483 ✅  - 46  2 💤 ±0  0 ❌ ±0 
7 761 runs   - 46  7 759 ✅  - 46  2 💤 ±0  0 ❌ ±0 

Results for commit f2df271. ± Comparison against base commit fffca1e.

This pull request removes 48 and adds 2 tests. Note that renamed tests count towards both.
github.com/radius-project/radius/pkg/controller/api/radapp.io/v1alpha3 ‑ TestAddToScheme/Recipe
github.com/radius-project/radius/pkg/controller/api/radapp.io/v1alpha3 ‑ TestAddToScheme/RecipeList
github.com/radius-project/radius/pkg/controller/reconciler ‑ TestContainerHasResourceReference
github.com/radius-project/radius/pkg/controller/reconciler ‑ TestContainerHasResourceReference/has_matching_resource_reference
github.com/radius-project/radius/pkg/controller/reconciler ‑ TestContainerHasResourceReference/missing_matching_reference
github.com/radius-project/radius/pkg/controller/reconciler ‑ TestContainerHasResourceReference/nil_container
github.com/radius-project/radius/pkg/controller/reconciler ‑ TestMakeKubernetesDeploymentResourceID
github.com/radius-project/radius/pkg/controller/reconciler ‑ Test_DeploymentReconciler_ChangeEnvironmentAndApplication
github.com/radius-project/radius/pkg/controller/reconciler ‑ Test_DeploymentReconciler_Connections
github.com/radius-project/radius/pkg/controller/reconciler ‑ Test_DeploymentReconciler_RadiusDisabled_ThenRadiusDisabled
…
github.com/radius-project/radius/pkg/controller/api/radapp.io/v1alpha3 ‑ TestAddToScheme/RecipeListNotRegistered
github.com/radius-project/radius/pkg/controller/api/radapp.io/v1alpha3 ‑ TestAddToScheme/RecipeNotRegistered

♻️ This comment has been updated with latest results.

@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 59.44%. Comparing base (fffca1e) to head (f2df271).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pkg/controller/service.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12952      +/-   ##
==========================================
- Coverage   59.82%   59.44%   -0.38%     
==========================================
  Files         779      773       -6     
  Lines       46058    45097     -961     
==========================================
- Hits        27552    26807     -745     
+ Misses      18506    18290     -216     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Remove migration and historical notices as requested, and delete the unused legacy deletion helper flagged by CI.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: willdavsmith <willdavsmith@gmail.com>
@willdavsmith
willdavsmith marked this pull request as ready for review September 10, 2026 16:53
@willdavsmith
willdavsmith requested a review from a team as a code owner September 10, 2026 16:53
Copilot AI lite review requested due to automatic review settings September 10, 2026 16:53
@willdavsmith
willdavsmith requested a review from a team as a code owner September 10, 2026 16:53
@radius-functional-tests

radius-functional-tests Bot commented Sep 10, 2026

Copy link
Copy Markdown

Radius functional test overview

🔍 Go to test action run

Click here to see the test run details
Name Value
Repository radius-project/radius
Commit ref f2df271
Unique ID func0f94ee0993
Image tag pr-func0f94ee0993
  • Dapr: 1.14.4
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.3.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func0f94ee0993
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func0f94ee0993
  • dynamic-rp test image location: ghcr.io/radius-project/dev/dynamic-rp:pr-func0f94ee0993
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func0f94ee0993
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func0f94ee0993
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The breaking controller and chart removal retains a CRD-rendering coverage gap, and upgrade behavior has not been exercised live.

Pull request overview

Removes legacy Recipe and annotation-based Kubernetes onboarding while retaining deployment-template, deployment-resource, and Flux workflows.

Changes:

  • Removes legacy controllers, API/CRD, webhook infrastructure, TLS, RBAC, and tests.
  • Updates controller configuration, Helm resources, network policies, and documentation.
  • Preserves shared operation status types and retained controller functionality.
File summaries
File Summary
test/functional-portable/kubernetes/noncloud/testdata/tutorial-environment.bicep Removes the obsolete Kubernetes onboarding fixture.
test/functional-portable/kubernetes/noncloud/kubernetes_test.go Removes annotation-based onboarding coverage.
pkg/controller/service.go Retains supported controllers, metrics, and health handling.
pkg/controller/reconciler/util.go Retains shared utilities needed by supported controllers.
pkg/controller/reconciler/util_test.go Updates utility tests after legacy removal.
pkg/controller/reconciler/shared_test.go Updates shared test helpers and environment setup.
pkg/controller/reconciler/recipe_webhook.go Removes the legacy Recipe webhook.
pkg/controller/reconciler/recipe_webhook_test.go Removes Recipe webhook tests.
pkg/controller/reconciler/recipe_reconciler.go Removes the Recipe reconciler.
pkg/controller/reconciler/recipe_reconciler_test.go Removes Recipe reconciler tests.
pkg/controller/reconciler/main_test.go Removes obsolete webhook test setup while retaining shared lifecycle handling.
pkg/controller/reconciler/deployment_util.go Retains deployment utilities for supported workflows.
pkg/controller/reconciler/deployment_util_test.go Updates deployment utility tests.
pkg/controller/reconciler/deployment_reconciler.go Removes annotation-based deployment reconciliation.
pkg/controller/reconciler/deployment_reconciler_test.go Removes annotation reconciler tests.
pkg/controller/reconciler/const.go Removes legacy-only constants.
pkg/controller/reconciler/connections.go Removes exclusive legacy connection helpers.
pkg/controller/reconciler/annotations.go Removes annotation-based onboarding helpers.
pkg/controller/reconciler/annotations_test.go Removes annotation helper tests.
pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go Regenerates deepcopy code after Recipe removal.
pkg/controller/api/radapp.io/v1alpha3/recipe_types.go Removes Recipe API types.
pkg/controller/api/radapp.io/v1alpha3/operation_types.go Preserves shared operation status types.
pkg/controller/api/radapp.io/v1alpha3/groupversion_info_test.go Verifies Recipe types are no longer registered.
docs/architecture/service-interaction-map.md Documents the retained service interactions.
docs/architecture/controller.md Documents the remaining controller responsibilities.
deploy/Chart/values.yaml Removes obsolete webhook configuration references.
deploy/Chart/tests/networkpolicies_test.yaml Tests UCP-only network policy targeting.
deploy/Chart/tests/controller_test.yaml Tests retained controller resources and admission-resource removal.
deploy/Chart/templates/networkpolicies.yaml Limits external control-plane ingress to UCP.
deploy/Chart/templates/controller/validating-webhook-configuration.yaml Removes the validating webhook resource.
deploy/Chart/templates/controller/service.yaml Removes webhook and TLS service wiring.
deploy/Chart/templates/controller/rbac.yaml Removes exclusive webhook RBAC permissions.
deploy/Chart/templates/controller/deployment.yaml Removes obsolete webhook deployment configuration.
deploy/Chart/templates/controller/configmaps.yaml Removes obsolete webhook-related configuration.
deploy/Chart/README.md Removes obsolete webhook references.
deploy/Chart/crds/radius/radapp.io_recipes.yaml Removes the Recipe CRD.
cmd/controller/controller-dev.yaml Removes obsolete controller certificate configuration.
cmd/controller/cmd/root.go Removes controller certificate flags.
build/scripts/start-radius.sh Removes obsolete webhook startup configuration.
build/configs/controller.yaml Removes controller certificate configuration.

Review note (moderate, 1 vote): deploy/Chart/tests/controller_test.yaml does not render crds/radius; add committed helm template --include-crds-equivalent coverage for the removed Recipe CRD and retained CRDs.

Review details

Files not reviewed (1)

  • pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go: Generated file

Suppressed comments (1)

deploy/Chart/tests/controller_test.yaml:88

  • The controller suite only renders templates/controller/* (and this case renders controller/configmaps.yaml), so it never exercises the chart's crds/radius directory. A future reintroduction of radapp.io_recipes.yaml would therefore pass these tests even though the removed CRD is installed again; add a committed helm template --include-crds-equivalent regression check that asserts the Recipe CRD is absent while the two retained CRDs remain.
  - it: removes webhook server configuration
    templates:
      - controller/configmaps.yaml
  • Files reviewed: 39/40 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Existing Recipe and Deployment finalizers need an upgrade cleanup path to prevent stuck deletions and orphaned resources.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Files not reviewed (1)

  • pkg/controller/api/radapp.io/v1alpha3/zz_generated.deepcopy.go: Generated file
  • Files reviewed: 39/40 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread pkg/controller/service.go
Port: port,
CertDir: s.TLSCertDir,
})})
})
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.

Evaluate removing the Recipe CRD and annotation-based Kubernetes controllers (RecipeReconciler, DeploymentReconciler, RecipeWebhook)

2 participants