Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node allows interaction with Kubernetes resources, specifically supporting operations such as listing, getting, deleting, running pods, and more. For the ReplicaSets resource with the List operation, it fetches a list of ReplicaSet objects from a specified Kubernetes namespace, optionally filtered by field selectors or label selectors.

Common scenarios include:

  • Retrieving all ReplicaSets in a namespace to monitor deployment status.
  • Filtering ReplicaSets by labels to find specific groups managed by certain controllers.
  • Using field selectors to narrow down results based on metadata fields like name.

Practical example:

  • A DevOps engineer wants to list all ReplicaSets in the "production" namespace that have a label app=frontend to check their current state and replicas count.

Properties

Name Meaning
Namespace The Kubernetes namespace to query for ReplicaSets. Defaults to "default".
Resource Name (Optional) Specific name of a ReplicaSet to retrieve. If provided, it filters the list to this exact ReplicaSet.
Field Selector (Optional) A field selector string to filter ReplicaSets by specific fields, e.g., metadata.name=my-replicaset.
Label Selector (Optional) A label selector string to filter ReplicaSets by labels, e.g., app=frontend,tier=backend.

Output

The output is a JSON array where each item represents a ReplicaSet object returned from the Kubernetes API. Each item contains the full ReplicaSet resource data as received from Kubernetes, including metadata, spec, and status fields.

No binary data output is produced by this operation.

Dependencies

  • Requires an API authentication token or credentials configured in n8n to access the Kubernetes cluster.
  • The node depends on a Kubernetes client utility internally to communicate with the Kubernetes API.
  • Proper RBAC permissions must be granted to the API token to list ReplicaSets in the target namespace.

Troubleshooting

  • No credentials got returned!
    This error indicates missing or misconfigured Kubernetes API credentials. Ensure that valid credentials are set up in n8n before executing the node.

  • Empty result or no ReplicaSets found
    Verify the namespace, field selector, and label selector values. Incorrect selectors or namespaces may yield no results.

  • Permission denied errors
    Check that the API token has sufficient permissions to list ReplicaSets in the specified namespace.

  • Invalid field selector or label selector syntax
    Refer to Kubernetes documentation on field selectors and label selectors to ensure correct formatting.

Links and References

Discussion