1. Packages
  2. Azure Classic
  3. How-to Guides
  4. Azure Kubernetes Service (AKS) Cluster

We recommend using Azure Native.

Azure v6.18.0 published on Monday, Feb 3, 2025 by Pulumi

Azure Kubernetes Service (AKS) Cluster

azure logo

We recommend using Azure Native.

Azure v6.18.0 published on Monday, Feb 3, 2025 by Pulumi

    View Code Deploy this example with Pulumi

    Stands up an Azure Kubernetes Service (AKS) cluster.

    Prerequisite

    1. Install Pulumi
    2. Install .NET Core 3.1+
    3. Install Azure CLI

    Configure the environment:

    pulumi config set azure:location westeurope
    pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
    az login
    

    Deploying the App (short version)

    To make it easier to try out you can use the available Makefile, like:

    make deploy
    

    This will build the project and run pulumi up -y. If you haven’t created a stack you will be prompted to do so.

    When the deploy is finished you can export the kubernetes config by running

    make exportconfig
    

    With the config exported you can now test to access the kubernetes cluster

    KUBECONFIG=./kubeconfig.yaml kubectl get nodes
    

    If you want to cleanup when you are done you can run

    make destroy
    make rmstack
    

    To list all make targets run

    make help
    

    The Makefile also works as documentation on what commands you need to run to deploy the application.

    Deploying the app (native version)

    If you don’t have make installed you will have to run the “native” commands. To deploy you run

    pulumi up --yes
    

    This will prompt you to create a stack if you haven’t done so already. When the deploy is ready you can export the kubernetes config with

    pulumi stack output kubeconfig --show-secrets > kubeconfig.yaml
    

    and then test the deployment with

    KUBECONFIG=./kubeconfig.yaml kubectl get nodes
    

    If you want to cleanup the cloud resources when you are done you can run

    pulumi destroy -y
    pulumi stack rm -y
    
    azure logo

    We recommend using Azure Native.

    Azure v6.18.0 published on Monday, Feb 3, 2025 by Pulumi