Skip to content

rad app delete --preview succeeds while recipe-generated Kubernetes resources remain #12878

Description

@willdavsmith

Summary

rad app delete <application> --yes --preview reports successful deletion of the application's Radius resources and application record, but the Kubernetes resources generated by those resources' recipes remain on the target cluster.

This was reproduced from a clean application baseline using an ephemeral Radius control plane with state restored by rad startup. Both container and routes outputs remained, so the problem is not specific to Gateway API cleanup.

Reproduction

  1. Remove all existing Kubernetes resources labeled radapp.io/application=gateway-managed-demo.

  2. Deploy an application containing:

    • Radius.Compute/containers resource web
    • Radius.Compute/routes resource web
    • Radius.Compute/containerImages resource web-image
    • Radius.Security/secrets resource radius-ghcr-registry-creds
  3. Verify that fresh Kubernetes resources were created on the target AKS cluster.

  4. Persist the Radius control-plane and recipe state with rad shutdown.

  5. Start a new ephemeral control plane and restore the state with rad startup.

  6. Run:

    rad app delete gateway-managed-demo --yes --preview
  7. Inspect the target cluster:

    kubectl get deployments,services,httproutes,tcproutes,tlsroutes,udproutes \
      -A -l radapp.io/application=gateway-managed-demo

Expected behavior

The resource delete operations should remove their recipe-generated Kubernetes outputs before the long-running operations complete and before the application deletion reports success.

Actual behavior

The CLI reported:

Deleting 4 resource(s) associated with application gateway-managed-demo...
  Deleting .../Radius.Compute/containers/web...
  Deleting .../Radius.Compute/routes/web...
  Deleting .../Radius.Compute/containerImages/web-image...
  Deleting .../Radius.Security/secrets/radius-ghcr-registry-creds...
Deleting application gateway-managed-demo...
Application deleted

However, the following freshly created resources remained after the workflow completed:

  • Deployment default/web
  • Service default/web-web
  • HTTPRoute default/routes-ly4cicrlqtmbo
  • TCPRoute default/routes-ly4cicrlqtmbo
  • TLSRoute default/routes-ly4cicrlqtmbo
  • UDPRoute default/routes-ly4cicrlqtmbo

The clean deploy created these objects around 2026-08-31T20:59Z; the delete completed around 2026-08-31T21:05Z, and the objects still existed afterward.

Workflow evidence

The delete workflow logged successful restoration of both control-plane databases and Terraform recipe state before executing the command.

Impact

This leaves application workloads and routing resources orphaned while Radius no longer has the application/resource records needed to delete them on a subsequent run. It also prevents safe shared Gateway cleanup: the Gateway lifecycle action sees the remaining Route objects and correctly retains the Gateway, GatewayClass, Contour installation, and Gateway API CRDs.

Investigation notes

DeleteResourcesInParallel waits for each management client's delete poller, so the unresolved boundary appears to be between the Radius resource deletion completing and its recipe-generated Kubernetes outputs being removed. Possible areas include restored recipe-state association, Bicep recipe deletion, or Kubernetes output deletion. The workflow evidence does not yet distinguish among them.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triagedThis issue has been reviewed and triaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions