Skip to main content

Kubernetes Tasks

Specialized tasks for Kubernetes resource management, optimization, and operations.

k8s.vertical_rightsize​

Display Name: Vertical Rightsize

Optimize CPU and memory requests/limits for a Kubernetes workload. Can apply changes directly or create a GitOps pull request.

Parameters​

NameTypeRequiredDescription
namespacestringYesKubernetes namespace.
namestringYesWorkload name.
kindstringYesResource kind (e.g., Deployment, StatefulSet, DaemonSet).
directionstringYesScaling direction. Options: up, down.
cpuobjectNoCPU configuration: change_pct (number, required — percentage to change), max (string, e.g., "1"), min (string, e.g., "10m"), remove_limit (boolean).
memoryobjectNoMemory configuration: change_pct (number, required — percentage to change), max (string, e.g., "1Gi"), min (string, e.g., "100Mi"), remove_limit (boolean).
in_placebooleanNoResize pods in place without a restart when the cluster supports it (Kubernetes 1.35 or later), otherwise fall back to a rolling restart. Default true. Ignored when GitOps is enabled.
gitops_configobjectNoGitOps config: enabled (boolean) — if true, creates a pull request instead of applying directly; integration_id (GitHub integration that raises the pull request, required when enabled is true).
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result status.
patchobjectThe Kubernetes patch that was applied (or would be applied).
resolution_idstringResolution tracking ID.

k8s.horizontal_rightsize​

Display Name: Horizontal Rightsize

Scale the number of replicas for a Kubernetes workload up or down.

Parameters​

NameTypeRequiredDescription
directionstringYesScaling direction. Options: up, down.
kindstringYesResource kind (e.g., Deployment, StatefulSet).
namespacestringYesKubernetes namespace.
namestringYesWorkload name.
scaling_modestringNoHow to scale. Options: change_by (relative), change_to (absolute).
change_bynumberNoAmount to change replicas by. Visible when scaling_mode is change_by.
change_tonumberNoTarget absolute replica count. Visible when scaling_mode is change_to.
minnumberNoMinimum replica count (floor).
maxnumberNoMaximum replica count (ceiling).
gitops_configobjectNoGitOps config: enabled (boolean) — if true, creates a pull request instead of applying directly; integration_id (GitHub integration that raises the pull request, required when enabled is true).
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result.
old_replicasnumberPrevious replica count.
new_replicasnumberNew replica count.
patchobjectThe applied patch.
resolution_idstringResolution tracking ID.

k8s.pv_rightsize​

Display Name: PV Rightsize

Resize a Kubernetes Persistent Volume Claim to match actual usage.

Parameters​

NameTypeRequiredDescription
namespacestringYesKubernetes namespace.
namestringYesPVC name.
kindstringYesResource kind. Default: PersistentVolumeClaim.
change_bystringNoPercentage to increase storage (e.g., 10%). Only positive values (increase).
change_tostringNoTarget absolute storage size (e.g., 20Gi).
maxstringNoMaximum storage size allowed (e.g., 100Gi).
gitops_configobjectYesCreate GitHub Issue config: enabled (boolean) — if true, opens a GitHub issue describing the resize instead of patching the cluster; integration_id (GitHub integration) and repository_name (repository for the issue, e.g. org/repo), both required when enabled is true. Set enabled: false to patch the PVC directly.
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result.
old_storagestringPrevious storage size.
new_storagestringNew storage size.
patchobjectThe applied patch.
resolution_idstringResolution tracking ID.
issue_urlstringURL of the GitHub issue (when gitops_config.enabled is true).
issue_numbernumberNumber of the GitHub issue (when gitops_config.enabled is true).

k8s.continuous_rightsize​

Display Name: Continuous Rightsize

Continuously monitor and auto-adjust resources for Kubernetes workloads based on usage patterns.

Parameters​

NameTypeRequiredDescription
account_idaccountYesNudgeBee account ID.
namespacestringYesKubernetes namespace.
kindstringYesWorkload kind.
namestringYesWorkload name.
analysis_duration_hournumberNoLook-back window for usage samples. Default 24.
cpuobjectNoalgorithm (default NB Algo), buffer_pct (headroom, default 0), min_change_pct (default 10), max_change_pct (default 100), min_request in cores (default 0.01).
memoryobjectNoSame fields as cpu; min_request is a quantity (default 100Mi).
oom_kill_increase_factornumberNoMultiplier applied after an OOMKill (default 1.5, i.e. +50%).
recommend_onlybooleanNoOnly surface the recommendation, without applying it. Default false.

Output​

NameTypeDescription
dataobjectRightsizing analysis results.

k8s.profile​

Display Name: Pod Profile

Capture a CPU or memory profile from a running pod. The profiler picks the right tool for the language (pprof for Go, async-profiler or jcmd for Java, py-spy for Python, rbspy for Ruby), and the profile is kept on the pod's Profiler tab.

Parameters​

NameTypeRequiredDescription
account_idaccountNoNudgeBee account ID.
namespacestringYesKubernetes namespace.
kindstringNoKind of the resource named in pod_name. Default Pod; for a Deployment, DaemonSet or StatefulSet one of its pods is picked.
pod_namestringYesPod to profile, or the workload to pick a pod from.
target_pod_namestringNoProfile this specific pod of the workload. Without it the oldest pod is chosen.
profile_typestringNocpu (default, a flamegraph) or memory.
profile_durationnumberNoSeconds to sample, up to 600. Default 60. Give the task a timeout of at least the duration plus five minutes.
application_languagestringNoLeave empty to detect it; set it only when detection fails.
event_idstringNoAttach the finished profile to this event so it shows on the Investigate page.

Output​

NameTypeDescription
statusstringResult status.
profile_type, profile_tool, langstringWhat was captured and with which tool.
filename, size_bytesstring / integerThe profile file.
fileobjectThe profile itself, ready for an add-evidence step. Replaced by contents_omitted when it's too large.
evidence_attachedbooleanWhether it was attached to event_id.

k8s.workload_restart​

Display Name: Workload Restart

Perform a rolling restart of a Kubernetes workload to apply configuration changes or recover from issues.

Parameters​

NameTypeRequiredDescription
namespacestringYesKubernetes namespace.
namestringYesWorkload or pod name.
kindstringYesResource kind (Deployment, StatefulSet, DaemonSet, Pod).
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result.
messagestringDetails about the restart.
restarted_kindstringKind of the restarted resource.
restarted_namestringName of the restarted resource.

k8s.pod_delete​

Display Name: Pod Delete

Delete a Kubernetes pod to force a restart or clean up a stuck pod.

Parameters​

NameTypeRequiredDescription
namespacestringYesKubernetes namespace.
namestringYesWorkload name or specific pod name.
kindstringNoResource kind. Default: Pod. If set to a workload kind (e.g., Deployment), deletes a pod owned by that workload.
target_pod_namestringNoSpecific pod to delete (when kind is a workload). If not set, the first found pod is deleted.
forcebooleanNoIf true, immediately removes the pod (--grace-period=0 --force). Useful for stuck pods.
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result.
deleted_podstringName of the deleted pod.
namespacestringNamespace of the deleted pod.

k8s.node_graceful_shutdown​

Display Name: Node Graceful Shutdown

Safely drain and optionally remove a Kubernetes node. Cordons the node (prevents new scheduling), evicts all pods, then optionally deletes the node object.

Parameters​

NameTypeRequiredDescription
namestringYesNode name to shut down.
delete_nodebooleanNoWhether to delete the node object after draining. Default: false.
ignore_pdbsbooleanNoIf true, bypasses PodDisruptionBudgets using deletion instead of eviction. Default: false.
account_idaccountNoNudgeBee account ID.

Output​

NameTypeDescription
statusstringOperation result.
nodestringNode name.
cordonedbooleanWhether the node was cordoned.
drainedbooleanWhether the node was drained.
deletedbooleanWhether the node was deleted.