게시 2026-12-03Published 2026-12-03Kubernetes읽는 시간 19분19 min read

Kyverno로 노드 크기별 node IP cache(VPC CNI warm IP) 설정하기Per-instance-size node IP cache (VPC CNI warm IP) with Kyverno

Amazon VPC CNI는 노드마다 미리 잡아 두는 IP의 양을 aws-node DaemonSet 하나의 환경 변수(WARM_IP_TARGET / MINIMUM_IP_TARGET)로 정해서, 클러스터의 모든 노드가 같은 값을 씁니다. Karpenter가 여러 인스턴스 크기를 섞어 띄우는 EKS 클러스터에서, 공개 이슈 #3630에 소개된 Kyverno 우회 방법을 직접 테스트해 봤는데요, Kyverno가 aws-node Pod를 노드에 배치하는 순간 그 노드 크기에 맞는 값을 넣어 줬고, 작은 노드만 WARM 1 / MIN 3으로 낮추자 작은 노드 8대의 서브넷 IP가 64개에서 40개로 줄었습니다. 대신 일반 Pod를 한꺼번에 띄울 때는 시작이 늦어졌고, Kyverno가 응답하지 않을 때 failurePolicy가 Ignore이거나, 정책에 기본값이 없거나, 업그레이드 때 aws-node 매니페스트를 통째로 덮어쓰면 값이 빠졌습니다.Amazon VPC CNI sets how many IPs each node reserves with environment variables (WARM_IP_TARGET / MINIMUM_IP_TARGET) on the single aws-node DaemonSet, so every node in the cluster gets the same values. I tested the Kyverno workaround from public issue #3630 on an EKS cluster where Karpenter mixes instance sizes. Kyverno set the values for each node's size when the aws-node Pod was bound to the node, and with only the small nodes lowered to WARM 1 / MIN 3, eight small nodes used 40 subnet IPs instead of 64. The cost was a slower start when many regular Pods start at once. The values were lost when Kyverno was unreachable with failurePolicy Ignore, when the policy had no default, and when an upgrade replaced the whole aws-node manifest.

#Amazon VPC CNI#Kyverno#Karpenter#Amazon EKS#Security groups for Pods

Why I tested this

On EKS, the VPC CNI reserves IPs on each node ahead of time for the Pods it will run. How many it reserves is set by environment variables such as WARM_IP_TARGET / MINIMUM_IP_TARGET on the aws-node DaemonSet. There is only one DaemonSet, so every node in the cluster uses the same values.

With Cluster Autoscaler this was rarely a problem. The instance types in a node group need the same number of CPU cores and amount of RAM (Cluster Autoscaler AWS docs), so each node group usually held instances of about the same size, and one set of values fit most nodes. With Karpenter, one NodePool can allow many instance sizes and nodes launch with whatever size is available. When large instances can't be found, many small ones fill the same capacity. Each extra node reserves its own spare IPs, so the spare IPs grow with the node count.

When subnet IPs are tight, you want lower values on the small nodes only, but the VPC CNI has no such option yet. The feature request is public issue #3630, and a comment on it (May 15, 2026) describes a workaround that uses Kyverno to put the values into aws-node Pods. It doesn't say whether this holds up when Karpenter mixes sizes, or where it breaks in operation, so I tested it. I checked four questions:

  • Does every node Karpenter launches get the values for its size? (Test 1)
  • How many IPs does lowering only the small nodes save? (Test 2)
  • How much slower do Pods start in exchange? (Test 3)
  • What happens to the values on a Kyverno failure, a wrong value, or a VPC CNI upgrade? (Tests 4–6)

This should help if you are moving from Cluster Autoscaler to Karpenter and want to allow more instance sizes, or if you are deciding whether to run the #3630 workaround in production. The test code is linked at the end.

Per-size values and two ways to set them

With WARM_IP_TARGET and MINIMUM_IP_TARGET set, a node holds max(MINIMUM_IP_TARGET, Pods in use + WARM_IP_TARGET) secondary IPs. Without them, the default WARM_ENI_TARGET=1 keeps one whole spare ENI's worth of IPs (VPC CNI README). Every measurement in this post matched this formula. Below, WARM is WARM_IP_TARGET (spare IPs to keep free) and MIN is MINIMUM_IP_TARGET (IPs to hold at least), so "WARM 1 / MIN 3" means WARM_IP_TARGET=1, MINIMUM_IP_TARGET=3.

Because the values are aws-node environment variables, there are two ways to give each size its own values.

MethodHow it works
Method 1 · One DaemonSet per sizeCopy aws-node per size (aws-node-large, aws-node-4xlarge) with fixed values and split them with node affinity on the size label. The original aws-node excludes those sizes (NotIn) and keeps the default values
Method 2 · Kyverno injectionKeep one aws-node. When an aws-node Pod is bound to a node (pods/binding), Kyverno reads the node's karpenter.k8s.aws/instance-size label and adds the values for that size as annotations. The API server copies Binding annotations to the Pod, and aws-node reads them into env through the downward API

Table 1. Two ways to set per-size values

Figure 1. How admission gets per-size values into aws-node. Karpenter launches a node and labels its size. When the scheduler binds the aws-node Pod, the API server sends the binding to Kyverno: a MutatingPolicy adds WARM_IP_TARGET and MINIMUM_IP_TARGET for that size as annotations, then a ValidatingPolicy denies the binding while the node has no size label or the values don't match its size, and the scheduler retries. The API server copies the annotations to the Pod, aws-node reads them into its environment through the downward API, and ipamd keeps max(MINIMUM, Pods + WARM) IPsNew nodeKubernetes API serverAdmission (Kyverno here)m6i.largelaunched by Karpenter1Node labelinstance-size = largeaws-node Podenv from annotations(downward API)WARM 1 / MIN 36IPs ipamd holds =max(MIN, Pods + WARM)3 Pods → 4 IPskube-apiserverpods/bindingaws-node → nodeCopies Bindingannotationsto the PodKyverno(any admission webhook)MutatingPolicy · values by size3large → WARM 1 / MIN 34xlarge → WARM 4 / MIN 6other sizes → WARM 4 / MIN 6 (default)Adds them as annotations on the Binding4ValidatingPolicy · gateSize label (or node group label) on the node?Values on the Binding match that size?No: deny, scheduler retries in secondsYes: allow25Admission call (pods/binding)Allowed, values appliedDenied, the scheduler retriesEC2 instanceDaemonSet (aws-node)API serverIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0Figure 1. How admission gets per-size values into aws-node. Karpenter launches a node and labels its size. When the scheduler binds the aws-node Pod, the API server sends the binding to Kyverno: a MutatingPolicy adds WARM_IP_TARGET and MINIMUM_IP_TARGET for that size as annotations, then a ValidatingPolicy denies the binding while the node has no size label or the values don't match its size, and the scheduler retries. The API server copies the annotations to the Pod, aws-node reads them into its environment through the downward API, and ipamd keeps max(MINIMUM, Pods + WARM) IPs1Karpenter launches the nodeand adds the label instance-size = large2Scheduler binds aws-nodeAPI server sends pods/binding to Kyverno3Values · MutatingPolicylarge → WARM 1 / MIN 3, others → 4 / 6added as annotations on the Binding4Gate · ValidatingPolicyNo size label yet: denied, retried in secondsValues don't match the size: denied, retriedOtherwise: allowed5API server copies them to the PodBinding annotations become Pod annotations6aws-node reads themenv via downward API:WARM_IP_TARGET, MINIMUM_IP_TARGETipamd keeps max(MIN, Pods + WARM) IPsAdmission call (pods/binding)Allowed, values appliedDenied, the scheduler retriesIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0

Figure 1. How Kyverno puts per-size values into aws-node (method 2). 1 Karpenter launches the node and labels it. 2 The aws-node binding goes to Kyverno. 3 The MutatingPolicy adds the values as annotations. 4 The gate denies the binding while the node has no size label or the values don't match its size, and the scheduler retries. 5 The API server copies them to the Pod. 6 aws-node reads them through the downward API.

The #3630 comment puts the values on node labels and has Kyverno copy them to the aws-node Pod, with the env set through the EKS add-on's extraEnv. Karpenter puts custom labels on nodes per NodePool, so per-size labels would need one NodePool per size. I kept the values in a table inside the policy, keyed by the instance-size label, and applied them at binding time. Method 2 adds two policies: a mutation that adds the values, and a gate that denies the binding while the node has no size label or while the added values don't match the node's size. Both match only aws-node-* bindings in kube-system, so other Pods are not affected by the policies.

01

Results of the six tests

TestQuestionWhat I didResult
Test 1 · Per-size injectionDoes every new node get the values for its size?Launched about 20 new nodes with method 1 and method 2 → checked the values each aws-node got and the gate denialsRight values in normal operation. In the rerun 1 of 8 got the defaults; with a value check added to the gate, 16 of 16 were right
Test 2 · IP saving on small nodesHow many IPs does lowering only the small nodes save?8 small nodes with 3 regular Pods each, values WARM 4 / MIN 6 and then WARM 1 / MIN 3 → counted subnet IPs64 → 40 subnet IPs (7 → 4 per node)
Test 3 · Pod start latencyHow much slower do Pods start in exchange?One small node: regular Pods 3 → 13 and SGPP Pods 0 → 9 → timed each Pod until ReadyWARM 1 / MIN 3: last regular Pod Ready after 65–83 s (16–32 s with WARM 4 / MIN 6). SGPP Pods 2–4 s either way
Test 4 · Kyverno failureWhat happens to a new node when Kyverno fails?Kyverno unreachable (Fail, Ignore) or at 0 replicas, then one new node → checked the node and its aws-nodeFail: node NotReady until Kyverno was back. Ignore and 0 replicas: aws-node on the defaults
Test 5 · Value mistakesWhat does a wrong value in the policy do?A size missing from the table with no default; values WARM 0 / MIN 0 and WARM 0 / MIN 3 → counted IPs and Pods without an IPNo default and WARM 0 / MIN 0 fell back to the defaults. WARM 0 / MIN 3: 10 new Pods got no IP for more than 5 minutes
Test 6 · Value change and upgradeDo the values survive a value change and an aws-node upgrade?Changed values with ping running; upgraded v1.23.2 → v1.23.3 with kubectl apply and kubectl replaceChanges need an aws-node restart, no ping loss. replace dropped the values (method 2); apply dropped the size split (method 1)

Table 2. Results. Seoul Region (ap-northeast-2), December 2–4, 2026, Amazon EKS 1.36, self-managed VPC CNI v1.23.3, Karpenter v1.15.3, Kyverno v1.20.0

02

Test setup

I built a separate test cluster with Terraform in the Seoul Region. The EKS API endpoint was private only, and I reached it through Session Manager port forwarding. Instead of very large instances I scaled the sizes down: m6i.4xlarge plays the large node and m6i.large the small fallback node, an 8× CPU ratio.

ComponentConfiguration
ClusterAmazon EKS 1.36, private API endpoint, one NAT gateway. Kyverno and Karpenter run on a managed node group of one t3.large
VPC CNIv1.23.3, self-managed aws-node DaemonSet (not the EKS add-on). v1.23.4 was released during the test; the functions this post relies on are unchanged in it
Karpenterv1.15.3, one NodePool with m6i.large, m6i.xlarge and m6i.4xlarge
Kyvernov1.20.0 (Helm chart 3.10.0), one ValidatingPolicy (gate) and one MutatingPolicy (values)
Nodesm6i.4xlarge: 8 ENIs × 30 IPv4 addresses. m6i.large: 3 ENIs × 10. m6i.xlarge: 4 ENIs × 15
Workloadpause Pods, 3 regular Pods per node

Table 3. Components and configuration

The IP counts come from the EC2 API (secondary IPs per ENI), the ipamd introspection API (IPs assigned to Pods), and the ipamd process environment (/proc/<pid>/environ), so they show the values aws-node actually ran with. Subnet use is the IPs a node holds plus one primary IP per ENI.

All tests ran one after another on this one cluster, in the order below. The test sections that follow are numbered by test, not by this order.

Test order. All tests ran one after another on the same cluster (EKS 1.36, one Karpenter NodePool, Kyverno): the small-node fleet with one value and then per-size values (Tests 1 and 2), regular Pod bursts (Test 3), value mistakes (Test 5), Kyverno failures (Test 4), value change and upgrade with method 2 (Test 6), method 1 (Tests 1 and 6), and SGPP Pod bursts (Test 3). At the end the test nodes were removed and method 2 was put backSame cluster for every step: EKS 1.36 · one Karpenter NodePool (m6i large / xlarge / 4xlarge) · Kyverno v1.20TestWhat I changedWhat I measured1Tests 1 · 2Method 2, one value for all sizes, then per sizeNew nodes: 4xlarge × 1 + large × 8Values on each new aws-node, gate denialsSubnet IPs per node and in total2Test 3One large node: regular Pods 3 → 13for WARM 4, 3, 2, 1 (MIN 6, 3, 3, 3)Seconds until the last Pod is ReadyPods started at once3Test 5Policy without a default + an xlarge nodelarge node: WARM 0 / MIN 0, WARM 0 / MIN 3IPs the node holdsPods that get no IP4Test 4Kyverno at 0 replicas, or no endpoints(Fail / Ignore), then one new nodeNode Ready, values on aws-nodeOther Pods, recovery5Test 6 · method 2WARM 1 → 2 → 1 (MIN 3) with pingv1.23.2 → v1.23.3 by apply, by replaceTime to new values, ping lossDownward API env after upgrade6Tests 1 · 6 · method 1One DaemonSet per size, 4 new large nodesapply upgrade, value change with pingWhich aws-node lands on a new nodeAffinity after upgrade, ping loss7Test 3 · SGPPENABLE_POD_ENI on, SGPP Pods 0 → 9for WARM 1 / MIN 3 and WARM 4 / MIN 6Seconds until all 9 are ReadyIPs the node holds, branch ENIsEnd: test nodes removed, method 2 with per-size values put backKarpenter launches new nodes in this stepIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0Test order. All tests ran one after another on the same cluster (EKS 1.36, one Karpenter NodePool, Kyverno): the small-node fleet with one value and then per-size values (Tests 1 and 2), regular Pod bursts (Test 3), value mistakes (Test 5), Kyverno failures (Test 4), value change and upgrade with method 2 (Test 6), method 1 (Tests 1 and 6), and SGPP Pod bursts (Test 3). At the end the test nodes were removed and method 2 was put backSame cluster for every step1Tests 1 · 2ChangedMethod 2, one value for all sizes, then per sizeNew nodes: 4xlarge × 1 + large × 8MeasuredValues on each new aws-node, gate denialsSubnet IPs per node and in total2Test 3ChangedOne large node: regular Pods 3 → 13for WARM 4, 3, 2, 1 (MIN 6, 3, 3, 3)MeasuredSeconds until the last Pod is ReadyPods started at once3Test 5ChangedPolicy without a default + an xlarge nodelarge node: WARM 0 / MIN 0, WARM 0 / MIN 3MeasuredIPs the node holdsPods that get no IP4Test 4ChangedKyverno at 0 replicas, or no endpoints(Fail / Ignore), then one new nodeMeasuredNode Ready, values on aws-nodeOther Pods, recovery5Test 6 · method 2ChangedWARM 1 → 2 → 1 (MIN 3) with pingv1.23.2 → v1.23.3 by apply, by replaceMeasuredTime to new values, ping lossDownward API env after upgrade6Tests 1 · 6 · method 1ChangedOne DaemonSet per size, 4 new large nodesapply upgrade, value change with pingMeasuredWhich aws-node lands on a new nodeAffinity after upgrade, ping loss7Test 3 · SGPPChangedENABLE_POD_ENI on, SGPP Pods 0 → 9for WARM 1 / MIN 3 and WARM 4 / MIN 6MeasuredSeconds until all 9 are ReadyIPs the node holds, branch ENIsEnd: test nodes removed,method 2 put backNew nodes in this stepIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0

Figure 2. Test order on the one test cluster. The EC2 icon marks steps where Karpenter launched new nodes.

03

Test 1 · Per-size injection

  • Question Does every node Karpenter launches get the values for its size?
    Setup and steps Method 2, values table: large gets WARM 1 / MIN 3, other sizes WARM 4 / MIN 6 → Karpenter launches new nodes (about 20 in all) → the same with method 1 on 4 new large nodes
    Measured Annotations on each aws-node Pod and the env ipamd actually runs with, gate denials, seconds until the node is Ready

With method 2, about 20 nodes that Karpenter launched during normal operation all got the values for their size. The order of events on a new node can vary, though. On 2 nodes, the aws-node Pod was about to be placed on the node before the node had its size label (instance-size). At that point Kyverno can't tell the node's size, so it can't pick the right values. The gate denied that placement once, and about 6 seconds later, with the label in place, the Pod was placed again with the right values. Without the gate, aws-node on those 2 nodes would have started with the defaults.

aws-node scheduling event (time, Pod, count, message)
2026-12-03T12:02:02Z  aws-node-jf744  1  running Bind plugin "DefaultBinder":
  admission webhook "vpol.validate.kyverno.svc-fail-finegrained-aws-node-size-gate" denied the request:
  Policy aws-node-size-gate failed: node ip-10-70-22-229.ap-northeast-2.compute.internal has no instance-size label yet

When I replaced the 8 small nodes with the policy giving them WARM 1 / MIN 3, all 8 new nodes had annotations of WARM 1 / MIN 3, the gate denied nothing, and the nodes were Ready 27–33 seconds after the NodeClaim was created.

When I reran every script on December 4, 1 of the 8 new small nodes got WARM 4 / MIN 6 instead of WARM 1 / MIN 3, and the gate denied nothing. The mutation runs before the gate, and both read the Node with resource.Get(), so I think the size label arrived between the two reads: the mutation saw no size and used the default, and the gate then saw the label. Validating admission sees the object after mutation, so I added a second rule to the gate that compares the annotations on the Binding with the values for the node's size. To check the rule, I set the mutation to WARM 2 / MIN 3 and the gate to WARM 1 / MIN 3: the binding was denied 15 times, and once both said WARM 1 / MIN 3 the Pod was bound with WARM 1 / MIN 3 within 10 seconds. With the new rule, two more rounds of 8 new small nodes all got WARM 1 / MIN 3. The race didn't happen again in those rounds, so the rule never had to deny anything there.

aws-node scheduling event with the two policies set to different values (time, Pod, count, message)
2026-12-04T00:24:31Z  aws-node-s88wr  15  running Bind plugin "DefaultBinder":
  admission webhook "vpol.validate.kyverno.svc-fail-finegrained-aws-node-size-gate" denied the request:
  Policy aws-node-size-gate failed: values on the binding do not match size large of node ip-10-70-23-216.ap-northeast-2.compute.internal
MethodNew nodesResult
Method 1 · One DaemonSet per size4 m6i.largeOnly aws-node-large ran on each, Ready in 32–34 s. Fleet IPs the same as method 2
Method 2 · Kyverno injectionAbout 20, all sizesThe gate denied 2 early bindings. In the rerun 1 of 8 got the defaults; with the value check in the gate, 16 of 16 got the right values

Table 4. Test 1 · Per-size injection

The two methods differ on upgrades (Test 6 · Value change and upgrade).

04

Test 2 · IP saving on small nodes

  • Question How many IPs does lowering only the small nodes save?
    Setup and steps 1 × m6i.4xlarge at WARM 4 / MIN 6 + 8 × m6i.large, 3 regular Pods per node → once with WARM 4 / MIN 6 on the small nodes, once with WARM 1 / MIN 3, each time on fresh nodes
    Measured Secondary IPs and ENIs per node (EC2 API), subnet IPs per node and in total

The small-node setup was 1 m6i.4xlarge and 8 m6i.large, all launched fresh by Karpenter, with 3 regular Pods on each node. The large node kept WARM 4 / MIN 6 in both runs. Only the small nodes changed.

Figure 2. Subnet IPs in normal operation and after small nodes fill in for a large one, with 3 regular Pods per node. Normally one large node holds 8 subnet IPs. When the same CPU runs on 8 small nodes with the same values (WARM 4 / MIN 6), each holds 8 and the total is 64. With lower values on the small nodes only (WARM 1 / MIN 3), each holds 5 and the total is 40Normal1 large nodeWARM 4 / MIN 64xlarge8 subnet IPs3 Pods + 4 warm+ 1 ENI primarySmall nodes · same values for all8 small nodes, same CPUWARM 4 / MIN 6largelargelargelargelargelargelargelarge8 nodes × 8 = 64 subnet IPsSmall nodes · lower values on them8 small nodes, same CPUWARM 1 / MIN 3largelargelargelargelargelargelargelarge8 nodes × 5 = 40 subnet IPs (−24)Pod IPWarm IP (reserved, unused)ENI primary IPEC2 instanceIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0Figure 2. Subnet IPs in normal operation and after small nodes fill in for a large one, with 3 regular Pods per node. Normally one large node holds 8 subnet IPs. When the same CPU runs on 8 small nodes with the same values (WARM 4 / MIN 6), each holds 8 and the total is 64. With lower values on the small nodes only (WARM 1 / MIN 3), each holds 5 and the total is 40Normal · 1 large nodeWARM 4 / MIN 64xlarge8 subnet IPsSmall nodes · same values for allWARM 4 / MIN 6largelargelargelargelargelargelargelarge8 nodes × 8 = 64 subnet IPsSmall nodes · lower values on themWARM 1 / MIN 3largelargelargelargelargelargelargelarge8 nodes × 5 = 40 subnet IPs (−24)Pod IPWarm IP (reserved, unused)ENI primary IPEC2 instanceIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0

Figure 3. Subnet IPs with 3 regular Pods per node, as measured (m6i.4xlarge as the large node, m6i.large as the small node)

Small-node valuesIPs per small nodeSubnet use per small node8 small nodesAll 9 nodes
WARM 4 / MIN 6, the same as the large node786472
WARM 1 / MIN 3, small nodes only454048

Table 5. Test 2 · IP saving on small nodes. Each node used one ENI

The saving per node is the difference in max(MIN, Pods + WARM), so it depends on your current values and how many regular Pods run on each small node. With 3 Pods per node, WARM 3 / MIN 3 holds 6 IPs and WARM 2 / MIN 3 holds 5. IPs of Pods with security groups for Pods and the trunk ENIs do not depend on the warm values, so they don't change.

05

Test 3 · Pod start latency

  • Question How much slower do Pods start with fewer spare IPs?
    Setup and steps One m6i.large with 3 regular Pods → scale to 13 at once, 2–3 runs for each setting (WARM 4 / MIN 6, WARM 3 / MIN 3, WARM 2 / MIN 3, WARM 1 / MIN 3) → on the same node, SGPP Pods 0 → 9
    Measured Seconds from creation to Ready for each Pod, FailedCreatePodSandBox events, IPs the node holds

Fewer spare IPs mean Pods wait when many start at once. On one small node I scaled regular Pods from 3 to 13 in one step, 2–3 runs per value.

Small-node valuesOf 10 new Pods, started at onceLast Pod ReadyMedian
WARM 4 / MIN 6416–32 s12–14 s
WARM 3 / MIN 3329–43 s12–14 s
WARM 2 / MIN 3229–54 s13–26 s
WARM 1 / MIN 3165–83 s30–40 s

Table 6. Test 3 · Pod start latency, regular Pods 3 → 13 on one m6i.large. Ranges cover the runs on December 3 and December 4

Every 5 seconds ipamd tops the pool back up to WARM spare IPs, and it doesn't count Pods that are waiting for an IP (datastoreTargetState()). So as many Pods as there are spare IPs start at once, and the rest start WARM at a time about 12 seconds apart. Waiting Pods show FailedCreatePodSandBox events until they get an IP.

Pods with security groups for Pods behave differently. On the same node, with ENABLE_POD_ENI=true and a SecurityGroupPolicy, I scaled SGPP Pods from 0 to 9.

Small-node values9 SGPP Pods ReadyIPs the node holds
WARM 4 / MIN 62–3 s7 (unchanged)
WARM 1 / MIN 33–4 s4 (unchanged)

Table 7. Test 3 · Pod start latency, SGPP Pods 0 → 9 on one m6i.large

SGPP Pods get their IP from a branch ENI that the VPC Resource Controller attaches, so the warm values don't matter. A deleted SGPP Pod's branch ENI stays for a 60-second cooldown by default (SGP config options). On a node at its branch ENI limit (9 on m6i.large), new SGPP Pods created right after deleting the old ones waited 62 seconds in the first run and 123–124 seconds in the rerun, with either value. If SGPP Pods are often deleted and recreated on small nodes, the branch ENI limit and this cooldown set the start time, not the warm values.

06

Test 4 · Kyverno failure

  • Question What happens to a new node when Kyverno can't answer?
    Setup and steps Method 2 → Kyverno at 0 replicas, or its Service without endpoints under failurePolicy Fail and Ignore → add one m6i.large and one regular Pod → bring Kyverno back
    Measured Node Ready, aws-node bound or Pending and its values, the regular Pod, state after Kyverno is back

Method 2 depends on Kyverno answering when a node starts. I added a new node in three failure states. To make Kyverno unreachable, I changed the selector of the Kyverno Service so it had no endpoints while the webhook configuration stayed in place.

Figure 3. What happens to a new node's aws-node when admission fails. Normal: values applied, Ready in about 30 s. Admission unreachable with failurePolicy Fail: binding is denied and the node stays NotReady, then recovers by itself with the right values. Unreachable with Ignore, or Kyverno scaled to 0 (it removes its webhooks): the node is Ready but aws-node runs on the defaults until it is restarted. Other Pods were not affected in any caseSituationaws-node bindingNew nodeAfter admission is backNormalAdmission answersValues addedWARM 1 / MIN 3Ready in ~30 s4 IPs heldNothing to recoverUnreachable · FailService has no endpointsDenied, retried15 times in 2 minNotReady 2+ mincni plugin not initializedRecovers by itselfbound in 4 s, Ready in 20 sUnreachable · IgnoreService has no endpointsNo policy appliedno annotationsReady at oncedefaults · 18 IPs heldStays on defaultsuntil aws-node restartsKyverno at 0 replicasKyverno deletes webhooksNo policy appliedno annotationsReady at oncedefaults · 18 IPs heldStays on defaultsuntil aws-node restartsIn every case, Pods other than aws-node were scheduled as usual: the policy matches only aws-node-* bindings in kube-system.As intendedNode unusable or wrong valuesIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0Figure 3. What happens to a new node's aws-node when admission fails. Normal: values applied, Ready in about 30 s. Admission unreachable with failurePolicy Fail: binding is denied and the node stays NotReady, then recovers by itself with the right values. Unreachable with Ignore, or Kyverno scaled to 0 (it removes its webhooks): the node is Ready but aws-node runs on the defaults until it is restarted. Other Pods were not affected in any caseNormalAdmission answersValues addedWARM 1 / MIN 3Ready in ~30 s4 IPs heldNothing to recoverUnreachable · FailService has no endpointsDenied, retried15 times in 2 minNotReady 2+ mincni plugin not initializedRecovers by itselfbound in 4 s, Ready in 20 sUnreachable · IgnoreService has no endpointsNo policy appliedno annotationsReady at oncedefaults · 18 IPs heldStays on defaultsuntil aws-node restartsKyverno at 0 replicasKyverno deletes webhooksNo policy appliedno annotationsReady at oncedefaults · 18 IPs heldStays on defaultsuntil aws-node restartsOther Pods were not affected in any case.As intendedNode unusable or wrong valuesIcons: AWS Architecture Icons; Kubernetes icons, CC BY 4.0

Figure 4. What happens to a new node's aws-node when Kyverno fails, as measured

StateNew nodeAfter Kyverno was back
Unreachable · failurePolicy Failaws-node stayed Pending (15 bind failures in 2 minutes), node NotReady with cni plugin not initializedBound in 4 s, node Ready in 20 s, right values
Unreachable · failurePolicy IgnoreNode Ready at once, but aws-node had no annotations and used the defaults: 18 IPs with 3 PodsStill the defaults 90 s later, until aws-node was restarted
Kyverno scaled to 0 replicas (Fail)Same as Ignore: no annotations, 18 IPsStill the defaults until aws-node was restarted

Table 8. Test 4 · Kyverno failure

aws-node scheduling event with failurePolicy Fail (time, Pod, count, message)
2026-12-03T12:36:41Z  aws-node-g5s8w  15  running Bind plugin "DefaultBinder": Internal error occurred:
  failed calling webhook "mpol.validate.kyverno.svc-fail-finegrained-aws-node-warm-ip":
  failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/mpol/aws-node-warm-ip?timeout=10s":
  no endpoints available for service ...

With 0 replicas, Kyverno removed its own resource webhook configurations as it shut down, so the bindings went ahead without the policy even though the policy said Fail. In every case, Pods other than aws-node were scheduled as usual, because the webhook's matchConditions only send aws-node-* bindings in kube-system to Kyverno.

So with Fail, run Kyverno with high availability, because during a fallback nodes keep launching. With Ignore, or to cover a scale-down, add a check that finds aws-node Pods without the annotations and restarts them.

07

Test 5 · Value mistakes

  • Question What does a wrong value in the policy do?
    Setup and steps A policy without a default + one m6i.xlarge (not in the table) → on a large node, WARM 0 / MIN 0 and then WARM 0 / MIN 3 and regular Pods 3 → 13 at once → fix the value
    Measured IPs and ENIs the node holds, Pods that get no IP, time until all Pods run after the fix
MistakeWhat happened
Fallback to a size not in the table (m6i.xlarge), no default ruleNo annotations, so the env was an empty string and ipamd used the default WARM_ENI_TARGET=1: 28 IPs on 2 ENIs (subnet use 30) with 3 Pods. After adding a default of WARM 4 / MIN 6 and restarting aws-node, 7 IPs, but the 2 ENIs stayed (subnet use 9)
WARM 0 / MIN 0Treated as not set, as the README says, so back to the default: 13 IPs on 2 ENIs (subnet use 15) with 3 Pods. More, not fewer
WARM 0 / MIN 3Exactly 3 IPs with 3 Pods. Scaled to 13 Pods, the 10 new Pods got no IP for more than 5 minutes (DataStore has no available IP/Prefix addresses). After changing to WARM 1 / MIN 3 and restarting aws-node, all 13 were Running in 80 s

Table 9. Test 5 · Value mistakes

The WARM 0 / MIN 3 case follows from how ipamd counts, as in Test 3: with WARM 0 there is never a spare IP, and waiting Pods are not counted, so the pool never grows past MIN. Keep WARM at 1 or more, and give the policy a default for sizes not in the table. A fix that tells an explicit 0 apart from an unset value is open as PR #3979 (not merged as of December 3, 2026).

08

Test 6 · Value change and upgrade

  • Question Do the values survive a value change and an aws-node upgrade?
    Setup and steps Small-node value WARM 1 → 2 → 1 (MIN stays 3) with ping running → start from v1.23.2 and upgrade to v1.23.3 with kubectl apply, then with kubectl replace → the same with method 1
    Measured Time until the new values apply, ping loss, env and affinity after the upgrade, which aws-node lands on a new node

I changed the small-node values from WARM 1 / MIN 3 to WARM 2 / MIN 3 and back while ping ran between Pods, then upgraded aws-node from v1.23.2 to v1.23.3 in two ways.

ChangeMethod 1 · One DaemonSet per sizeMethod 2 · Kyverno injection
Change valuesChanging the env rolls the DaemonSet by itself (9–17 s). New values within 20–30 s. Ping loss 0Nothing changes until aws-node restarts. rollout restart took 48 s for 10 nodes, new values within 30 s after. 0 of 750 pings lost, on the same node and across nodes
Upgrade with kubectl apply -f aws-k8s-cni.yamlThe size-exclusion affinity on the original aws-node was removed. It then tried to start on every node (Pending on hostPort conflicts), the copies stayed on v1.23.2, and a new node got the default aws-node firstOnly the image changed. The downward API env stayed, because it is in neither the upstream manifest nor the last-applied annotation
Upgrade by replacing the whole manifest (kubectl replace -f)Not testedThe downward API env was removed and every node went back to the default. Subnet use of 9 nodes went from 50 to 220
After lowering valuesIPs are returned, but an ENI that is already attached can stay, with its primary IP. After restoring the env above, the 9 nodes held 41 IPs but used 55 subnet IPs

Table 10. Test 6 · Value change and upgrade

The affinity was lost in method 1 because nodeSelectorTerms is an atomic list, so kubectl apply replaces it with the upstream one as a whole. With method 1, keep the affinity in the manifest you upgrade with. With method 2, keep the two downward API env entries in it.

09

Settings that reproduce it

aws-node reads the values from Pod annotations instead of fixed values:

yaml (aws-node container env)
- name: WARM_IP_TARGET
  valueFrom:
    fieldRef:
      fieldPath: metadata.annotations['aws-vpc-cni/warm-ip-target']
- name: MINIMUM_IP_TARGET
  valueFrom:
    fieldRef:
      fieldPath: metadata.annotations['aws-vpc-cni/minimum-ip-target']

In this test Kyverno v1.20.0 rejected the older kyverno.io/v1 ClusterPolicy ("Kyverno v1.20 removed execution of legacy kyverno.io policy types and no longer accepts create or update requests for them"), so I wrote the two policies as CEL policies. The values below are the ones from Test 2 (large WARM 1 / MIN 3, other sizes WARM 4 / MIN 6). Replace the table with your sizes.

yaml
apiVersion: policies.kyverno.io/v1
kind: ValidatingPolicy
metadata: { name: aws-node-size-gate }
spec:
  failurePolicy: Fail
  validationActions: [Deny]
  matchConstraints:
    resourceRules:
    - { apiGroups: [""], apiVersions: [v1], operations: [CREATE], resources: [pods/binding] }
  matchConditions:
  - name: aws-node-binding
    expression: request.namespace == 'kube-system' && object.metadata.name.startsWith('aws-node-')
  variables:
  - { name: node, expression: 'resource.Get("v1", "nodes", "", object.target.name)' }
  - { name: size, expression: "variables.node.metadata.?labels[?'karpenter.k8s.aws/instance-size'].orValue('')" }
  - { name: nodegroup, expression: "variables.node.metadata.?labels[?'eks.amazonaws.com/nodegroup'].orValue('')" }
  - { name: table, expression: '{"large": ["1", "3"], "4xlarge": ["4", "6"]}' }
  - { name: v, expression: 'variables.table[?variables.size].orValue(["4", "6"])' }
  validations:
  - expression: variables.size != '' || variables.nodegroup != ''
    messageExpression: "'node ' + object.target.name + ' has no instance-size label yet'"
  - expression: >-
      variables.size == '' || (
      object.metadata.?annotations[?'aws-vpc-cni/warm-ip-target'].orValue('') == variables.v[0] &&
      object.metadata.?annotations[?'aws-vpc-cni/minimum-ip-target'].orValue('') == variables.v[1])
    messageExpression: "'values on the binding do not match size ' + variables.size + ' of node ' + object.target.name"
---
apiVersion: policies.kyverno.io/v1
kind: MutatingPolicy
metadata: { name: aws-node-warm-ip }
spec:
  failurePolicy: Fail
  matchConstraints:
    resourceRules:
    - { apiGroups: [""], apiVersions: [v1], operations: [CREATE], resources: [pods/binding] }
  matchConditions:
  - name: aws-node-binding
    expression: request.namespace == 'kube-system' && object.metadata.name.startsWith('aws-node-')
  variables:
  - { name: node, expression: 'resource.Get("v1", "nodes", "", object.target.name)' }
  - { name: size, expression: "variables.node.metadata.?labels[?'karpenter.k8s.aws/instance-size'].orValue('')" }
  - { name: table, expression: '{"large": ["1", "3"], "4xlarge": ["4", "6"]}' }
  - { name: v, expression: 'variables.table[?variables.size].orValue(["4", "6"])' }
  mutations:
  - patchType: ApplyConfiguration
    applyConfiguration:
      expression: >-
        Object{metadata: Object.metadata{annotations: {
          "aws-vpc-cni/warm-ip-target": variables.v[0],
          "aws-vpc-cni/minimum-ip-target": variables.v[1]}}}

The gate lets managed node group nodes through on the eks.amazonaws.com/nodegroup label, because they have no Karpenter size label. The orValue(["4", "6"]) is the default for sizes not in the table. The gate keeps the same table, so its second rule can deny a binding whose values don't match the node's size; keep the two tables in sync.

The policies read Nodes with resource.Get(). The default Kyverno install can't, and with failurePolicy Fail every aws-node binding was denied until I added this ClusterRole:

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kyverno:admission-controller:read-nodes
  labels:
    rbac.kyverno.io/aggregate-to-admission-controller: "true"
rules:
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "watch"]

After changing a value in the policy, restart aws-node with kubectl rollout restart ds/aws-node -n kube-system.

10

When to apply it and what to check first

  • How much it saves. Work out max(MIN, Pods + WARM) with your current values and the number of regular (non-SGPP) Pods on each small node. If the small nodes already run many Pods, the warm values change little.
  • How many Pods start at once on the small nodes. WARM 1 / MIN 3 fits nodes where many regular Pods rarely start together. Otherwise WARM 2 / MIN 3 or WARM 3 / MIN 3 trades fewer savings for a faster start (Test 3 · Pod start latency).
  • Never 0. Keep WARM at 1 or more until PR #3979 is merged and released (Test 5 · Value mistakes).
  • A default for every size. Every size Karpenter can launch needs an entry in the table or must fall to the default.
  • The failure behavior. With Fail, new nodes wait for Kyverno, so run it with high availability. With Ignore, and for a Kyverno scale-down in any case, watch for aws-node Pods without the annotations (Test 4 · Kyverno failure).
  • How you upgrade aws-node. If your pipeline renders and replaces the whole manifest, put the downward API env into that manifest first (Test 6 · Value change and upgrade).
  • A narrow policy scope. Keep the policies on aws-node-* bindings in kube-system, so a policy failure can't block other Pods.

11

What I did not test

The test used one cluster, one Region, and at most 14 nodes at a time. I did not check:

  • Very large instances such as 24xlarge. I only kept the size ratio with m6i.4xlarge and m6i.large.
  • The VPC CNI as an EKS add-on (the extraEnv route the #3630 comment uses), or installed and upgraded with its Helm chart. Whether an add-on update keeps the downward API env is unknown.
  • Prefix delegation (ENABLE_PREFIX_DELEGATION), custom networking (ENIConfig), and IPv6 clusters
  • Other admission engines, such as OPA Gatekeeper or your own webhook. The binding and annotation flow is Kubernetes, but the failure behavior in Test 4 is Kyverno's.
  • Karpenter consolidation or drift replacing nodes while the policies change

Test code

The Terraform configuration, Kubernetes manifests and scripts are in the blog repository under demos/vpc-cni-warmip-kyverno. The README maps each script's output to the tests above. I reran every script in the README's order on the test cluster on December 4, 2026 (UTC) and fixed what broke. The code creates billable resources (an EKS control plane, a NAT gateway, a t3.large node, and m6i nodes while tests run). When you are done, delete the test Pods and namespaces first so no ENIs are left behind, then run terraform destroy.

References

이 글을 쓰게 된 이유

EKS에서 VPC CNI는 노드마다 Pod에 줄 IP를 미리 잡아 둡니다. 얼마나 잡을지는 aws-node DaemonSet의 WARM_IP_TARGET / MINIMUM_IP_TARGET 같은 환경 변수로 정하는데요, DaemonSet이 하나라서 클러스터의 모든 노드가 같은 값을 씁니다.

Cluster Autoscaler를 쓸 때는 이게 큰 문제가 아니었습니다. 노드 그룹 안의 인스턴스 타입은 CPU 코어 수와 메모리 양이 같아야 해서(Cluster Autoscaler AWS 문서) 노드 그룹마다 비슷한 크기를 묶어 썼고, 값 하나로도 대부분의 노드에 맞았거든요. Karpenter로 넘어오면서 NodePool 하나에 여러 크기를 열어 두고 그때 구할 수 있는 인스턴스로 노드를 띄우게 됐는데요, 큰 인스턴스를 못 구하면 작은 인스턴스 여러 대로 같은 용량을 채우는 식입니다. 그러면 노드 수가 늘어난 만큼 노드마다 잡아 두는 예비 IP도 같이 늘어납니다.

서브넷 IP가 빠듯하면 작은 노드만 값을 낮추고 싶어지는데, VPC CNI에는 아직 그런 기능이 없습니다. 이 기능 요청이 공개 이슈 #3630이고, 코멘트(2026년 5월 15일)에 Kyverno로 aws-node Pod에 값을 넣는 우회 방법이 소개돼 있습니다. Karpenter가 여러 크기를 섞어 띄우는 클러스터에서도 이 방법이 동작하는지, 운영할 때 어디서 막히는지는 나와 있지 않아서 직접 테스트해 봤습니다. 확인한 질문은 네 가지입니다.

  • Karpenter가 새로 띄우는 노드마다 크기에 맞는 값이 들어가는가 (테스트 1)
  • 작은 노드만 값을 낮추면 IP가 얼마나 줄어드는가 (테스트 2)
  • 그 대가로 Pod 시작이 얼마나 느려지는가 (테스트 3)
  • Kyverno 장애, 잘못된 값, VPC CNI 업그레이드 때 값이 어떻게 되는가 (테스트 4~6)

Cluster Autoscaler에서 Karpenter로 옮기면서 인스턴스 크기를 넓혀 보려는 분들, #3630의 우회 방법을 운영에 넣어 볼지 고민 중인 분들께 도움이 될 것 같습니다. 테스트 코드도 함께 올려 두었습니다.

노드 크기별 값과 두 가지 방법

WARM_IP_TARGET과 MINIMUM_IP_TARGET을 주면 노드는 secondary IP를 max(MINIMUM_IP_TARGET, 사용 중인 Pod 수 + WARM_IP_TARGET)개 잡습니다. 값이 없으면 기본값 WARM_ENI_TARGET=1로 ENI 한 장 분량의 IP를 통째로 예비로 둡니다(VPC CNI README). 이 글의 측정값은 모두 이 식과 같았습니다. 아래에서 WARM은 WARM_IP_TARGET(비워 둘 예비 IP 수), MIN은 MINIMUM_IP_TARGET(최소로 잡아 둘 IP 수)인데요, "WARM 1 / MIN 3"은 WARM_IP_TARGET=1, MINIMUM_IP_TARGET=3이라는 뜻입니다.

값이 aws-node의 환경 변수라서, 크기별로 다른 값을 주는 방법은 두 가지입니다.

방법동작 방식
방법 1 · DaemonSet 분리aws-node를 크기별로 복사(aws-node-large, aws-node-4xlarge)해서 값을 고정하고, 크기 label에 대한 node affinity로 나눕니다. 원래 aws-node는 그 크기를 제외(NotIn)하고 기본값을 둡니다
방법 2 · Kyverno 주입aws-node는 하나만 둡니다. aws-node Pod가 노드에 배치될 때(pods/binding) Kyverno가 노드의 karpenter.k8s.aws/instance-size label을 읽고 그 크기의 값을 annotation으로 붙입니다. API 서버가 Binding의 annotation을 Pod로 복사하고, aws-node는 downward API로 이걸 env로 읽습니다

표 1. 크기별 값을 넣는 두 가지 방법

그림 1. admission으로 aws-node에 크기별 값을 넣는 흐름. Karpenter가 노드를 띄우고 크기 label을 붙입니다. scheduler가 aws-node Pod를 binding하면 API 서버가 그 요청을 Kyverno로 보냅니다. MutatingPolicy가 그 크기의 WARM_IP_TARGET과 MINIMUM_IP_TARGET을 annotation으로 붙이고, 이어서 ValidatingPolicy가 노드에 크기 label이 없거나 값이 크기와 맞지 않으면 막아 scheduler가 다시 시도합니다. API 서버가 annotation을 Pod로 복사하고, aws-node가 downward API로 env에 읽어 ipamd가 max(MINIMUM, Pod + WARM)개의 IP를 유지합니다새 노드Kubernetes API 서버admission(여기서는 Kyverno)m6i.largeKarpenter가 띄운 노드1노드 labelinstance-size = largeaws-node Podenv ← annotation(downward API)WARM 1 / MIN 36ipamd가 잡는 IP =max(MIN, Pod + WARM)Pod 3개 → IP 4개kube-apiserverpods/bindingaws-node → 노드Binding annotation을Pod로 복사Kyverno(다른 admission webhook도 가능)MutatingPolicy · 크기별 값3large → WARM 1 / MIN 34xlarge → WARM 4 / MIN 6그 밖의 크기 → WARM 4 / MIN 6(기본값)Binding에 annotation으로 붙임4ValidatingPolicy · gate노드에 크기 label(또는 node group label)이 있나?Binding의 값이 그 크기와 맞나?아니면: 거부, scheduler가 몇 초 뒤 재시도맞으면: 통과25admission 호출(pods/binding)통과, 값 적용거부, scheduler가 재시도EC2 인스턴스DaemonSet(aws-node)API 서버아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)그림 1. admission으로 aws-node에 크기별 값을 넣는 흐름. Karpenter가 노드를 띄우고 크기 label을 붙입니다. scheduler가 aws-node Pod를 binding하면 API 서버가 그 요청을 Kyverno로 보냅니다. MutatingPolicy가 그 크기의 WARM_IP_TARGET과 MINIMUM_IP_TARGET을 annotation으로 붙이고, 이어서 ValidatingPolicy가 노드에 크기 label이 없거나 값이 크기와 맞지 않으면 막아 scheduler가 다시 시도합니다. API 서버가 annotation을 Pod로 복사하고, aws-node가 downward API로 env에 읽어 ipamd가 max(MINIMUM, Pod + WARM)개의 IP를 유지합니다1Karpenter가 노드를 띄움크기 label instance-size = large가 붙음2scheduler가 aws-node를 bindingAPI 서버가 pods/binding을 Kyverno로 보냄3값 넣기 · MutatingPolicylarge → WARM 1 / MIN 3, 그 밖 → 4 / 6Binding에 annotation으로 붙임4gate · ValidatingPolicy크기 label이 아직 없으면 거부, 몇 초 뒤 재시도값이 크기와 맞지 않으면 거부, 재시도둘 다 맞으면 통과5API 서버가 Pod로 복사Binding annotation이 Pod annotation이 됨6aws-node가 읽음downward API로 env에:WARM_IP_TARGET, MINIMUM_IP_TARGETipamd가 max(MIN, Pod + WARM)개 IP 유지admission 호출(pods/binding)통과, 값 적용거부, scheduler가 재시도아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)

그림 1. Kyverno로 aws-node에 크기별 값을 넣는 흐름(방법 2). 1 Karpenter가 노드를 띄우고 label을 붙임. 2 aws-node binding이 Kyverno로 감. 3 MutatingPolicy가 값을 annotation으로 붙임. 4 노드에 크기 label이 없거나 값이 크기와 맞지 않으면 gate가 거부하고 scheduler가 재시도. 5 API 서버가 Pod로 복사. 6 aws-node가 downward API로 읽음.

#3630 코멘트는 값을 노드 label에 적어 두고 Kyverno가 그 label을 aws-node Pod로 복사하는 방식이고, env는 EKS add-on의 extraEnv로 넣습니다. 그런데 Karpenter는 직접 정한 label을 NodePool 단위로 붙여서, 크기별 label을 쓰려면 크기마다 NodePool을 나눠야 합니다. 그래서 저는 값을 정책 안의 표로 두고 instance-size label로 골라 binding 때 넣도록 바꿨습니다. 방법 2에는 정책이 두 개 들어갑니다. 값을 붙이는 mutation과, 노드에 크기 label이 없거나 붙은 값이 노드 크기와 맞지 않으면 배치를 막는 gate입니다. 둘 다 kube-system의 aws-node-* binding에만 걸려서 다른 Pod는 이 정책의 영향을 받지 않습니다.

01

여섯 가지 테스트 결과

테스트질문한 일결과
테스트 1 · 크기별 값 주입새 노드마다 크기에 맞는 값이 들어가나방법 1·2로 새 노드 약 20대를 띄우고 → aws-node가 받은 값과 gate 거부 횟수를 봄평소에는 모두 맞는 값. 다시 돌릴 때 8대 중 1대가 기본값이었고, gate에 값 확인을 더한 뒤 16대 모두 맞음
테스트 2 · 작은 노드 IP 절감작은 노드만 낮추면 IP가 얼마나 줄어드나작은 노드 8대에 일반 Pod 3개씩, 값 WARM 4 / MIN 6과 WARM 1 / MIN 3으로 → 서브넷 IP를 셈서브넷 IP 64 → 40개 (노드당 7 → 4개)
테스트 3 · Pod 시작 지연그 대가로 Pod가 얼마나 늦게 뜨나작은 노드 1대에서 일반 Pod 3 → 13개, SGPP Pod 0 → 9개 → Pod마다 Ready까지 시간을 잼WARM 1 / MIN 3이면 마지막 일반 Pod Ready까지 65~83초(WARM 4 / MIN 6은 16~32초). SGPP Pod는 두 값 모두 2~4초
테스트 4 · Kyverno 장애Kyverno가 장애일 때 새 노드는 어떻게 되나Kyverno 응답 불가(Fail, Ignore) 또는 replica 0에서 새 노드 1대 → 노드와 aws-node 상태를 봄Fail: Kyverno가 돌아올 때까지 노드 NotReady. Ignore와 replica 0: aws-node가 기본값으로 뜸
테스트 5 · 값 설정 실수정책 값을 잘못 넣으면 어떻게 되나기본값 없이 표에 없는 크기, 값 WARM 0 / MIN 0과 WARM 0 / MIN 3 → 노드가 잡은 IP와 IP를 못 받은 Pod를 셈기본값이 없을 때와 WARM 0 / MIN 0은 기본값으로 돌아감. WARM 0 / MIN 3은 새 Pod 10개가 5분 넘게 IP를 못 받음
테스트 6 · 값 변경과 업그레이드값을 바꾸거나 aws-node를 올려도 값이 남나ping을 돌리며 값 변경, v1.23.2 → v1.23.3을 kubectl apply와 kubectl replace로 업그레이드값은 aws-node 재시작 뒤 반영, ping 손실 없음. replace는 값을 지움(방법 2), apply는 크기 분리를 지움(방법 1)

표 2. 테스트 결과. 서울 리전(ap-northeast-2), 2026년 12월 2~4일, Amazon EKS 1.36, 직접 관리하는 VPC CNI v1.23.3, Karpenter v1.15.3, Kyverno v1.20.0

02

테스트 환경

서울 리전에 Terraform으로 테스트용 클러스터를 따로 만들었습니다. EKS API 엔드포인트는 private으로만 열고 Session Manager 포트 포워딩으로 접속했구요. 아주 큰 인스턴스 대신 크기 비율만 살려서 줄였는데요, m6i.4xlarge가 큰 노드, m6i.large가 큰 노드를 못 구할 때 대신 띄우는 작은 노드 역할입니다. CPU로 8배 차이입니다.

구성 요소설정
클러스터Amazon EKS 1.36, private API 엔드포인트, NAT gateway 1개. Kyverno와 Karpenter는 t3.large 1대짜리 관리형 노드 그룹에서 실행
VPC CNIv1.23.3, 직접 관리하는 aws-node DaemonSet(EKS add-on 아님). 테스트 중에 v1.23.4가 나왔는데, 이 글에서 다루는 함수는 바뀌지 않았습니다
Karpenterv1.15.3, NodePool 하나에 m6i.large, m6i.xlarge, m6i.4xlarge
Kyvernov1.20.0(Helm chart 3.10.0), ValidatingPolicy(gate) 1개, MutatingPolicy(값) 1개
노드m6i.4xlarge: ENI 8장 × IPv4 30개. m6i.large: 3장 × 10개. m6i.xlarge: 4장 × 15개
워크로드pause Pod, 노드당 일반 Pod 3개

표 3. 구성 요소와 설정

IP 수는 EC2 API(ENI별 secondary IP), ipamd introspection API(Pod에 나눠 준 IP), ipamd 프로세스 환경 변수(/proc/<pid>/environ)에서 읽어서, aws-node가 실제로 어떤 값으로 돌았는지까지 확인했습니다. 서브넷 소비는 노드가 잡은 IP에 ENI마다 primary IP 1개를 더한 값입니다.

모든 테스트는 이 클러스터 하나에서 아래 순서로 차례로 돌렸습니다. 이어지는 섹션은 이 순서가 아니라 테스트 번호 순서입니다.

테스트 순서. 모든 테스트를 같은 클러스터(EKS 1.36, Karpenter NodePool 1개, Kyverno)에서 차례로 돌렸습니다. 작은 노드 fleet을 같은 값, 크기별 값으로 띄우고(테스트 1·2), 일반 Pod 버스트(테스트 3), 값 설정 실수(테스트 5), Kyverno 장애(테스트 4), 방법 2 값 변경과 업그레이드(테스트 6), 방법 1(테스트 1·6), SGPP Pod 버스트(테스트 3) 순서입니다. 끝나면 테스트 노드를 지우고 방법 2로 되돌렸습니다모든 단계가 같은 클러스터: EKS 1.36 · Karpenter NodePool 1개(m6i large / xlarge / 4xlarge) · Kyverno v1.20테스트바꾼 것잰 것1테스트 1 · 2방법 2, 모든 크기 같은 값 → 크기별 값새 노드: 4xlarge 1대 + large 8대새 aws-node마다 값, gate 거부노드별·전체 서브넷 IP2테스트 3large 1대: 일반 Pod 3 → 13개WARM 4, 3, 2, 1(MIN 6, 3, 3, 3)마다마지막 Pod Ready까지 걸린 시간바로 뜬 Pod 수3테스트 5기본값 없는 정책 + xlarge 1대large 노드에 WARM 0 / MIN 0, WARM 0 / MIN 3노드가 잡은 IPIP를 못 받는 Pod4테스트 4Kyverno replica 0, 또는 엔드포인트 비움(Fail / Ignore) 뒤 새 노드 1대노드 Ready, aws-node 값다른 Pod, 복구 뒤 상태5테스트 6 · 방법 2ping을 돌리며 WARM 1 → 2 → 1(MIN 3)v1.23.2 → v1.23.3, apply와 replace새 값 반영 시간, ping 손실업그레이드 뒤 downward API env6테스트 1 · 6 · 방법 1DaemonSet 분리, 새 large 4대apply 업그레이드, ping을 돌리며 값 변경새 노드에 뜨는 aws-node업그레이드 뒤 affinity, ping 손실7테스트 3 · SGPPENABLE_POD_ENI 켜고 SGPP Pod 0 → 9개WARM 1 / MIN 3, WARM 4 / MIN 6마다9개 모두 Ready까지 걸린 시간노드가 잡은 IP, branch ENI끝: 테스트 노드를 지우고 방법 2와 크기별 값으로 되돌림이 단계에서 Karpenter가 새 노드를 띄움아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)테스트 순서. 모든 테스트를 같은 클러스터(EKS 1.36, Karpenter NodePool 1개, Kyverno)에서 차례로 돌렸습니다. 작은 노드 fleet을 같은 값, 크기별 값으로 띄우고(테스트 1·2), 일반 Pod 버스트(테스트 3), 값 설정 실수(테스트 5), Kyverno 장애(테스트 4), 방법 2 값 변경과 업그레이드(테스트 6), 방법 1(테스트 1·6), SGPP Pod 버스트(테스트 3) 순서입니다. 끝나면 테스트 노드를 지우고 방법 2로 되돌렸습니다모든 단계가 같은 클러스터1테스트 1 · 2바꾼 것방법 2, 모든 크기 같은 값 → 크기별 값새 노드: 4xlarge 1대 + large 8대잰 것새 aws-node마다 값, gate 거부노드별·전체 서브넷 IP2테스트 3바꾼 것large 1대: 일반 Pod 3 → 13개WARM 4, 3, 2, 1(MIN 6, 3, 3, 3)마다잰 것마지막 Pod Ready까지 걸린 시간바로 뜬 Pod 수3테스트 5바꾼 것기본값 없는 정책 + xlarge 1대large 노드에 WARM 0 / MIN 0, WARM 0 / MIN 3잰 것노드가 잡은 IPIP를 못 받는 Pod4테스트 4바꾼 것Kyverno replica 0, 또는 엔드포인트 비움(Fail / Ignore) 뒤 새 노드 1대잰 것노드 Ready, aws-node 값다른 Pod, 복구 뒤 상태5테스트 6 · 방법 2바꾼 것ping을 돌리며 WARM 1 → 2 → 1(MIN 3)v1.23.2 → v1.23.3, apply와 replace잰 것새 값 반영 시간, ping 손실업그레이드 뒤 downward API env6테스트 1 · 6 · 방법 1바꾼 것DaemonSet 분리, 새 large 4대apply 업그레이드, ping을 돌리며 값 변경잰 것새 노드에 뜨는 aws-node업그레이드 뒤 affinity, ping 손실7테스트 3 · SGPP바꾼 것ENABLE_POD_ENI 켜고 SGPP Pod 0 → 9개WARM 1 / MIN 3, WARM 4 / MIN 6마다잰 것9개 모두 Ready까지 걸린 시간노드가 잡은 IP, branch ENI끝: 테스트 노드를 지우고방법 2로 되돌림이 단계에서 새 노드를 띄움아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)

그림 2. 테스트 클러스터 하나에서 테스트를 돌린 순서. EC2 아이콘은 Karpenter가 새 노드를 띄운 단계입니다.

03

테스트 1 · 크기별 값 주입

  • 질문 Karpenter가 새로 띄우는 노드마다 크기에 맞는 값이 들어가나
    조건과 절차 방법 2, 값 표는 large에 WARM 1 / MIN 3, 그 밖의 크기에 WARM 4 / MIN 6 → Karpenter로 새 노드를 띄움(모두 약 20대) → 방법 1로 새 large 노드 4대를 같은 방식으로
    잰 것 aws-node Pod마다 붙은 annotation과 ipamd가 실제로 받은 env 값, gate 거부 횟수, 노드 Ready까지 걸린 시간

방법 2로 평소처럼 운영하는 동안 Karpenter가 띄운 노드 약 20대가 모두 크기에 맞는 값을 받았습니다. 다만 새 노드가 뜰 때 순서가 엇갈리는 경우가 있었는데요, 2대에서는 노드에 크기 label(instance-size)이 붙기 전에 aws-node Pod가 먼저 그 노드에 배치되려고 했습니다. 이때는 Kyverno가 노드 크기를 알 수 없어서 맞는 값을 넣을 수 없거든요. gate가 이 배치를 한 번 거부했고, 약 6초 뒤 label이 붙은 다음 다시 배치될 때 맞는 값이 들어갔습니다. gate가 없었다면 이 2대의 aws-node는 기본값으로 떴을 겁니다.

aws-node 스케줄링 이벤트 (시각, Pod, 횟수, 메시지)
2026-12-03T12:02:02Z  aws-node-jf744  1  running Bind plugin "DefaultBinder":
  admission webhook "vpol.validate.kyverno.svc-fail-finegrained-aws-node-size-gate" denied the request:
  Policy aws-node-size-gate failed: node ip-10-70-22-229.ap-northeast-2.compute.internal has no instance-size label yet

작은 노드에 WARM 1 / MIN 3을 주는 정책을 넣은 상태로 작은 노드 8대를 새로 바꿔 띄웠을 때는 8대 모두 annotation이 WARM 1 / MIN 3이었고, gate가 막은 건은 없었고, NodeClaim을 만든 뒤 27~33초에 Ready가 됐습니다.

12월 4일에 스크립트를 모두 다시 돌렸을 때는 새 작은 노드 8대 중 1대가 WARM 1 / MIN 3이 아니라 WARM 4 / MIN 6으로 떴는데, gate는 한 번도 막지 않았습니다. mutation이 gate보다 먼저 실행되고 둘 다 resource.Get()으로 Node를 따로 읽으니까, 두 번 읽는 사이에 크기 label이 붙은 것으로 보입니다. mutation은 크기를 못 봐서 기본값을 넣었고, gate는 label을 봐서 통과시킨 거죠. validating admission은 mutation이 끝난 객체를 보기 때문에, gate에 Binding의 annotation이 노드 크기의 값과 같은지 비교하는 규칙을 하나 더 넣었습니다. 확인을 위해 mutation은 WARM 2 / MIN 3, gate는 WARM 1 / MIN 3으로 일부러 다르게 두었더니 binding이 15번 거부됐고, 둘을 WARM 1 / MIN 3으로 맞추자 10초 안에 WARM 1 / MIN 3으로 배치됐습니다. 새 규칙을 넣은 뒤 작은 노드 8대를 두 번 더 새로 띄웠을 때는 모두 WARM 1 / MIN 3이었습니다. 다만 이때는 경합이 다시 생기지 않아서 새 규칙이 실제로 막은 건은 없었습니다.

두 정책의 값을 일부러 다르게 했을 때 aws-node 스케줄링 이벤트 (시각, Pod, 횟수, 메시지)
2026-12-04T00:24:31Z  aws-node-s88wr  15  running Bind plugin "DefaultBinder":
  admission webhook "vpol.validate.kyverno.svc-fail-finegrained-aws-node-size-gate" denied the request:
  Policy aws-node-size-gate failed: values on the binding do not match size large of node ip-10-70-23-216.ap-northeast-2.compute.internal
방법새 노드결과
방법 1 · DaemonSet 분리m6i.large 4대4대 모두 aws-node-large만 뜨고 32~34초에 Ready. 전체 IP 수는 방법 2와 같음
방법 2 · Kyverno 주입약 20대, 모든 크기먼저 온 binding 2건은 gate가 막음. 다시 돌릴 때 8대 중 1대가 기본값, gate에 값 확인을 더한 뒤 16대 모두 맞는 값

표 4. 테스트 1 · 크기별 값 주입

두 방법의 차이는 업그레이드 때 납니다(테스트 6 · 값 변경과 업그레이드).

04

테스트 2 · 작은 노드 IP 절감

  • 질문 작은 노드만 값을 낮추면 IP가 얼마나 줄어드나
    조건과 절차 m6i.4xlarge 1대(WARM 4 / MIN 6) + m6i.large 8대, 노드마다 일반 Pod 3개 → 작은 노드 값 WARM 4 / MIN 6으로 한 번, WARM 1 / MIN 3으로 한 번, 매번 새 노드로
    잰 것 노드별 secondary IP와 ENI 수(EC2 API), 노드별·전체 서브넷 IP

작은 노드로 채운 구성은 m6i.4xlarge 1대와 m6i.large 8대이고, 모두 Karpenter로 새로 띄웠습니다. 노드마다 일반 Pod는 3개입니다. 큰 노드는 두 번 모두 WARM 4 / MIN 6으로 두고 작은 노드 값만 바꿨습니다.

그림 2. 노드당 일반 Pod 3개일 때 평소와 작은 노드로 대신 채운 뒤의 서브넷 IP. 평소에는 큰 노드 1대가 서브넷 IP 8개를 씁니다. 같은 CPU를 작은 노드 8대로 채우면, 같은 값(WARM 4 / MIN 6)일 때 노드마다 8개, 합계 64개입니다. 작은 노드만 낮은 값(WARM 1 / MIN 3)을 주면 노드마다 5개, 합계 40개입니다평소큰 노드 1대WARM 4 / MIN 64xlarge서브넷 IP 8개Pod 3 + warm 4+ ENI primary 1작은 노드 · 모든 노드 같은 값같은 CPU, 작은 노드 8대WARM 4 / MIN 6largelargelargelargelargelargelargelarge8대 × 8개 = 서브넷 IP 64개작은 노드 · 작은 노드만 낮은 값같은 CPU, 작은 노드 8대WARM 1 / MIN 3largelargelargelargelargelargelargelarge8대 × 5개 = 서브넷 IP 40개(−24)Pod IPwarm IP(예비, 미사용)ENI primary IPEC2 인스턴스아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)그림 2. 노드당 일반 Pod 3개일 때 평소와 작은 노드로 대신 채운 뒤의 서브넷 IP. 평소에는 큰 노드 1대가 서브넷 IP 8개를 씁니다. 같은 CPU를 작은 노드 8대로 채우면, 같은 값(WARM 4 / MIN 6)일 때 노드마다 8개, 합계 64개입니다. 작은 노드만 낮은 값(WARM 1 / MIN 3)을 주면 노드마다 5개, 합계 40개입니다평소 · 큰 노드 1대WARM 4 / MIN 64xlarge서브넷 IP 8개작은 노드 · 모든 노드 같은 값WARM 4 / MIN 6largelargelargelargelargelargelargelarge8대 × 8개 = 서브넷 IP 64개작은 노드 · 작은 노드만 낮은 값WARM 1 / MIN 3largelargelargelargelargelargelargelarge8대 × 5개 = 서브넷 IP 40개(−24)Pod IPwarm IP(예비, 미사용)ENI primary IPEC2 인스턴스아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)

그림 3. 노드당 일반 Pod 3개일 때의 서브넷 IP, 측정값(큰 노드 역할 m6i.4xlarge, 작은 노드 역할 m6i.large)

작은 노드 값작은 노드 1대가 잡은 IP작은 노드 1대 서브넷 소비작은 노드 8대전체 9대
WARM 4 / MIN 6, 큰 노드와 같은 값786472
WARM 1 / MIN 3, 작은 노드만454048

표 5. 테스트 2 · 작은 노드 IP 절감. 노드마다 ENI는 1장이었습니다

노드당 줄어드는 양은 max(MIN, Pod 수 + WARM)의 차이라서, 지금 쓰는 값과 작은 노드에 일반 Pod가 몇 개 뜨는지에 따라 달라집니다. 노드당 Pod 3개면 WARM 3 / MIN 3은 6개, WARM 2 / MIN 3은 5개를 잡습니다. Pod 보안 그룹을 쓰는 Pod의 IP와 trunk ENI는 warm 값과 관계없어서 그대로입니다.

05

테스트 3 · Pod 시작 지연

  • 질문 예비 IP가 적으면 Pod가 얼마나 늦게 뜨나
    조건과 절차 일반 Pod 3개가 뜬 m6i.large 1대 → 한 번에 13개로 늘림, 값마다(WARM 4 / MIN 6, WARM 3 / MIN 3, WARM 2 / MIN 3, WARM 1 / MIN 3) 2~3번 → 같은 노드에서 SGPP Pod 0 → 9개
    잰 것 Pod마다 생성부터 Ready까지 걸린 시간, FailedCreatePodSandBox 이벤트, 노드가 잡은 IP 수

예비 IP가 적으면 한꺼번에 뜨는 Pod는 기다려야 합니다. 작은 노드 한 대에서 일반 Pod를 3개에서 13개로 한 번에 늘렸고, 값마다 2~3번씩 쟀습니다.

작은 노드 값새 Pod 10개 중 바로 뜬 수마지막 Pod Ready까지중앙값
WARM 4 / MIN 6416~32초12~14초
WARM 3 / MIN 3329~43초12~14초
WARM 2 / MIN 3229~54초13~26초
WARM 1 / MIN 3165~83초30~40초

표 6. 테스트 3 · Pod 시작 지연, m6i.large 한 대에서 일반 Pod 3 → 13개. 12월 3일과 4일 두 번 측정한 범위입니다

ipamd는 5초마다 예비 IP를 WARM 개수만큼 다시 채우는데, IP를 기다리는 Pod 수는 세지 않습니다(datastoreTargetState()). 그래서 예비 IP 수만큼은 바로 뜨고, 나머지는 WARM 개수씩 약 12초 간격으로 뜹니다. 기다리는 Pod에는 IP를 받을 때까지 FailedCreatePodSandBox 이벤트가 찍힙니다.

Pod 보안 그룹을 쓰는 Pod는 다르게 동작합니다. 같은 노드에서 ENABLE_POD_ENI=true와 SecurityGroupPolicy를 넣고 SGPP Pod를 0개에서 9개로 늘렸습니다.

작은 노드 값SGPP Pod 9개 Ready까지노드가 잡은 IP
WARM 4 / MIN 62~3초7 (변화 없음)
WARM 1 / MIN 33~4초4 (변화 없음)

표 7. 테스트 3 · Pod 시작 지연, m6i.large 한 대에서 SGPP Pod 0 → 9개

SGPP Pod는 VPC Resource Controller가 붙여 주는 branch ENI로 IP를 받아서 warm 값과 관계가 없습니다. 다만 지운 SGPP Pod의 branch ENI는 기본 60초 cooldown 동안 남아 있습니다(SGP 설정 옵션). 그래서 branch ENI 한도가 찬 노드(m6i.large는 9개)에서 SGPP Pod를 지우자마자 새로 띄우면 두 값 모두 처음 측정에서는 62초, 다시 돌렸을 때는 123~124초를 기다렸습니다. 작은 노드에서 SGPP Pod 교체가 잦다면, 시작 시간을 정하는 건 warm 값이 아니라 branch ENI 한도와 이 cooldown입니다.

06

테스트 4 · Kyverno 장애

  • 질문 Kyverno가 응답하지 못할 때 새 노드는 어떻게 되나
    조건과 절차 방법 2 → Kyverno replica 0, 또는 failurePolicy Fail과 Ignore에서 Service 엔드포인트 비우기 → m6i.large 1대와 일반 Pod 1개 추가 → Kyverno 복구
    잰 것 노드 Ready, aws-node가 배치됐는지(Pending인지)와 그 값, 일반 Pod, Kyverno 복구 뒤 상태

방법 2는 노드가 뜰 때 Kyverno가 응답해야 동작합니다. 그래서 장애 상태 세 가지에서 새 노드를 띄워 봤습니다. Kyverno 응답 불가는 webhook 설정은 그대로 두고 Kyverno Service의 selector를 바꿔 엔드포인트를 비우는 식으로 만들었습니다.

그림 3. admission 장애 때 새 노드의 aws-node. 정상이면 값이 들어가고 약 30초에 Ready. admission 응답 불가 + failurePolicy Fail이면 binding이 거부돼 노드가 NotReady로 남고, 복구되면 맞는 값으로 저절로 회복. 응답 불가 + Ignore이거나 Kyverno를 replica 0으로 내리면(webhook 삭제) 노드는 Ready지만 aws-node는 재시작 전까지 기본값으로 동작. 어느 경우든 다른 Pod는 영향 없음상황aws-node binding새 노드admission이 돌아온 뒤정상admission 응답 정상값이 들어감WARM 1 / MIN 3약 30초에 ReadyIP 4개 잡음회복할 것 없음응답 불가 · FailService 엔드포인트 없음거부, 계속 재시도2분 동안 15회2분 넘게 NotReadycni plugin not initialized저절로 회복4초에 배치, 20초에 Ready응답 불가 · IgnoreService 엔드포인트 없음정책 없이 통과annotation 없음바로 Ready기본값 · IP 18개 잡음기본값 그대로aws-node 재시작 전까지Kyverno replica 0Kyverno가 webhook 삭제정책 없이 통과annotation 없음바로 Ready기본값 · IP 18개 잡음기본값 그대로aws-node 재시작 전까지어느 경우든 aws-node가 아닌 Pod는 정상 배치됐어요. 정책이 kube-system의 aws-node-* binding만 대상으로 하기 때문이에요.의도대로 동작노드를 못 쓰거나 값이 틀림아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)그림 3. admission 장애 때 새 노드의 aws-node. 정상이면 값이 들어가고 약 30초에 Ready. admission 응답 불가 + failurePolicy Fail이면 binding이 거부돼 노드가 NotReady로 남고, 복구되면 맞는 값으로 저절로 회복. 응답 불가 + Ignore이거나 Kyverno를 replica 0으로 내리면(webhook 삭제) 노드는 Ready지만 aws-node는 재시작 전까지 기본값으로 동작. 어느 경우든 다른 Pod는 영향 없음정상admission 응답 정상값이 들어감WARM 1 / MIN 3약 30초에 ReadyIP 4개 잡음회복할 것 없음응답 불가 · FailService 엔드포인트 없음거부, 계속 재시도2분 동안 15회2분 넘게 NotReadycni plugin not initialized저절로 회복4초에 배치, 20초에 Ready응답 불가 · IgnoreService 엔드포인트 없음정책 없이 통과annotation 없음바로 Ready기본값 · IP 18개 잡음기본값 그대로aws-node 재시작 전까지Kyverno replica 0Kyverno가 webhook 삭제정책 없이 통과annotation 없음바로 Ready기본값 · IP 18개 잡음기본값 그대로aws-node 재시작 전까지어느 경우든 다른 Pod는 영향이 없었어요.의도대로 동작노드를 못 쓰거나 값이 틀림아이콘: AWS Architecture Icons, Kubernetes 아이콘(CC BY 4.0)

그림 4. Kyverno 장애 때 새 노드의 aws-node가 어떻게 되는지, 측정값

상태새 노드Kyverno가 돌아온 뒤
응답 불가 · failurePolicy Failaws-node가 Pending(2분 동안 배치 실패 15회), 노드는 cni plugin not initialized로 NotReady4초 만에 배치, 20초 만에 노드 Ready, 값도 정상
응답 불가 · failurePolicy Ignore노드는 바로 Ready지만 aws-node에 annotation이 없어 기본값으로 뜸. Pod 3개에 IP 18개90초 뒤에도 기본값 그대로. aws-node를 다시 띄울 때까지 유지
Kyverno replica 0 (Fail)Ignore와 같음. annotation 없음, IP 18개aws-node를 다시 띄울 때까지 기본값 그대로

표 8. 테스트 4 · Kyverno 장애

failurePolicy Fail일 때 aws-node 스케줄링 이벤트 (시각, Pod, 횟수, 메시지)
2026-12-03T12:36:41Z  aws-node-g5s8w  15  running Bind plugin "DefaultBinder": Internal error occurred:
  failed calling webhook "mpol.validate.kyverno.svc-fail-finegrained-aws-node-warm-ip":
  failed to call webhook: Post "https://kyverno-svc.kyverno.svc:443/mpol/aws-node-warm-ip?timeout=10s":
  no endpoints available for service ...

replica를 0으로 내리면 Kyverno가 종료하면서 자기 resource webhook 설정을 지웁니다. 그래서 정책이 Fail이었는데도 binding이 정책 없이 진행됐습니다. 어느 경우든 aws-node가 아닌 Pod는 평소처럼 배치됐는데요, webhook의 matchConditions가 kube-system의 aws-node-* binding만 Kyverno로 보내기 때문입니다.

그래서 Fail로 쓴다면 Kyverno를 고가용성으로 운영해야 합니다. 작은 노드로 대신 채우는 동안에는 노드가 계속 뜨거든요. Ignore로 쓰거나, Kyverno가 내려가는 경우까지 대비하려면 annotation 없는 aws-node Pod를 찾아 다시 띄우는 감시를 따로 두는 게 좋습니다.

07

테스트 5 · 값 설정 실수

  • 질문 정책 값을 잘못 넣으면 어떻게 되나
    조건과 절차 기본값 없는 정책 + 표에 없는 m6i.xlarge 1대 → large 노드에 WARM 0 / MIN 0, 이어서 WARM 0 / MIN 3을 넣고 Pod 3 → 13개 → 값을 고침
    잰 것 노드가 잡은 IP와 ENI, IP를 못 받는 Pod, 값을 고친 뒤 모든 Pod가 뜰 때까지 걸린 시간
실수결과
표에 없는 크기(m6i.xlarge)의 노드가 뜸, 기본값 규칙 없음annotation이 없어 env가 빈 문자열이 되고, ipamd는 기본값 WARM_ENI_TARGET=1로 동작. Pod 3개에 ENI 2장, IP 28개(서브넷 소비 30). 기본값 WARM 4 / MIN 6을 넣고 aws-node를 다시 띄우자 IP 7개가 됐지만 ENI 2장은 남음(서브넷 소비 9)
WARM 0 / MIN 0README 설명대로 값이 없는 것으로 처리돼 기본값으로 돌아감. Pod 3개에 ENI 2장, IP 13개(서브넷 소비 15). 오히려 늘어남
WARM 0 / MIN 3Pod 3개일 때는 IP 3개로 정확. Pod를 13개로 늘리자 새 Pod 10개가 5분 넘게 IP를 못 받음(DataStore has no available IP/Prefix addresses). WARM 1 / MIN 3으로 바꾸고 aws-node를 다시 띄우자 80초 만에 13개 모두 Running

표 9. 테스트 5 · 값 설정 실수

WARM 0 / MIN 3은 테스트 3에서 본 ipamd의 계산 방식 때문에 생기는 결과입니다. WARM이 0이면 예비 IP가 생기지 않고 기다리는 Pod도 세지 않으니, 노드가 잡는 IP가 MIN 위로 늘어나지 않거든요. WARM은 1 이상으로 두고, 표에 없는 크기를 받을 기본값을 정책에 꼭 넣어 두세요. 명시적인 0과 값 없음을 구분하는 수정은 PR #3979로 열려 있습니다(2026년 12월 3일 기준 미반영).

08

테스트 6 · 값 변경과 업그레이드

  • 질문 값을 바꾸거나 aws-node를 업그레이드해도 값이 남나
    조건과 절차 ping을 돌리며 작은 노드 값 WARM 1 → 2 → 1(MIN은 3 그대로) → v1.23.2에서 시작해 kubectl apply로, 이어서 kubectl replace로 v1.23.3 업그레이드 → 방법 1로 같은 방식
    잰 것 새 값이 반영되기까지 걸린 시간, ping 손실, 업그레이드 뒤 env와 affinity, 새 노드에 뜨는 aws-node

Pod 사이에 ping을 돌리면서 작은 노드 값을 WARM 1 / MIN 3에서 WARM 2 / MIN 3으로 바꿨다가 되돌렸고, 이어서 aws-node를 v1.23.2에서 v1.23.3으로 두 가지 방식으로 올려 봤습니다.

변경방법 1 · DaemonSet 분리방법 2 · Kyverno 주입
값 바꾸기env를 바꾸면 DaemonSet이 스스로 rollout(9~17초). 20~30초 안에 새 값. ping 손실 0aws-node를 다시 띄우기 전에는 그대로. rollout restart가 노드 10대에 48초, 끝난 뒤 30초 안에 새 값. 같은 노드, 다른 노드 모두 ping 750개 중 손실 0
kubectl apply -f aws-k8s-cni.yaml로 업그레이드원래 aws-node의 크기 제외 affinity가 지워짐. 원래 aws-node가 모든 노드에 뜨려다 hostPort 충돌로 Pending, 복사본은 v1.23.2 그대로, 새 노드에는 기본값 aws-node가 먼저 뜸이미지만 바뀜. downward API env는 upstream 매니페스트와 last-applied annotation 어디에도 없어서 그대로 남음
매니페스트 통째로 덮어쓰기(kubectl replace -f)로 업그레이드테스트 안 함downward API env가 사라져 모든 노드가 기본값으로 돌아감. 노드 9대의 서브넷 소비 50 → 220개
값을 줄인 뒤IP는 반납하지만 이미 붙은 ENI는 primary IP와 함께 남을 수 있음. 위에서 env를 되돌린 뒤 전체가 잡은 IP는 41개, 서브넷 소비는 55개

표 10. 테스트 6 · 값 변경과 업그레이드

방법 1에서 affinity가 지워진 건 nodeSelectorTerms가 atomic 리스트라서, kubectl apply가 upstream 매니페스트의 값으로 통째로 바꾸기 때문입니다. 방법 1을 쓴다면 업그레이드용 매니페스트에 affinity를, 방법 2를 쓴다면 downward API env 두 개를 꼭 넣어 두세요.

09

재현 설정

aws-node는 고정 값 대신 Pod annotation에서 값을 읽게 바꿉니다.

yaml (aws-node 컨테이너 env)
- name: WARM_IP_TARGET
  valueFrom:
    fieldRef:
      fieldPath: metadata.annotations['aws-vpc-cni/warm-ip-target']
- name: MINIMUM_IP_TARGET
  valueFrom:
    fieldRef:
      fieldPath: metadata.annotations['aws-vpc-cni/minimum-ip-target']

이번 테스트에서 Kyverno v1.20.0은 예전 kyverno.io/v1 ClusterPolicy 생성을 거부해서("Kyverno v1.20 removed execution of legacy kyverno.io policy types and no longer accepts create or update requests for them"), 정책 두 개를 CEL 정책으로 썼습니다. 아래 값은 테스트 2에서 쓴 값(large WARM 1 / MIN 3, 그 밖의 크기 WARM 4 / MIN 6)이니 표는 쓰시는 크기에 맞게 바꾸세요.

yaml
apiVersion: policies.kyverno.io/v1
kind: ValidatingPolicy
metadata: { name: aws-node-size-gate }
spec:
  failurePolicy: Fail
  validationActions: [Deny]
  matchConstraints:
    resourceRules:
    - { apiGroups: [""], apiVersions: [v1], operations: [CREATE], resources: [pods/binding] }
  matchConditions:
  - name: aws-node-binding
    expression: request.namespace == 'kube-system' && object.metadata.name.startsWith('aws-node-')
  variables:
  - { name: node, expression: 'resource.Get("v1", "nodes", "", object.target.name)' }
  - { name: size, expression: "variables.node.metadata.?labels[?'karpenter.k8s.aws/instance-size'].orValue('')" }
  - { name: nodegroup, expression: "variables.node.metadata.?labels[?'eks.amazonaws.com/nodegroup'].orValue('')" }
  - { name: table, expression: '{"large": ["1", "3"], "4xlarge": ["4", "6"]}' }
  - { name: v, expression: 'variables.table[?variables.size].orValue(["4", "6"])' }
  validations:
  - expression: variables.size != '' || variables.nodegroup != ''
    messageExpression: "'node ' + object.target.name + ' has no instance-size label yet'"
  - expression: >-
      variables.size == '' || (
      object.metadata.?annotations[?'aws-vpc-cni/warm-ip-target'].orValue('') == variables.v[0] &&
      object.metadata.?annotations[?'aws-vpc-cni/minimum-ip-target'].orValue('') == variables.v[1])
    messageExpression: "'values on the binding do not match size ' + variables.size + ' of node ' + object.target.name"
---
apiVersion: policies.kyverno.io/v1
kind: MutatingPolicy
metadata: { name: aws-node-warm-ip }
spec:
  failurePolicy: Fail
  matchConstraints:
    resourceRules:
    - { apiGroups: [""], apiVersions: [v1], operations: [CREATE], resources: [pods/binding] }
  matchConditions:
  - name: aws-node-binding
    expression: request.namespace == 'kube-system' && object.metadata.name.startsWith('aws-node-')
  variables:
  - { name: node, expression: 'resource.Get("v1", "nodes", "", object.target.name)' }
  - { name: size, expression: "variables.node.metadata.?labels[?'karpenter.k8s.aws/instance-size'].orValue('')" }
  - { name: table, expression: '{"large": ["1", "3"], "4xlarge": ["4", "6"]}' }
  - { name: v, expression: 'variables.table[?variables.size].orValue(["4", "6"])' }
  mutations:
  - patchType: ApplyConfiguration
    applyConfiguration:
      expression: >-
        Object{metadata: Object.metadata{annotations: {
          "aws-vpc-cni/warm-ip-target": variables.v[0],
          "aws-vpc-cni/minimum-ip-target": variables.v[1]}}}

관리형 노드 그룹 노드에는 Karpenter 크기 label이 없어서, gate는 eks.amazonaws.com/nodegroup label로 통과시킵니다. orValue(["4", "6"])가 표에 없는 크기의 기본값입니다. gate도 같은 표를 가지고 있어야 두 번째 규칙으로 값이 노드 크기와 맞지 않는 binding을 막을 수 있으니, 두 표를 항상 같이 고치세요.

정책이 resource.Get()으로 Node를 읽는데, Kyverno 기본 설치에는 그 권한이 없습니다. failurePolicy Fail 상태에서 aws-node binding이 전부 거부되다가, 아래 ClusterRole을 넣고 나서야 풀렸습니다.

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kyverno:admission-controller:read-nodes
  labels:
    rbac.kyverno.io/aggregate-to-admission-controller: "true"
rules:
  - apiGroups: [""]
    resources: ["nodes"]
    verbs: ["get", "list", "watch"]

정책의 값을 바꾼 뒤에는 kubectl rollout restart ds/aws-node -n kube-system으로 aws-node를 다시 띄웁니다.

10

적용 전에 확인할 것

  • 얼마나 줄어드는지. 지금 쓰는 값과 작은 노드에 뜨는 일반 Pod(SGPP가 아닌 Pod) 수로 max(MIN, Pod 수 + WARM)을 먼저 계산해 보세요. 작은 노드에 Pod가 이미 많이 뜬다면 warm 값을 바꿔도 차이가 크지 않습니다.
  • 작은 노드에서 Pod가 한꺼번에 얼마나 뜨는지. 일반 Pod가 한꺼번에 뜨는 일이 드문 노드라면 WARM 1 / MIN 3이 맞고, 아니라면 WARM 2 / MIN 3이나 WARM 3 / MIN 3이 덜 줄이는 대신 빨리 뜨는 절충입니다(테스트 3 · Pod 시작 지연).
  • 0은 쓰지 않기. PR #3979가 반영돼 릴리스될 때까지 WARM은 1 이상으로 둡니다(테스트 5 · 값 설정 실수).
  • 모든 크기에 기본값. Karpenter가 띄울 수 있는 크기는 모두 표에 있거나 기본값으로 받아야 합니다.
  • 장애 시 동작. Fail이면 새 노드가 Kyverno를 기다리니 고가용성으로 운영하고, Ignore라면, 그리고 Kyverno가 내려가는 경우에는 어느 쪽이든 annotation 없는 aws-node Pod를 감시합니다(테스트 4 · Kyverno 장애).
  • aws-node 업그레이드 방식. 파이프라인이 매니페스트를 통째로 렌더링해서 덮어쓴다면, 그 매니페스트에 downward API env를 먼저 넣어 두세요(테스트 6 · 값 변경과 업그레이드).
  • 좁은 정책 범위. 정책은 kube-system의 aws-node-* binding에만 걸어 두세요. 그래야 정책 장애가 다른 Pod 배치를 막지 않습니다.

11

테스트하지 않은 것

클러스터 하나, 리전 하나, 한 번에 최대 14대 노드로 테스트했습니다. 아래는 확인하지 않았습니다.

  • 24xlarge 같은 아주 큰 인스턴스. m6i.4xlarge와 m6i.large로 크기 비율만 살렸습니다.
  • EKS add-on으로 설치한 VPC CNI(#3630 코멘트가 쓰는 extraEnv 방식), 또는 Helm chart로 설치하고 업그레이드하는 경우. add-on 업데이트 때 downward API env가 남는지는 모릅니다.
  • prefix delegation(ENABLE_PREFIX_DELEGATION), custom networking(ENIConfig), IPv6 클러스터
  • OPA Gatekeeper나 직접 만든 webhook 같은 다른 admission 엔진. binding과 annotation 흐름은 Kubernetes 동작이지만, 테스트 4의 장애 동작은 Kyverno의 동작입니다.
  • 정책을 바꾸는 동안 Karpenter consolidation이나 drift로 노드가 교체되는 경우

테스트 코드

Terraform 구성, Kubernetes 매니페스트, 스크립트는 블로그 저장소의 demos/vpc-cni-warmip-kyverno에 있습니다. README에 스크립트 출력과 위 테스트의 대응표가 있구요, 2026년 12월 4일(UTC)에 README 순서대로 모든 스크립트를 테스트 클러스터에서 다시 돌렸고, 그때 찾은 문제는 고쳐 두었습니다. 비용이 나가는 리소스(EKS control plane, NAT gateway, t3.large 노드, 테스트 중에는 m6i 노드)를 만드니까, 다 쓰고 나면 ENI가 남지 않게 테스트 Pod와 네임스페이스부터 지운 뒤 terraform destroy를 실행하세요.

참고 자료