Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node interacts with Kubernetes clusters to perform various operations on Kubernetes resources. Specifically, for the Services resource with the List operation, it retrieves a list of Kubernetes Service objects from a specified namespace, optionally filtered by field selectors or label selectors.

Common scenarios where this node is beneficial include:

  • Automating infrastructure monitoring by listing services running in a cluster.
  • Integrating Kubernetes service data into workflows for deployment pipelines or auditing.
  • Filtering and retrieving specific services based on labels or fields for targeted automation tasks.

For example, you could use this node to list all services in the "default" namespace that have a particular label, then trigger downstream actions based on those services' properties.

Properties

Name Meaning
Namespace The Kubernetes namespace from which to list the services. Defaults to "default".
Resource Name (Optional) Specific name of a service resource to filter the list to a single named service.
Field Selector A Kubernetes field selector string to filter the listed services by specific object fields. See Kubernetes Field Selectors.
Label Selector A Kubernetes label selector string to filter the listed services by labels. See Kubernetes Labels.

Output

The output is a JSON array where each item represents a Kubernetes Service object matching the query parameters. Each JSON object contains the full details of a service as returned by the Kubernetes API, including metadata, spec, and status fields.

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 interact with the Kubernetes API.
  • No additional external services are required beyond access to the Kubernetes cluster.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that the node has proper credentials set up with sufficient permissions to list services.

  • Invalid field selector or label selector syntax
    If filtering returns no results or errors, verify that the field selector and label selector strings conform to Kubernetes syntax rules.

  • Empty results despite existing services
    Check that the correct namespace is specified and that any filters applied do not exclude all services unintentionally.

Links and References

Discussion