Deleting an agent
When an agent is no longer required, you can delete the agent.
Deleting an agent using the UI
- Log in to your IBM Cloud account by using your credentials.
- Navigate to Schematics > Agents.
- Click the
...
dots > Delete agent. - In the Delete Agent pop-up type
<your agent name>
to confirm. Note the delete agent action cannot be undone. - Click Delete.
Deleting an agent using the CLI
You can delete an agent or uninstall an agent from the Kubernetes cluster by using an agent delete command. This command requires
an AGENT_ID
as input argument.
Example
ibmcloud schematics agent delete --id agent-ga-prod-cli-jan-10.soA.cd1c
Output
Do you really want to delete the agent agent-ga-prod-cli-jan-10.soA.cd1c? [y/N]> y
Deleting Agent...
Agent agent-ga-prod-cli-jan-10.soA.cd1c deleted successfully
OK
When the agent is deleted, you can expect:
- All the agent microservices are uninstalled.
- All the agent related Kubernetes resources, such as Pods, Deployment, Configmap, and Namespaces are destroyed.
- All the credentials that are created as part of the agent deployment, such as HMAC credentials for the Object Storage bucket, trusted profile to communicate with Schematics are destroyed.
- All the information about the agent in the Schematics instance, of your IBM Cloud account are deleted.
When the agent is deleted, the following do not happen:
- The Kubernetes cluster is not destroyed. The cluster continues to incur cost until it is deleted.
- The Object Storage instance and the Object Storage bucket are destroyed.
- The agent assignment policy for the agent is not deleted.
Deleting an agent using the API
Follow the steps to retrieve your IAM access token and authenticate with IBM Cloud Schematics by using the API.
Example
GET /v2/agents/agent-beta1-testing.soA.748e/ HTTP/1.1
Host: schematics.cloud.ibm.com
Content-Type: application/json
Authorization: Bearer <auth_token>
Output
{
"requestid": "9dc76486-ec80-4a26-b159-6e2d46eeb39f",
"timestamp": "2023-03-16T21:13:20.244850864Z",
"messageid": "M1074",
"message": "The requested object cannot be located. Check that the ID is correct and try your request again.",
"statuscode": 404
}
Next steps
After deleting an agent,
- You can view the list of agents, and the agent assignment policy.
- You can check out the agent FAQ for any common questions related to deleting an agent.