Actions90
- Jobs Actions
- Namespaces Actions
- Pods Actions
- Services Actions
- Deployments Actions
- ReplicaSets Actions
- StatefulSets Actions
- DaemonSets Actions
- CronJobs Actions
Overview
This node allows interaction with Kubernetes clusters by performing various operations on Kubernetes resources. Specifically, for the Deployments resource with the List operation, it fetches a list of deployment objects from a specified namespace in the cluster. Users can filter the deployments using field selectors or label selectors to narrow down the results.
Common scenarios where this node is beneficial include:
- Automating monitoring or auditing of deployments in different namespaces.
- Integrating Kubernetes deployment data into workflows for reporting or alerting.
- Filtering deployments based on labels or fields to trigger conditional logic in automation pipelines.
For example, you could use this node to list all deployments in the "default" namespace that have a specific label indicating environment type (e.g., environment=production), and then process that list further in your workflow.
Properties
| Name | Meaning |
|---|---|
| Namespace | The Kubernetes namespace from which to list deployments. Defaults to "default". |
| Resource Name | (Optional) The exact name of a deployment resource to retrieve. If provided, it overrides the field selector to target this specific deployment. |
| Field Selector | A Kubernetes field selector string to filter deployments based on resource fields. For example, metadata.name=my-deployment. See Kubernetes Field Selectors. |
| Label Selector | A Kubernetes label selector string to filter deployments based on labels. For example, app=nginx. See Kubernetes Labels. |
Output
The output is a JSON array containing the deployment objects returned by the Kubernetes API according to the applied filters. Each item corresponds to a deployment resource with its full metadata and specification as provided by Kubernetes.
The structure matches the standard Kubernetes deployment resource schema, including fields such as:
metadata: Information like name, namespace, labels, annotations.spec: Deployment specifications such as replicas, selector, template.status: Current status of the deployment.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to a Kubernetes cluster.
- Needs valid Kubernetes API credentials configured in n8n (an API key or token with appropriate permissions).
- The node uses an internal Kubernetes client utility to communicate with the cluster.
Troubleshooting
No credentials got returned!
This error indicates missing or misconfigured Kubernetes credentials. Ensure that the node has access to valid Kubernetes API authentication details.Empty result set when listing deployments:
Verify that the namespace is correct and that any field or label selectors are properly formatted and match existing deployments.Invalid field selector or label selector syntax:
Use the official Kubernetes documentation links provided in the property descriptions to ensure selectors are correctly formed.Command must be an array! (not relevant for List operation but present in code)
When running commands (other operations), ensure the command input is a valid JSON array.
Links and References
- Kubernetes Deployments API: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- Kubernetes Field Selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/
- Kubernetes Labels and Selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/