Newsletter
TechAnV Blog
Get updates on security engineering, Rust, eBPF, and DevSecOps. No spam, unsubscribe anytime.
Check your inbox and click the confirmation link to complete your subscription.
Day 35 - Azure for DevSecOps Operators#
Here is a summary of the steps to create an AKS cluster using Bicep:
-
Create a resource group:
1az group create --name myResourceGroup --location eastus -
Create a Bicep file (myAKS.bicep) with the following content:
1param clusterName string = 'myAKSCluster'2param location string = 'eastus'3param dnsPrefix string = 'mydns'4param osDiskSizeInGB int = 305param agentCount int = 16param image string = 'CanonicalUbuntuServer'78@landingSlot9resource aks myAKSCluster = Microsoft.ContainerInstances/managedClusters@2020-06-01 {10name: clusterName11location: location12properties: {13dnsPrefix: dnsPrefix14kubernetesVersion: '1.27.7'15osType: 'Linux'16servicePrincipalProfile: {17clientId: '<Your Service Principal Client ID>'18secret: '<Your Service Principal Secret>'19}20enableManagedIdentity: true21}22sku: {23tier: Premium24name: Standard_D4_v325}26agentPoolProfiles: [27{28name: 'agentpool'29count: agentCount30osType: 'Linux'31osDiskSizeInGB: osDiskSizeInGB32vmSize: 'Standard_DS2_v3'33type: 'VirtualMachineScaleSets'34mode: System35}36]37} -
Install the Azure CLI and Azure PowerShell, if you haven’t already.
-
Run the following command to login to your Azure account:
1az login -
Deploy the Bicep file using the following command:
1az bicep build myAKS.bicep --output-file aksDeployment.json2az deployment group create --name myAKSDeployment --resource-group myResourceGroup --template-file aksDeployment.json -
Once the deployment is complete, you can connect to the AKS cluster using
kubectlandaz aks get-credentials. -
You can also view the status of your AKS cluster in the Azure portal under “Kubernetes service” > “Clusters”.
This content walks through a step-by-step guide on deploying an Azure Kubernetes Service (AKS) cluster using Bicep, a declarative infrastructure as code language developed by Microsoft. The purpose of this deployment is to create a test lab environment for testing and learning.
The video starts with creating a Resource Group in Azure using the Azure CLI tool, followed by generating and copying an SSH key. Then, it deploys a Bicep file to create the AKS cluster, including the necessary resources such as the Linux admin username and SSH RSA public key.
Once the deployment is complete, the video shows how to retrieve the credentials from the AKs cluster using the az aks get-credentials command. This allows the user to interact with the deployed resources and manage them through the Azure CLI or other tools.
The video also demonstrates how to use the kubectl command-line tool to verify that the deployment was successful, including checking the node pools, workloads, and virtual machine sizes.
Throughout the video, the author provides tips and suggestions for using Bicep and Azure Kubernetes Service, as well as promoting best practices for deploying and managing cloud-based infrastructure. The purpose of this content appears to be educational, with the goal of helping viewers learn about Azure Kubernetes Service and how to deploy it using Bicep.