KubeCon EUBooth 1151, Amsterdam. March 23-26
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

ParameterTypeRequiredDescription
namestringYesUnique name for the node policy

Outputs

OutputTypeDescription
idstringThe 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

ParameterTypeRequiredDescription
namestringYesUnique name for the target
policyIdstringYesID of the NodePolicy to attach
clusterIdsstring[]YesList of cluster IDs to apply the policy to
enabledboolNoWhether the target is active (default: true)

Python uses snake_case: policy_id, cluster_ids.

On this page