Portainer icon

Portainer

Interact with Portainer via API

Actions190

Stacks → Stack Delete Kubernetes By Name

AI-generated

Overview

This node operation deletes a Kubernetes stack by its name within a specified environment. It is useful for automating the removal of Kubernetes stacks managed through Portainer, especially in scenarios where you want to programmatically clean up or manage your containerized applications. For example, if you have multiple test environments and want to delete specific stacks after tests complete, this operation can be integrated into your workflow.

Properties

Name Meaning
Name The name of the stack to delete.
Endpoint Id The identifier of the environment (endpoint) where the stack resides.
Additional Fields Optional additional parameters:
• External: Boolean flag to indicate deletion of an external stack. Only external Swarm stacks are supported when set to true.

Output

The output JSON will typically contain the response from the Portainer API regarding the deletion request. This may include status information confirming whether the stack was successfully deleted or any error messages returned by the API. The node does not explicitly handle binary data output.

Dependencies

  • Requires an API key credential for authenticating with the Portainer API.
  • The node expects the base URL of the Portainer instance to be configured in the credentials.
  • The operation uses the Portainer REST API endpoint for stack deletion, requiring network access to the Portainer server.

Troubleshooting

  • Common issues:

    • Incorrect stack name or endpoint ID may result in failure to find or delete the stack.
    • Attempting to delete a non-external stack while setting the "External" flag to true will likely cause errors.
    • Network connectivity problems or invalid API credentials will prevent successful API calls.
  • Error messages:

    • "Stack not found": Verify that the stack name and endpoint ID are correct.
    • "Unauthorized": Check that the API key credential is valid and has sufficient permissions.
    • "Bad Request" or similar HTTP errors: Review the additional fields and ensure they conform to expected values.

Links and References

Discussion