Kubernetes icon

Kubernetes

Interact with Kubernetes

Pods → Patch

AI-generated

Overview

This node interacts with Kubernetes clusters to perform various operations on resources such as Pods. Specifically, the 'Patch' operation allows users to modify an existing Kubernetes resource by applying a JSON patch. This is useful for updating configurations or metadata of resources without recreating them. For example, you can patch a Pod to update labels or annotations dynamically.

Use Case Examples

  1. Patching a Pod to add a new label or update an environment variable.
  2. Modifying the configuration of a Deployment resource by applying a patch.

Properties

Name Meaning
Image The container image to use, relevant for operations like run, restart, exec, and patch.
Namespace The Kubernetes namespace where the resource resides.
Resource Name The name of the Kubernetes resource to operate on.
Patch Data The JSON patch data to apply to the resource.

Output

JSON

  • json - The JSON response from the Kubernetes API after applying the patch, representing the updated resource state.

Dependencies

  • Requires Kubernetes API credentials for authentication and interaction with the cluster.

Troubleshooting

  • Ensure that the 'Resource Name' is provided; otherwise, the node will throw an error indicating the resource name is required for the patch operation.
  • The 'Patch Data' must be valid JSON; invalid JSON will cause parsing errors.
  • Kubernetes API credentials must be correctly configured and valid to avoid authentication errors.
  • If the patch operation fails, verify that the patch data conforms to Kubernetes API specifications and that the user has sufficient permissions.

Discussion