From 7624a48198b50d1f1bc3ba82f774b569eacdc58f Mon Sep 17 00:00:00 2001 From: Steven Hoang Date: Fri, 18 Oct 2024 18:35:11 +0800 Subject: [PATCH] up --- src/Aks/index.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Aks/index.ts b/src/Aks/index.ts index 25cb276..bf1481d 100644 --- a/src/Aks/index.ts +++ b/src/Aks/index.ts @@ -23,16 +23,17 @@ const autoScaleFor = ({ enableAutoScaling, nodeType, env, + maxCount, }: { env: Environments; nodeType: 'Default' | 'System' | 'User'; enableAutoScaling?: boolean; + maxCount?: number; }) => { const nodeCount = 1; const minCount = 1; - let maxCount = 3; - if (env === Environments.Prd) { + if (!maxCount) { switch (nodeType) { case 'User': maxCount = 5; @@ -116,6 +117,7 @@ export type AskAddonProps = { export type AskFeatureProps = { enablePrivateCluster?: boolean; enableAutoScale?: boolean; + maxAutoScaleNodes?: number; enablePodIdentity?: boolean; enableWorkloadIdentity?: boolean; //enableDiagnosticSetting?: boolean; @@ -131,7 +133,7 @@ export type AksAccessProps = { export type AksNetworkProps = { subnetId: pulumi.Input; virtualHostSubnetName?: pulumi.Input; - /** This is using for Private DNZ linking only*/ + /** This uses for Private DNZ linking only*/ extraVnetIds?: pulumi.Input[]; outboundIpAddress?: { ipAddressId?: pulumi.Input; @@ -185,7 +187,6 @@ export default async ({ aksAccess, envRoles, - envUIDInfo, vaultInfo, diskEncryptionSetId, @@ -210,7 +211,7 @@ export default async ({ const secretName = `${aksName}-config`; const nodeResourceGroup = naming.getResourceGroupName(`${aksName}-nodes`); - //Auto detect and disable Local Account + //Auto-detect and disable Local Account if (aksAccess.disableLocalAccounts === undefined && vaultInfo) { aksAccess.disableLocalAccounts = await getKeyVaultBase(vaultInfo.name) .checkSecretExist(secretName) @@ -308,6 +309,7 @@ export default async ({ env: currentEnv, nodeType: 'System', enableAutoScaling: features?.enableAutoScale, + maxCount: features?.maxAutoScaleNodes, }), name: 'defaultnodes', @@ -478,6 +480,7 @@ export default async ({ env: currentEnv, nodeType: p.mode, enableAutoScaling: features.enableAutoScale, + maxCount: features?.maxAutoScaleNodes, }), //This already added into defaultNodePoolProps