Skip to content

Instantly share code, notes, and snippets.

@dirien
Last active June 13, 2023 19:34
Show Gist options
  • Save dirien/b711a14e6c4fe89c86153b3eb99a0807 to your computer and use it in GitHub Desktop.
Save dirien/b711a14e6c4fe89c86153b3eb99a0807 to your computer and use it in GitHub Desktop.

Revisions

  1. dirien revised this gist Jun 13, 2023. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions update_cp.bicep
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    param location string = resourceGroup().location
    param resourceGroupName string = resourceGroup().name

    resource aks 'Microsoft.ContainerService/managedClusters@2023-03-01' existing = {
    name: 'aks'
    }

    param newKubernetesVersion string = '1.24.10'

    resource variables_cluster 'Microsoft.ContainerService/managedClusters@2023-03-01' = {
    name: 'my-bicep-aks'
    location: location
    properties: {
    id: aks.id
    kubernetesVersion: newKubernetesVersion
    }
    }
  2. dirien created this gist Jun 13, 2023.
    51 changes: 51 additions & 0 deletions main.bicep
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    param location string = resourceGroup().location
    param resourceGroupName string = resourceGroup().name

    param kubernetesVersion string = '1.24.9'
    param agentKubernetesVersion string = '1.24.9'

    resource aks 'Microsoft.ContainerService/managedClusters@2023-03-01' = {
    name: 'my-bicep-aks'
    location: location
    identity: {
    type: 'SystemAssigned'
    }
    properties: {
    kubernetesVersion: kubernetesVersion
    nodeResourceGroup: 'my-bicep-aks-nodes'
    dnsPrefix: resourceGroupName
    networkProfile: {
    networkPlugin: 'azure'
    networkPolicy: 'calico'
    }
    oidcIssuerProfile: {
    enabled: true
    }
    agentPoolProfiles: [
    {
    name: 'default'
    count: 3
    vmSize: 'Standard_B2ms'
    osType: 'Linux'
    osDiskSizeGB: 30
    type: 'VirtualMachineScaleSets'
    mode: 'System'
    orchestratorVersion: agentKubernetesVersion
    }
    ]
    }
    }

    resource workloadpool 'Microsoft.ContainerService/managedClusters/agentPools@2023-03-01' = {
    parent: aks
    name: 'workloadpool'
    properties: {
    count: 3
    vmSize: 'Standard_B2ms'
    osType: 'Linux'
    osDiskSizeGB: 30
    type: 'VirtualMachineScaleSets'
    //mode: 'System'
    orchestratorVersion: agentKubernetesVersion
    }
    }