Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Delete Role Bindings

AI-generated

Overview

This node operation allows you to delete Kubernetes Role Bindings in specified namespaces. It is useful for managing access control within a Kubernetes cluster by programmatically removing role bindings that grant permissions to users or service accounts. Typical use cases include cleaning up outdated or unnecessary permissions, automating security policies, or integrating Kubernetes RBAC management into workflows.

For example, you might use this node to delete specific role bindings across multiple namespaces as part of a deployment pipeline or during cluster maintenance.

Properties

Name Meaning
Id Environment identifier (a numeric ID) used to specify the target Kubernetes environment.
Payload A JSON string representing a map where each key is a namespace and the value is an array of role binding names to delete in that namespace.

Example of Payload structure:

{
  "namespace1": ["roleBinding1", "roleBinding2"],
  "namespace2": ["roleBinding3"]
}

Output

The node outputs JSON data reflecting the result of the delete operations. This typically includes confirmation of which role bindings were successfully deleted or any errors encountered per namespace or role binding. The exact structure depends on the API response but generally provides status information for each requested deletion.

No binary data output is expected from this operation.

Dependencies

  • Requires connection to a Kubernetes environment accessible via an API.
  • Needs an API authentication token or credential configured in n8n to authorize requests against the Kubernetes API.
  • The node uses HTTP requests with JSON payloads to interact with the Kubernetes API server.

Troubleshooting

  • Invalid Environment Id: If the provided environment identifier does not correspond to a valid Kubernetes cluster configuration, the node will fail to connect. Verify the environment ID and credentials.
  • Malformed Payload: The payload must be a valid JSON string mapping namespaces to arrays of role binding names. Errors in formatting or missing required fields will cause request failures.
  • Permission Denied: Insufficient permissions to delete role bindings in the specified namespaces will result in authorization errors. Ensure the API token has appropriate RBAC rights.
  • Role Binding Not Found: Attempting to delete non-existent role bindings will typically return errors or warnings. Confirm the role binding names are correct.
  • API Connectivity Issues: Network problems or incorrect API endpoint URLs can prevent successful communication with the Kubernetes API.

Links and References

Discussion