Skip to content

Commit

Permalink
charts aws-vpc-cni: separate config values for windows & linux nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dshehbaj committed Jan 14, 2025
1 parent 94c4a15 commit ba7409a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# amazon-vpc-cni-k8s

Networking plugin for pod networking in [Kubernetes](https://kubernetes.io/) using [Elastic Network Interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) on AWS.
Expand Down Expand Up @@ -301,6 +300,11 @@ Type: Integer
Default: None

Specifies the number of free IP addresses that the `ipamd` daemon should attempt to keep available for pod assignment on the node. Setting this to a non-positive value is the same as setting this to 0 or not setting the variable.

For Windows nodes, use `--windows-warm-ip-target` flag or set the `WARM_WINDOWS_IP_TARGET` environment variable instead.
The behavior is identical to `WARM_IP_TARGET` but applies specifically to Windows nodes. When using the Helm chart, these are
configured via `warmIPTarget` and `warmWindowsIPTarget` values respectively.

With `ENABLE_PREFIX_DELEGATION` set to `true` then `ipamd` daemon will check if the existing (/28) prefixes are enough to maintain the
`WARM_IP_TARGET` if it is not sufficient then more prefixes will be attached.

Expand Down Expand Up @@ -333,6 +337,10 @@ Specifies the number of total IP addresses that the `ipamd` daemon should attemp
addresses to keep available at all times, it sets a target number for a floor on how many total IP addresses are allocated. Setting to a
non-positive value is same as setting this to 0 or not setting the variable.

For Windows nodes, use `--windows-minimum-ip-target` flag or set the `MINIMUM_WINDOWS_IP_TARGET` environment variable instead.
The behavior is identical to `MINIMUM_IP_TARGET` but applies specifically to Windows nodes. When using the Helm chart, these are
configured via `minimumIPTarget` and `minimumWindowsIPTarget` values respectively.

`MINIMUM_IP_TARGET` is for pre-scaling, `WARM_IP_TARGET` is for dynamic scaling. For example, suppose a cluster has an
expected pod density of approximately 30 pods per node. If `WARM_IP_TARGET` is set to 30 to ensure there are enough IPs
allocated up front by the CNI, then 30 pods are deployed to the node, the CNI will allocate an additional 30 IPs, for
Expand Down Expand Up @@ -578,6 +586,11 @@ Type: Integer
Default: None

Specifies the number of free IPv4(/28) prefixes that the `ipamd` daemon should attempt to keep available for pod assignment on the node. Setting to a non-positive value is same as setting this to 0 or not setting the variable.

For Windows nodes, use `--windows-warm-prefix-target` flag or set the `WARM_WINDOWS_PREFIX_TARGET` environment variable instead.
The behavior is identical to `WARM_PREFIX_TARGET` but applies specifically to Windows nodes. When using the Helm chart, these are
configured via `warmPrefixTarget` and `warmWindowsPrefixTarget` values respectively.

This environment variable works when `ENABLE_PREFIX_DELEGATION` is set to `true` and is overridden when `WARM_IP_TARGET` and `MINIMUM_IP_TARGET` are configured.

#### `DISABLE_NETWORK_RESOURCE_PROVISIONING` (v1.9.1+)
Expand Down
14 changes: 11 additions & 3 deletions charts/aws-vpc-cni/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ data:
enable-windows-ipam: {{ .Values.enableWindowsIpam | quote }}
enable-network-policy-controller: {{ .Values.enableNetworkPolicy | quote }}
enable-windows-prefix-delegation: {{ .Values.enableWindowsPrefixDelegation | quote }}
warm-prefix-target: {{ .Values.warmWindowsPrefixTarget | quote }}
warm-ip-target: {{ .Values.warmWindowsIPTarget | quote }}
minimum-ip-target: {{ .Values.minimumWindowsIPTarget | quote }}

# Linux node IP management settings
warm-prefix-target: {{ .Values.warmPrefixTarget | quote }}
warm-ip-target: {{ .Values.warmIPTarget | quote }}
minimum-ip-target: {{ .Values.minimumIPTarget | quote }}

# Windows node IP management settings
windows-warm-prefix-target: {{ .Values.warmWindowsPrefixTarget | quote }}
windows-warm-ip-target: {{ .Values.warmWindowsIPTarget | quote }}
windows-minimum-ip-target: {{ .Values.minimumWindowsIPTarget | quote }}

branch-eni-cooldown: {{ .Values.branchENICooldown | quote }}
24 changes: 19 additions & 5 deletions charts/aws-vpc-cni/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,28 @@ originalMatchLabels: false
# Settings for aws-vpc-cni ConfigMap
# - Network Policy settings
enableNetworkPolicy: "false"
# - Windows settings

# Linux node IP management settings
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#warm_ip_target
warmIPTarget: 1
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#minimum_ip_target-v160
minimumIPTarget: 3
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#warm_prefix_target-v190
warmPrefixTarget: 1

# Windows node settings
enableWindowsIpam: "false"
# - Windows Prefix Delegation settings
enableWindowsPrefixDelegation: "false"
warmWindowsPrefixTarget: 0

# Windows node IP management settings
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#warm_ip_target
warmWindowsIPTarget: 1
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#minimum_ip_target-v160
minimumWindowsIPTarget: 3
# - Security Groups for Pods settings
# https://github.com/aws/amazon-vpc-cni-k8s/tree/master?tab=readme-ov-file#warm_prefix_target-v190
warmWindowsPrefixTarget: 0
enableWindowsPrefixDelegation: "false"

# Security Groups for Pods settings
branchENICooldown: 60

cniConfig:
Expand Down

0 comments on commit ba7409a

Please sign in to comment.