1
- import * as native from " @pulumi/azure-native" ;
2
- import * as pulumi from " @pulumi/pulumi" ;
3
- import { Input , Output , output } from " @pulumi/pulumi" ;
4
- import vmsDiagnostic from " ./VmSetMonitor" ;
5
- import { BasicResourceArgs , KeyVaultInfo , ResourceInfo } from " ../types" ;
1
+ import * as native from ' @pulumi/azure-native' ;
2
+ import * as pulumi from ' @pulumi/pulumi' ;
3
+ import { Input , Output , output } from ' @pulumi/pulumi' ;
4
+ import vmsDiagnostic from ' ./VmSetMonitor' ;
5
+ import { BasicResourceArgs , KeyVaultInfo , ResourceInfo } from ' ../types' ;
6
6
import {
7
7
currentEnv ,
8
8
defaultScope ,
@@ -11,28 +11,28 @@ import {
11
11
parseResourceInfoFromId ,
12
12
isPrd ,
13
13
tenantId ,
14
- } from " ../Common/AzureEnv" ;
15
- import Locker from " ../Core/Locker" ;
16
- import aksIdentityCreator from " ./Identity" ;
17
- import { stack } from " ../Common/StackEnv" ;
18
- import { createDiagnostic } from " ../Logs/Helpers" ;
19
- import { getAksName , getResourceGroupName } from " ../Common/Naming" ;
20
- import { roleAssignment } from " ../AzAd/RoleAssignment" ;
21
- import { EnvRolesResults } from " ../AzAd/EnvRoles" ;
22
- import { getAksConfig } from " ./Helper" ;
23
- import { addCustomSecret } from " ../KeyVault/CustomHelper" ;
24
- import * as inputs from " @pulumi/azure-native/types/input" ;
25
- import { getKeyVaultBase } from " @drunk-pulumi/azure-providers/AzBase/KeyVaultBase" ;
26
- import { IdentityResult } from " ../AzAd/Identity" ;
27
- import { ManagedCluster } from " @pulumi/azure-native/containerservice" ;
14
+ } from ' ../Common/AzureEnv' ;
15
+ import Locker from ' ../Core/Locker' ;
16
+ import aksIdentityCreator from ' ./Identity' ;
17
+ import { stack } from ' ../Common/StackEnv' ;
18
+ import { createDiagnostic } from ' ../Logs/Helpers' ;
19
+ import { getAksName , getResourceGroupName } from ' ../Common' ;
20
+ import { roleAssignment } from ' ../AzAd/RoleAssignment' ;
21
+ import { EnvRolesResults } from ' ../AzAd/EnvRoles' ;
22
+ import { getAksConfig } from ' ./Helper' ;
23
+ import { addCustomSecret } from ' ../KeyVault/CustomHelper' ;
24
+ import * as inputs from ' @pulumi/azure-native/types/input' ;
25
+ import { getKeyVaultBase } from ' @drunk-pulumi/azure-providers/AzBase/KeyVaultBase' ;
26
+ import { IdentityResult } from ' ../AzAd/Identity' ;
27
+ import { ManagedCluster } from ' @pulumi/azure-native/containerservice' ;
28
28
29
29
const autoScaleFor = ( {
30
30
enableAutoScaling,
31
31
nodeType,
32
32
env,
33
33
} : {
34
34
env : Environments ;
35
- nodeType : " Default" | " System" | " User" ;
35
+ nodeType : ' Default' | ' System' | ' User' ;
36
36
enableAutoScaling ?: boolean ;
37
37
} ) => {
38
38
const nodeCount = 1 ;
@@ -41,12 +41,12 @@ const autoScaleFor = ({
41
41
42
42
if ( env === Environments . Prd ) {
43
43
switch ( nodeType ) {
44
- case " User" :
44
+ case ' User' :
45
45
maxCount = 5 ;
46
46
break ;
47
47
48
- case " Default" :
49
- case " System" :
48
+ case ' Default' :
49
+ case ' System' :
50
50
default :
51
51
maxCount = 3 ;
52
52
break ;
@@ -62,9 +62,9 @@ const autoScaleFor = ({
62
62
} ;
63
63
64
64
const defaultNodePoolProps = {
65
- availabilityZones : isPrd ? [ "1" , "2" , "3" ] : undefined ,
65
+ availabilityZones : isPrd ? [ '1' , '2' , '3' ] : undefined ,
66
66
type : native . containerservice . AgentPoolType . VirtualMachineScaleSets ,
67
- vmSize : " Standard_B2s" ,
67
+ vmSize : ' Standard_B2s' ,
68
68
69
69
maxPods : 50 ,
70
70
enableFIPS : false ,
@@ -83,25 +83,25 @@ const defaultNodePoolProps = {
83
83
84
84
export enum VmSizes {
85
85
/** 32G RAM - 4CPU - $221.92 */
86
- Standard_E4as_v4 = " Standard_E4as_v4" ,
86
+ Standard_E4as_v4 = ' Standard_E4as_v4' ,
87
87
/** 8G RAM - 2CPU - $77.38 */
88
- Standard_B2ms = " Standard_B2ms" ,
88
+ Standard_B2ms = ' Standard_B2ms' ,
89
89
/** 16G RAM - 4CPU - $154.03 */
90
- Standard_B4ms = " Standard_B4ms" ,
90
+ Standard_B4ms = ' Standard_B4ms' ,
91
91
/** 8G RAM - 2CPU - 87.60 */
92
- Standard_D2as_v4 = " Standard_D2as_v4" ,
92
+ Standard_D2as_v4 = ' Standard_D2as_v4' ,
93
93
/** 8G RAM - 2CPU - 87.60 */
94
- Standard_D2s_v3 = " Standard_D2s_v3" ,
94
+ Standard_D2s_v3 = ' Standard_D2s_v3' ,
95
95
/** 8G RAM - 4CPU - 182.5 */
96
- Standard_D4s_v3 = " Standard_D4s_v3" ,
96
+ Standard_D4s_v3 = ' Standard_D4s_v3' ,
97
97
/** 16G RAM - 4CPU - $175.20 */
98
- Standard_D4as_v4 = " Standard_D4as_v4" ,
98
+ Standard_D4as_v4 = ' Standard_D4as_v4' ,
99
99
/** 4G RAM - 2CPU - $69.35 */
100
- Standard_A2_v2 = " Standard_A2_v2" ,
100
+ Standard_A2_v2 = ' Standard_A2_v2' ,
101
101
/** 8G RAM - 4CPU - $144.54 */
102
- Standard_A4_v2 = " Standard_A4_v2" ,
102
+ Standard_A4_v2 = ' Standard_A4_v2' ,
103
103
/** 32G RAM - 4CPU - $205.13 */
104
- Standard_A4m_v2 = " Standard_A4m_v2" ,
104
+ Standard_A4m_v2 = ' Standard_A4m_v2' ,
105
105
}
106
106
107
107
export interface NodePoolProps
@@ -144,8 +144,8 @@ export type AksNetworkProps = {
144
144
} ;
145
145
} ;
146
146
147
- export type AksNodePoolProps = Omit < NodePoolProps , " subnetId" | " aksId" > ;
148
- export type DefaultAksNodePoolProps = Omit < AksNodePoolProps , " name" | " mode" > ;
147
+ export type AksNodePoolProps = Omit < NodePoolProps , ' subnetId' | ' aksId' > ;
148
+ export type DefaultAksNodePoolProps = Omit < AksNodePoolProps , ' name' | ' mode' > ;
149
149
150
150
export interface AksProps extends BasicResourceArgs {
151
151
//nodeResourceGroup?: string;
@@ -219,10 +219,10 @@ export default async ({
219
219
220
220
if ( ignoreChanges . length <= 0 ) {
221
221
ignoreChanges . push (
222
- " privateLinkResources" ,
223
- " networkProfile" ,
224
- " linuxProfile" ,
225
- " windowsProfile" ,
222
+ ' privateLinkResources' ,
223
+ ' networkProfile' ,
224
+ ' linuxProfile' ,
225
+ ' windowsProfile' ,
226
226
) ;
227
227
}
228
228
@@ -256,14 +256,14 @@ export default async ({
256
256
disableRunCommand : true ,
257
257
enablePrivateCluster : features ?. enablePrivateCluster ,
258
258
enablePrivateClusterPublicFQDN : true ,
259
- privateDNSZone : " system" ,
259
+ privateDNSZone : ' system' ,
260
260
} ,
261
261
262
262
addonProfiles : {
263
263
azureKeyvaultSecretsProvider : {
264
264
config : addon . enableAzureKeyVault
265
265
? {
266
- enableSecretRotation : " true" ,
266
+ enableSecretRotation : ' true' ,
267
267
}
268
268
: undefined ,
269
269
enabled : Boolean ( addon . enableAzureKeyVault ) ,
@@ -312,7 +312,7 @@ export default async ({
312
312
...defaultNodePool ,
313
313
...autoScaleFor ( {
314
314
env : currentEnv ,
315
- nodeType : " System" ,
315
+ nodeType : ' System' ,
316
316
enableAutoScaling : features ?. enableAutoScale ,
317
317
// powerState: {
318
318
// code: "Running",
@@ -322,13 +322,13 @@ export default async ({
322
322
// },
323
323
} ) ,
324
324
325
- name : " defaultnodes" ,
326
- mode : " System" ,
325
+ name : ' defaultnodes' ,
326
+ mode : ' System' ,
327
327
count : 1 ,
328
328
vnetSubnetID : network . subnetId ,
329
- kubeletDiskType : "OS" ,
330
- osSKU : " Ubuntu" ,
331
- osType : " Linux" ,
329
+ kubeletDiskType : 'OS' ,
330
+ osSKU : ' Ubuntu' ,
331
+ osType : ' Linux' ,
332
332
} ,
333
333
] ,
334
334
linuxProfile : linux
@@ -339,27 +339,27 @@ export default async ({
339
339
: undefined ,
340
340
//This is not inuse
341
341
windowsProfile : {
342
- adminUsername : " azureuser" ,
342
+ adminUsername : ' azureuser' ,
343
343
enableCSIProxy : true ,
344
344
} ,
345
345
autoScalerProfile : {
346
- balanceSimilarNodeGroups : " true" ,
347
- expander : " random" ,
348
- maxEmptyBulkDelete : "10" ,
349
- maxGracefulTerminationSec : " 600" ,
350
- maxNodeProvisionTime : " 15m" ,
351
- maxTotalUnreadyPercentage : "45" ,
352
- newPodScaleUpDelay : "0s" ,
353
- okTotalUnreadyCount : "3" ,
354
- scaleDownDelayAfterAdd : " 30m" ,
355
- scaleDownDelayAfterDelete : " 60s" ,
356
- scaleDownDelayAfterFailure : " 10m" ,
357
- scaleDownUnneededTime : " 10m" ,
358
- scaleDownUnreadyTime : " 20m" ,
359
- scaleDownUtilizationThreshold : " 0.5" ,
360
- scanInterval : " 60s" ,
361
- skipNodesWithLocalStorage : " false" ,
362
- skipNodesWithSystemPods : " true" ,
346
+ balanceSimilarNodeGroups : ' true' ,
347
+ expander : ' random' ,
348
+ maxEmptyBulkDelete : '10' ,
349
+ maxGracefulTerminationSec : ' 600' ,
350
+ maxNodeProvisionTime : ' 15m' ,
351
+ maxTotalUnreadyPercentage : '45' ,
352
+ newPodScaleUpDelay : '0s' ,
353
+ okTotalUnreadyCount : '3' ,
354
+ scaleDownDelayAfterAdd : ' 30m' ,
355
+ scaleDownDelayAfterDelete : ' 60s' ,
356
+ scaleDownDelayAfterFailure : ' 10m' ,
357
+ scaleDownUnneededTime : ' 10m' ,
358
+ scaleDownUnreadyTime : ' 20m' ,
359
+ scaleDownUtilizationThreshold : ' 0.5' ,
360
+ scanInterval : ' 60s' ,
361
+ skipNodesWithLocalStorage : ' false' ,
362
+ skipNodesWithSystemPods : ' true' ,
363
363
} ,
364
364
365
365
//Still under preview
@@ -432,7 +432,7 @@ export default async ({
432
432
? native . containerservice . OutboundType . UserDefinedRouting
433
433
: native . containerservice . OutboundType . LoadBalancer ,
434
434
435
- loadBalancerSku : " Standard" ,
435
+ loadBalancerSku : ' Standard' ,
436
436
loadBalancerProfile : network . outboundIpAddress
437
437
? {
438
438
outboundIPs : network . outboundIpAddress . ipAddressId
@@ -463,7 +463,7 @@ export default async ({
463
463
new native . containerservice . MaintenanceConfiguration (
464
464
`${ aksName } -MaintenanceConfiguration` ,
465
465
{
466
- configName : " default" ,
466
+ configName : ' default' ,
467
467
// notAllowedTime: [
468
468
// {
469
469
// end: "2020-11-30T12:00:00Z",
@@ -502,12 +502,12 @@ export default async ({
502
502
enableAutoScaling : features . enableAutoScale ,
503
503
} ) ,
504
504
505
- count : p . mode === " System" ? 1 : 0 ,
505
+ count : p . mode === ' System' ? 1 : 0 ,
506
506
//orchestratorVersion: kubernetesVersion,
507
507
vnetSubnetID : network . subnetId ,
508
- kubeletDiskType : "OS" ,
509
- osSKU : " Ubuntu" ,
510
- osType : " Linux" ,
508
+ kubeletDiskType : 'OS' ,
509
+ osSKU : ' Ubuntu' ,
510
+ osType : ' Linux' ,
511
511
} ) ,
512
512
) ;
513
513
}
@@ -520,18 +520,18 @@ export default async ({
520
520
pulumi
521
521
. all ( [ aks . identity , aks . identityProfile , network . subnetId ] )
522
522
. apply ( ( [ identity , identityProfile , sId ] ) => {
523
- if ( acrScope && identityProfile && identityProfile [ " kubeletidentity" ] ) {
523
+ if ( acrScope && identityProfile && identityProfile [ ' kubeletidentity' ] ) {
524
524
roleAssignment ( {
525
525
name : `${ name } -aks-identity-profile-pull` ,
526
- principalId : identityProfile [ " kubeletidentity" ] . objectId ! ,
527
- principalType : " ServicePrincipal" ,
528
- roleName : " AcrPull" ,
526
+ principalId : identityProfile [ ' kubeletidentity' ] . objectId ! ,
527
+ principalType : ' ServicePrincipal' ,
528
+ roleName : ' AcrPull' ,
529
529
scope : acrScope ,
530
530
} ) ;
531
531
532
532
addCustomSecret ( {
533
533
name : `${ name } -identity-clientId` ,
534
- value : identityProfile [ " kubeletidentity" ] . clientId ! ,
534
+ value : identityProfile [ ' kubeletidentity' ] . clientId ! ,
535
535
dependsOn : aks ,
536
536
contentType : name ,
537
537
vaultInfo,
@@ -542,8 +542,8 @@ export default async ({
542
542
roleAssignment ( {
543
543
name : `${ name } -system-net` ,
544
544
principalId : identity . principalId ,
545
- roleName : " Contributor" ,
546
- principalType : " ServicePrincipal" ,
545
+ roleName : ' Contributor' ,
546
+ principalType : ' ServicePrincipal' ,
547
547
scope : getResourceIdFromInfo ( {
548
548
group : parseResourceInfoFromId ( sId ) ! . group ,
549
549
} ) ,
@@ -577,12 +577,12 @@ export default async ({
577
577
targetResourceId : id ,
578
578
logWpId,
579
579
logsCategories : [
580
- " guard" ,
581
- " kube-controller-manager" ,
582
- " kube-audit-admin" ,
583
- " kube-audit" ,
584
- " kube-scheduler" ,
585
- " cluster-autoscaler" ,
580
+ ' guard' ,
581
+ ' kube-controller-manager' ,
582
+ ' kube-audit-admin' ,
583
+ ' kube-audit' ,
584
+ ' kube-scheduler' ,
585
+ ' cluster-autoscaler' ,
586
586
] ,
587
587
dependsOn : aks ,
588
588
} ) ;
0 commit comments