Comments (5)
Can you share the bicep code you are using to deploy AKS? What happens if you don't use a parameter and hard code the value in the resource declaration?
from bicep-types-az.
Thanks for the prompt answer!
This is the bicep script that I am trying to use.
param location string = resourceGroup().location
param projectName string = 'nsx-${uniqueString(resourceGroup().id)}'
param projectEnv string = 'test'
@description('Specifies the id of the virtual network.')
param virtualNetworkId string
@description('Specifies the name of the default subnet hosting the AKS cluster.')
param aksSubnetName string = 'AksSubnet'
@description('Specifies the CIDR notation IP range from which to assign pod IPs when kubenet is used.')
param aksClusterPodCidr string = '10.244.0.0/16'
@description('A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges.')
param aksClusterServiceCidr string = '10.2.0.0/16'
@description('Specifies the IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr.')
param aksClusterDnsServiceIP string = '10.2.0.10'
var virtualNetworkName = last(split(virtualNetworkId, '/'))
resource virtualNetwork 'Microsoft.Network/virtualNetworks@2020-08-01' existing = {
name: virtualNetworkName
}
resource aksSubnet 'Microsoft.Network/virtualNetworks/subnets@2020-08-01' existing = {
parent: virtualNetwork
name: aksSubnetName
}
resource networkContributorRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
name: '4d97b98b-1d4f-4787-a291-c67834d212e7'
scope: subscription()
}
// AKS Cluster
resource aksCluster 'Microsoft.ContainerService/managedClusters@2024-01-02-preview' = {
name: 'aks-${projectName}-${projectEnv}'
location: location
sku: {
name: 'Base'
tier: 'Free'
}
identity: {
type: 'SystemAssigned'
}
properties: {
dnsPrefix: 'aks-${projectName}-${projectEnv}-k8s'
agentPoolProfiles: [
{
name: 'agentpool'
count: 1
vmSize: 'Standard_B4ms'
vnetSubnetID: aksSubnet.id
mode: 'System'
}
{
name: 't4spotpool'
count: 1
minCount: 1
maxCount: 3
vmSize: 'Standard_NC4as_T4_v3'
spotMaxPrice: json('0.3')
mode: 'User'
vnetSubnetID: aksSubnet.id
nodeLabels: {
gpu: 't4'
}
nodeTaints: [
'sku=gpu:NoSchedule'
]
linuxOSConfig: {
transparentHugePageEnabled: 'madvise'
transparentHugePageDefrag: 'defer+madvise'
swapFileSizeMB: 26000
sysctls: {
netCoreSomaxconn: 163849
netIpv4TcpTwReuse: true
netIpv4IpLocalPortRange: '32000 60000'
}
}
kubeletConfig: {
cpuManagerPolicy: 'static'
cpuCfsQuota: true
cpuCfsQuotaPeriod: '200ms'
imageGcHighThreshold: 90
imageGcLowThreshold: 70
topologyManagerPolicy: 'best-effort'
allowedUnsafeSysctls: [
'kernel.msg*'
'net.*'
]
failSwapOn: false
}
upgradeSettings: {
maxSurge: null
}
scaleSetPriority: 'Spot'
enableAutoScaling: true
}
]
networkProfile: {
networkPlugin: 'kubenet'
podCidr: aksClusterPodCidr
serviceCidr: aksClusterServiceCidr
dnsServiceIP: aksClusterDnsServiceIP
}
}
tags: {
environment: projectEnv
}
}
// Assign the Network Contributor role to the Application Load Balancer user-assigned managed identity with the association subnet as as scope
resource aksNetworkContributorRoleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().name, 'aksManagedEntity', networkContributorRole.id)
scope: resourceGroup()
properties: {
roleDefinitionId: networkContributorRole.id
principalId: aksCluster.identity.principalId
principalType: 'ServicePrincipal'
}
}
from bicep-types-az.
Got it - this is more than likely not an issue with Bicep itself. I would recommend opening up a support case so this can be routed to the AKS team. I will also share this with the AKS PG to see if they can help in the meantime.
from bicep-types-az.
This looks like an AKS validation bug to me. If you set the Type
field of the spot AgentPool to be VirtualMachineScaleSets
I believe the error will stop.
from bicep-types-az.
We'll get a fix in so that in the future you don't need this workaround (setting Type
).
It won't roll out for a few weeks though
from bicep-types-az.
Related Issues (20)
- Microsoft.DataProtection/backupVaults not able to set SystemAssigned Identity HOT 1
- Error while deploying Azure Container App with bicep: ContainerAppInvalidResourceTotal HOT 1
- add tags to new subscription bicep not allowed
- MySQL Flexible deployment fails when properties.maintenanceWindow is set HOT 2
- Microsoft.Web/connections@2018-07-01-preview and Microsoft.Web/connections/accessPolicies@2018-07-01-preview
- Azure Container Apps - KEDA scale (managed identity) HOT 5
- Microsoft.Web/sites@2021-03-01 ipSecurityRestrictionsDefaultAction
- deployment ignores condition and is validating module
- [Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers]: compositeIndexes type issue
- [Microsoft.PowerPlatform/enterprisePolicies]: Virtual Networks Object structure is incorrect
- Microsoft.ContainerRegistry/registries@2023-07-01: The property "{...}" is not allowed on objects of type "RegistryProperties"
- [Microsoft.Fabric]: The specified "object" declaration is missing the following required properties: "state"
- Second HCI deployment brokes the vm network interface HOT 1
- remoteGateways not included in Microsoft.Network/virtualNetworks/virtualNetworkPeerings@2024-01-01 resource HOT 1
- Error with creating an enterprise policy for power platform subnet injection HOT 2
- Microsoft.Web/sites/extensions: onedeploy properties are valid
- virtualMachineScaleSets health probe reference id
- Microsoft.PowerPlatform/enterprisePolicies: Problem with Microsoft provided bicep template and work around (that has 'type' issue)
- 'Microsoft.Fabric/capacities@2023-11-01': Warning for a missing property `State` while it is actually Read-Only
- [Microsoft.Sql/servers/databases]: Doesn't recognize maxCapacity for serverless
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bicep-types-az.