Pulumi
Node Policies
Configure node provisioning policies for Karpenter-based autoscaling.
Node Policies
NodePolicy configures Karpenter-based node provisioning rules. NodePolicyTarget attaches a node policy to one or more clusters.
Node policies manage Karpenter NodePool and NodeClass resources. Ensure Karpenter is installed on your target clusters before attaching node policies.
NodePolicy
Example
import { resources } from "@devzero/pulumi-devzero";
const nodePolicy = new resources.NodePolicy("standard-nodes", {
name: "standard-nodes",
});from pulumi_devzero.resources import NodePolicy, NodePolicyArgs
node_policy = NodePolicy("standard-nodes", args=NodePolicyArgs(
name="standard-nodes",
))Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name for the node policy |
Outputs
| Output | Type | Description |
|---|---|---|
id | string | The node policy ID assigned by DevZero |
NodePolicyTarget
NodePolicyTarget attaches a NodePolicy to one or more clusters.
Example
import { resources } from "@devzero/pulumi-devzero";
const nodePolicyTarget = new resources.NodePolicyTarget("cluster-nodes", {
name: "cluster-nodes",
policyId: nodePolicy.id,
clusterIds: [cluster.id],
enabled: true,
});from pulumi_devzero.resources import NodePolicyTarget, NodePolicyTargetArgs
node_policy_target = NodePolicyTarget("cluster-nodes", args=NodePolicyTargetArgs(
name="cluster-nodes",
policy_id=node_policy.id,
cluster_ids=[cluster.id],
enabled=True,
))Arguments
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Unique name for the target |
policyId | string | Yes | ID of the NodePolicy to attach |
clusterIds | string[] | Yes | List of cluster IDs to apply the policy to |
enabled | bool | No | Whether the target is active (default: true) |
Python uses snake_case: policy_id, cluster_ids.