Portainer icon

Portainer

Interact with Portainer via API

Actions190

Kubernetes → Kubernetes Namespaces Toggle System

AI-generated

Overview

This node operation allows toggling or updating Kubernetes namespaces by interacting with a Kubernetes environment. It is useful for managing namespace configurations dynamically within Kubernetes clusters, such as enabling or disabling namespaces or modifying their properties programmatically. Practical examples include automating namespace lifecycle management in CI/CD pipelines or adjusting namespace settings based on deployment requirements.

Properties

Name Meaning
Id Environment identifier: a numeric ID representing the target Kubernetes environment.
Namespace Namespace name: the specific Kubernetes namespace to be toggled or updated.
Body Update details: a JSON string containing the details of the update to apply to the namespace.

Output

The node outputs JSON data reflecting the result of the toggle or update operation on the specified Kubernetes namespace. This typically includes status information about the namespace after the operation, such as confirmation of changes or error messages if the update failed. The node does not output binary data.

Dependencies

  • Requires access to a Kubernetes cluster API endpoint.
  • Needs an API authentication token or credential configured in n8n to authorize requests to the Kubernetes environment.
  • The node uses HTTP requests to communicate with the Kubernetes API, so proper network access and permissions are necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing environment identifier (Id) can cause failures in targeting the correct Kubernetes cluster.
    • Incorrect namespace names may lead to "namespace not found" errors.
    • Malformed JSON in the Body property can cause request parsing errors.
    • Insufficient permissions or expired API tokens will result in authorization errors.
  • Error messages and resolutions:

    • "Namespace not found": Verify that the namespace exists in the targeted Kubernetes environment.
    • "Unauthorized" or "Forbidden": Check API credentials and ensure they have sufficient permissions.
    • "Invalid JSON body": Validate the JSON syntax in the Body input before executing the node.

Links and References

Discussion