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.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
- 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’sdisconnectionsuntil the disconnection has finished. Nothing changes on the cluster yet. The application keeps running with the connection it has. - The application environment’s next deploy. The deploy removes the workloads’ reference to the
<service>-connectionSecret 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. - 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’ssecretKeyRef, 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. - 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.
timing set to now is refused.
What the review shows
The review is a plan the platform resolved for this environment. Each part carries astatement, 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.
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 asDATABASE_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_requiredistrueandchoiceslists the services you can choose. Prepare the review again with your choice, inconnection_names_instance_idor withconnection_names_noneset totrue. 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 markedinstallingis a service still being set up, so it is a new, empty service.
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.
Follow the disconnection
While the disconnection has not finished, Get a managed service instance lists it underdisconnections, 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 readsremoved, 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:
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.