Kubernetes icon

Kubernetes

Interact with Kubernetes

Overview

This node interacts with Kubernetes clusters to perform various operations on Kubernetes resources, specifically here focusing on the ReplicaSets resource with the Get operation. It retrieves information about ReplicaSets within a specified namespace, optionally filtered by resource name, field selectors, or label selectors.

Common scenarios include:

  • Fetching details of a specific ReplicaSet by name.
  • Listing ReplicaSets filtered by labels or fields for monitoring or automation workflows.
  • Integrating Kubernetes state checks into CI/CD pipelines or infrastructure automation.

For example, you might use this node to get the current status and metadata of a ReplicaSet named "frontend-replicaset" in the "production" namespace to verify deployment health before proceeding with further automation steps.

Properties

Name Meaning
Namespace The Kubernetes namespace where the ReplicaSet resides. Defaults to "default".
Resource Name The exact name of the ReplicaSet to retrieve. If provided, it filters the results to this specific ReplicaSet.
Field Selector A Kubernetes field selector string to filter ReplicaSets based on resource fields (e.g., metadata.name=xyz). See Kubernetes docs.
Label Selector A Kubernetes label selector string to filter ReplicaSets based on labels (e.g., app=frontend). See Kubernetes docs.

Output

The node outputs JSON data representing the retrieved ReplicaSet(s) from the Kubernetes cluster. The structure corresponds to the standard Kubernetes API response for ReplicaSets, including metadata, spec, and status fields.

  • If a specific ReplicaSet name is provided, the output will be a single ReplicaSet object.
  • If no name is provided, the output may be a list of ReplicaSets matching the optional field and label selectors.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a Kubernetes cluster with appropriate permissions to read ReplicaSets.
  • Needs an API authentication token or credentials configured in n8n to connect securely to the Kubernetes API.
  • The node depends on internal Kubernetes client utilities bundled with the node implementation.

Troubleshooting

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

  • Empty or no ReplicaSets returned
    Verify that the namespace is correct and that the fieldSelector or labelSelector filters are accurate. Incorrect selectors may result in no matches.

  • Invalid fieldSelector or labelSelector syntax
    Use proper Kubernetes selector syntax as per official documentation. Malformed selectors can cause API errors or empty results.

  • Resource not found
    If specifying a resourceName that does not exist in the given namespace, the node will return no data or an error depending on the API response.

Links and References

Discussion