Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes resources, specifically supporting various operations on Kubernetes Jobs when the "Jobs" resource and "Patch" operation are selected. The Patch operation enables users to modify existing Kubernetes Job resources by applying partial updates.

Common scenarios for this node include automating updates to Kubernetes Jobs in a cluster, such as changing job specifications or metadata without recreating the entire resource. For example, you might patch a Job to update its container image or adjust job parameters dynamically as part of a CI/CD pipeline or operational workflow.

Properties

Name Meaning
Image The container image name used in operations like run, restart, exec, and patch.
Namespace The Kubernetes namespace where the Job resource resides. Defaults to "default".
Resource Name The specific name of the Job resource to target for the patch operation.

Note: Although the bundled code does not explicitly show the patch logic implementation details, these properties are relevant inputs for the Patch operation on Jobs.

Output

The output is a JSON array containing the results of the executed operation. Each item corresponds to an input item processed by the node and includes metadata about the execution.

  • The json field contains the response from the Kubernetes API after applying the patch to the Job resource.
  • If the operation involves running pods or commands (not directly related to patch), the output may include standard output (stdout) from those executions.
  • No binary data output is indicated for the Patch operation.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and authorize requests.
  • Depends on a Kubernetes client utility internally to communicate with the Kubernetes API server.
  • The node expects the Kubernetes cluster to be accessible from the environment where n8n runs.

Troubleshooting

  • No credentials got returned!
    This error occurs if the node cannot retrieve the required Kubernetes API credentials. Ensure that the credentials are properly set up and linked to the node.

  • Command must be an array!
    While not directly related to Patch, this error appears if the "command" property is provided but is not a valid JSON array. Verify that the command input is correctly formatted as a JSON array.

  • Resource not found or patch failed (inferred)
    If the specified Job resource name or namespace is incorrect, the patch operation will fail. Double-check the resource name and namespace values.

  • Network connectivity issues or insufficient permissions can also cause failures when communicating with the Kubernetes API.

Links and References

Discussion