Skip to main content
Closed beta. Disconnecting an application is part of Managed services, which is in closed beta and enabled per organisation on request. Contact support to have it turned on for your organisation.
Disconnecting takes one application environment off a managed service, while the service keeps running for its other applications. It takes two steps: Ankra prepares a review of exactly what the disconnection does, and you confirm it. Nothing changes until you confirm, and the running application is not touched until its next deploy. To remove the service itself, with its data, delete it instead.
The portal and the Ankra CLI cannot disconnect an application yet; both will follow. Until then, disconnect through the API, as under Disconnect through the API, or ask the AI Assistant or an MCP client, which use the tools prepare_service_disconnection and confirm_service_disconnection. In the AI Assistant, confirming always asks for your approval first, whatever its mode.
Disconnecting does not revoke the application’s credential. All the applications connected to a service share one credential. The application keeps the one it has, and it can still use the service from any namespace the network still admits. To make sure it can no longer authenticate, rotate the service’s credential, which changes it for every connected application. Ankra has no rotation for managed services yet. See What disconnecting can and cannot do.

Prerequisites

  • The service is installed and not being deleted. A service whose installation has not finished, or whose deletion was confirmed, cannot have an application disconnected from it.
  • No deploy of the application environment is in progress. Wait for it to finish.
  • Your role allows it. Disconnecting needs exactly what connecting the environment needed:
The built-in owner, admin and operator roles hold all of them. An API token needs them too, and its own scopes must allow them. See Roles and access.

What happens, in order

  1. You confirm. The service stops counting the environment among the applications it serves at once: it is no longer among the service’s consumers, and it is listed under the service’s disconnections until the disconnection has finished. Nothing changes on the cluster yet. The application keeps running with the connection it has.
  2. The application environment’s next deploy. The deploy removes the workloads’ reference to the <service>-connection Secret and rolls them, as any deploy rolls a changed workload. When the environment had received the Secret, the deploy writes it again exactly as it was, so a pod started before the disconnection that restarts during the rollout still finds the values it started with. After this deploy, the workloads no longer receive the service’s variables. Deploy the application now to finish sooner, or let its next deploy do it.
  3. Ankra removes the Secret once no pod reads it. Every 15 seconds, Ankra checks whether any pod in the namespace reads the Secret, through envFrom, an environment variable’s secretKeyRef, or a Secret or projected volume, terminating pods included, and whether any workload in the application’s deployed manifest still refers to it. When two checks in a row, at least 10 seconds apart, find nothing, Ankra removes the Secret from the application’s namespace. Removing it restarts nothing.
  4. Ankra takes the namespace off the service’s client port, unless you chose to keep network access or there is nothing to narrow, as under Network access. The disconnection has then finished, and records what Ankra observed.
Ankra restarts nothing by itself. The only pods that roll are the application environment’s own workloads, in the deploy you run. Ankra checks for readers only while the application’s cluster is online, while no deploy of the environment is in progress, and while its view of the cluster’s pods and Secrets is current, synced within the last 15 minutes. In a few cases it also waits for something else to settle first, for example the deletion of another service connected to the environment. Until then, the Secret stays.
A workload whose reference to the Secret was written by hand keeps it in place. Ankra removes only the reference a deploy attached. A workload that reads <service>-connection through a reference someone wrote keeps the disconnection waiting, and with it the Secret, because removing the Secret is the change that would break that workload. Nothing times out: change or remove such workloads yourself. Ankra also cannot see a workload deployed some other way that has no running pod, such as a CronJob between runs or a Deployment scaled to zero. Once the Secret is gone, such a workload starts without its values.
Disconnecting at once, before the next deploy, is not offered. The application would keep the shared credential it has, so cutting it off at once would only break it without revoking anything. A request with timing set to now is refused.

What the review shows

The review is a plan the platform resolved for this environment. Each part carries a statement, the platform’s own words for what the disconnection does. Read each one before you confirm. Beside the plan, running_pods lists the pods that read the Secret right now, read when the answer is served. It is not part of the plan, so it can change without the review changing. An environment on another cluster than the service never received a connection from Ankra: on_service_cluster is false, confirming removes only the service’s record of it, and the disconnection finishes at once.

What disconnecting can and cannot do

Every service Ankra publishes gives all the applications connected to it one shared credential. A disconnection removes the connection Ankra delivered, the workloads’ reference to it and, for most services, the namespace’s network access. It never changes the credential. For every service:
  • Rotating the credential affects every connected application. It is the only way to make sure the disconnected application can no longer authenticate, and Ankra has no rotation for these services yet.
  • The network change holds only where the cluster’s network plugin enforces NetworkPolicy. New connections from the namespace are then refused. Connections already open may stay open until they close, depending on the plugin. A service installed on an earlier package version admits every namespace on its client port, so nothing changes on the network.
  • Nothing is deleted from the service. For PostgreSQL the database and everything the application wrote stay. For the other services Ankra cannot tell which keys, streams, indices, objects, logs or metrics the application wrote, so nothing is deleted.

What stays

  • Earlier copies of the connection Secret, in the namespace’s Helm release history (<application>-services, up to 10 revisions), until newer revisions replace them.
  • The shared credential, which stays valid: the application can still use the one it has wherever the network admits it.
  • For PostgreSQL, the service’s backups, which keep whatever the application wrote until their retention ends.
While the disconnection has not finished, a service newly connected to the same environment reaches it only with the environment’s next deploy, not on its own.

Network access

By default, Ankra takes the application’s namespace off the service’s client port once no pod reads the connection Secret. Choose to keep network access (keep_network_access) when something else in that namespace still needs to reach the service, for example a workload someone wired to it by hand, which would otherwise lose access too. The namespace keeps its access while the disconnection waits for pods to stop reading the Secret and for the Secret to be gone. network.reason in the review says what happens after that:

Names such as DATABASE_URL

Of each kind of service connected to an application environment, one gives the names without a prefix, such as DATABASE_URL or REDIS_URL, as under Variable names. Ankra never moves those names to another service by itself: that would make the application read and write a different database without anyone choosing it. So when the service you disconnect gives them:
  • No other service of that kind is connected to the environment. The next deploy stops delivering those names, with the service’s other variables.
  • Another service of that kind is connected. The review asks you to choose which service gives the names from now on, or none: choice_required is true and choices lists the services you can choose. Prepare the review again with your choice, in connection_names_instance_id or with connection_names_none set to true. Confirming without a choice is refused. Ankra records the choice for the environment when you confirm. From the next deploy the chosen service gives the names, or none does, and that deploy rolls the workloads onto the change. A choice marked installing is a service still being set up, so it is a new, empty service.
A choice in a review that does not ask for one is refused.

Disconnect through the API

Disconnecting takes two calls, a prepare and a confirm, with an API token whose holder has the permissions above.
1

Read the service

Read the service with Get a managed service instance for its generation and the id of the environment among its consumers.
2

Prepare the review

Prepare a managed-service disconnection review. Every field is required:
The answer carries the disconnection’s id, its plan, its digest and its expires_at, 10 minutes later. Nothing changes. If plan.connection_names.choice_required is true, prepare it again with your choice, as under Names such as DATABASE_URL.
3

Confirm it by its digest

Confirm a managed-service disconnection by its digest within the 10 minutes:
The platform resolves the plan again and refuses when anything it covers changed since the review. Confirming again with the same digest returns the same disconnection, never a second one.
4

Deploy the application

Deploy the application environment, or let its next deploy run. Until then the application keeps working against the service.
Each person can hold at most 10 disconnection reviews waiting for confirmation, and each organisation 50. A review you do not confirm expires on its own and changes nothing.

Follow the disconnection

While the disconnection has not finished, Get a managed service instance lists it under disconnections, with its phase: disconnections.state reads unknown when the platform could not read them; items is then empty and says nothing about whether a disconnection is in progress. A finished disconnection leaves the list. The person who prepared the disconnection can read it at any time, while they still hold the permissions, by confirming it again with the same digest. The answer carries its state (in_progress, then settled), its phase, the running_pods that still read the Secret while it waits, and, once it has finished, its outcome. The outcome records only what Ankra observed:

Verify

Once the outcome reads removed, check the application’s namespace yourself:
<service>-connection is no longer listed.

What is refused

While you prepare or confirm

While a disconnection is in progress

  • Connecting the same environment to the service again is refused with This application environment is still being disconnected from the service; connect it again once the disconnection has finished.
  • Deleting the service is refused with An application is still being disconnected from the service; retire it once the disconnection has finished. Deleting the service would remove the source of the Secret the disconnection keeps in place for pods that still read it.
  • A deploy of the environment is refused, and deploys nothing, when the release that delivers the application’s connections renders the Secret in another form than the one kept when the service was disconnected, because its values were changed outside Ankra. The refusal names the release and the Secret. Restore the release’s values from the stack’s version history, the version before the change, and deploy again. If they cannot be restored, contact Ankra support.

Deleting an application or removing its binding

While a service still serves an application environment, deleting the application is refused, and so is removing the environment’s binding (ankra services consumers unbind, or the MCP tool unbind_service_consumer). The refusals say to disconnect first:
Disconnect each of the application’s environments from each service the refusal names, or delete those services. A confirmed disconnection takes the environment off the service at once, so that service no longer holds the deletion or the binding.

Next steps

Connect to a managed service

How applications receive a connection, and the variable names for each service.

Delete a managed service

Remove the service itself, with its data, through a reviewed plan.