Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node enables interaction with Kubernetes clusters by performing various operations on Kubernetes resources. Specifically, for the Deployments resource with the Get operation, it retrieves information about one or more deployment objects within a specified namespace. Users can filter deployments by name, field selectors, or label selectors to narrow down the results.

Common scenarios where this node is beneficial include:

  • Monitoring the status and details of specific deployments in a Kubernetes cluster.
  • Automating workflows that require fetching deployment metadata before making decisions or triggering other actions.
  • Integrating Kubernetes deployment data into broader automation pipelines without manual kubectl commands.

Practical example:

  • Retrieve details of a deployment named "my-app" in the "production" namespace to check its current state or configuration.

Properties

Name Meaning
Namespace The Kubernetes namespace where the deployment resides. Defaults to "default".
Resource Name The exact name of the deployment resource to retrieve. If provided, the node fetches only this deployment.
Field Selector A Kubernetes field selector string to filter deployments based on resource fields (e.g., metadata.name=my-deployment). See Kubernetes Field Selectors.
Label Selector A Kubernetes label selector string to filter deployments based on labels (e.g., app=frontend). See Kubernetes Labels.

Output

The output is a JSON array containing the retrieved deployment(s) data as returned by the Kubernetes API. Each item corresponds to a deployment object with its full metadata and status fields.

Example structure snippet (simplified):

[
  {
    "apiVersion": "apps/v1",
    "kind": "Deployment",
    "metadata": {
      "name": "my-deployment",
      "namespace": "default",
      "labels": { "app": "my-app" },
      ...
    },
    "spec": { ... },
    "status": { ... }
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires valid Kubernetes API credentials configured in n8n to authenticate and communicate with the Kubernetes cluster.
  • The node depends on an internal Kubernetes client utility to perform API requests.
  • No additional external services are required beyond access to the Kubernetes API endpoint.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that the node has proper authentication set up with a valid API token or kubeconfig.

  • Command must be an array!
    Although not relevant for the Get operation, this error may appear if the node is used with the Run operation and the command input is incorrectly formatted. For Get, this does not apply.

  • Empty or no results returned
    If filtering by resource name, field selector, or label selector yields no results, verify that the filters are correct and that the deployment exists in the specified namespace.

  • API connection errors
    Network issues, incorrect API URLs, or insufficient permissions can cause failures. Confirm connectivity and RBAC permissions for the credentials used.

Links and References

Discussion