Skip to content

Commit

Permalink
Add warmPrefixTarget and enablePrefixDelegation support to vpc cni op…
Browse files Browse the repository at this point in the history
…tions.
  • Loading branch information
davidroth committed Sep 7, 2021
1 parent 582aba0 commit 908bd11
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nodejs/eks/cmd/provider/cni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ interface VpcCniInputs {
externalSnat?: boolean;
warmEniTarget?: number;
warmIpTarget?: number;
warmPrefixTarget?: number;
enablePrefixDelegation?: boolean;
logLevel?: string;
logFile?: string;
image?: string;
Expand Down Expand Up @@ -68,6 +70,12 @@ function computeVpcCniYaml(cniYamlText: string, args: VpcCniInputs): string {
if (args.warmIpTarget) {
env.push({name: "WARM_IP_TARGET", value: args.warmIpTarget.toString()});
}
if (args.warmPrefixTarget) {
env.push({name: "WARM_PREFIX_TARGET", value: args.warmPrefixTarget.toString()});
}
if (args.enablePrefixDelegation) {
env.push({name: "ENABLE_PREFIX_DELEGATION ", value: args.enablePrefixDelegation.toString()});
}
if (args.logLevel) {
env.push({name: "AWS_VPC_K8S_CNI_LOGLEVEL", value: args.logLevel.toString()});
} else {
Expand Down
15 changes: 15 additions & 0 deletions nodejs/eks/cni.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ export interface VpcCniOptions {
*/
warmIpTarget?: pulumi.Input<number>;

/**
* WARM_PREFIX_TARGET will allocate one full (/28) prefix even if a single IP is consumed with the existing prefix.
* Ref: https://github.com/aws/amazon-vpc-cni-k8s/blob/master/docs/prefix-and-ip-target.md
*/
warmPrefixTarget?: pulumi.Input<number>;

/**
* IPAMD will start allocating (/28) prefixes to the ENIs with ENABLE_PREFIX_DELEGATION set to true.
* Ref: https://github.com/aws/amazon-vpc-cni-k8s/blob/master/docs/prefix-and-ip-target.md
*
*/
enablePrefixDelegation?: pulumi.Input<boolean>;

/**
* Specifies the log level used for logs.
*
Expand Down Expand Up @@ -191,6 +204,8 @@ export class VpcCni extends pulumi.CustomResource {
externalSnat: args?.externalSnat,
warmEniTarget: args?.warmEniTarget,
warmIpTarget: args?.warmIpTarget,
enablePrefixDelegation: args?.enablePrefixDelegation,
warmPrefixTarget: args?.warmPrefixTarget,
logLevel: args?.logLevel,
logFile: args?.logFile,
image: args?.image,
Expand Down
8 changes: 8 additions & 0 deletions provider/cmd/pulumi-resource-eks/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,14 @@
"warmIpTarget": {
"type": "integer",
"description": "Specifies the number of free IP addresses that the ipamD daemon should attempt to keep available for pod assignment on the node."
},
"warmPrefixTarget": {
"type": "integer",
"description": "WARM_PREFIX_TARGET will allocate one full (/28) prefix even if a single IP is consumed with the existing prefix."
},
"enablePrefixDelegation": {
"type": "boolean",
"description": "IPAMD will start allocating (/28) prefixes to the ENIs with ENABLE_PREFIX_DELEGATION set to true."
}
},
"type": "object"
Expand Down

0 comments on commit 908bd11

Please sign in to comment.