Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Get Kubernetes Role Bindings

AI-generated

Overview

This node operation retrieves Kubernetes Role Bindings from a specified environment. It is useful for users who want to programmatically access and manage role bindings within their Kubernetes clusters, such as auditing permissions or integrating role binding data into workflows.

A practical example would be automating the retrieval of role bindings to verify user permissions across multiple environments or clusters without manually accessing each cluster.

Properties

Name Meaning
Id Environment identifier (a required numeric ID that specifies which Kubernetes environment to query for role bindings)

Output

The output will contain JSON data representing the Kubernetes Role Bindings retrieved from the specified environment. This typically includes details about subjects, roles, namespaces, and metadata associated with each role binding.

If the node supports binary data output, it would generally represent any attached files or manifests related to the role bindings, but based on the provided code and properties, the primary output is structured JSON data.

Dependencies

  • Requires an API key or authentication token configured in n8n credentials to connect securely to the Kubernetes environment.
  • The node depends on the Portainer API or a similar service acting as a proxy or manager for Kubernetes environments, as indicated by the bundled source referencing Portainer.
  • Proper configuration of the base URL and authentication credentials for the Kubernetes environment is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing environment identifier (Id property) will prevent the node from retrieving data.
    • Authentication failures due to incorrect or expired API keys.
    • Network connectivity issues between n8n and the Kubernetes environment or Portainer API.
    • Insufficient permissions in the Kubernetes cluster to list role bindings.
  • Error messages:

    • "Unauthorized" or "Authentication failed": Check API credentials and ensure they have proper access.
    • "Not found" or "Environment does not exist": Verify the Id corresponds to a valid environment.
    • Timeout errors: Confirm network connectivity and that the target service is reachable.

Links and References

Discussion