Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes resources, specifically supporting operations such as deleting namespaces among others. When configured to delete a namespace, it sends a request to remove the specified Kubernetes namespace from the cluster.

Common scenarios for using this node include automating Kubernetes resource management tasks like cleaning up unused namespaces, managing lifecycle of environments, or integrating Kubernetes operations into broader automation workflows.

For example, you might use this node in a CI/CD pipeline to delete a test namespace after tests complete, ensuring that resources are freed and the cluster remains clean.

Properties

Name Meaning
Namespace The Kubernetes namespace where the target resource resides. Defaults to "default".
Resource Name The name of the specific resource (namespace) to delete.

Output

The node outputs JSON data representing the result of the delete operation. This typically includes status information returned by the Kubernetes API about the deletion request, such as confirmation of deletion or error details if the operation failed.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authenticating with the Kubernetes cluster.
  • Needs proper permissions on the Kubernetes cluster to delete namespaces.
  • The node depends on a Kubernetes client utility internally to communicate with the Kubernetes API.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that valid credentials are provided and properly connected in n8n.

  • Permission denied or forbidden errors from Kubernetes API
    The user associated with the credentials may lack permission to delete namespaces. Verify RBAC settings and ensure the token has sufficient privileges.

  • Resource not found or invalid resource name
    If the specified namespace does not exist or the resource name is incorrect, the operation will fail. Double-check the namespace name spelling and existence.

  • Command must be an array! (not directly related to delete but present in code)
    For other operations requiring commands, ensure the command input is a valid JSON array.

Links and References

Discussion