Skip to main content

Search the Dev Center

Search tutorials, templates, examples, and more.

Azure Kubernetes Service (AKS) cluster

Creates an Azure Kubernetes Service (AKS) cluster using F#

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set classic-azure-fs-aks
cd pulumi-examples/classic-azure-fs-aks

Stands up an Azure Kubernetes Service (AKS) cluster, written in F#.

Prerequisites#

  1. Install Pulumi
  2. Configure Azure credentials
  3. Install .NET

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):

    Terminal window
    az login
  3. Set the Azure location and subscription to deploy into:

    Terminal window
    pulumi config set azure:location westeurope
    pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
  4. Deploy the stack:

    Terminal window
    pulumi up
  5. Export the Kubernetes config and use it to access the cluster:

    Terminal window
    pulumi stack output kubeconfig --show-secrets > kubeconfig.yaml
    KUBECONFIG=./kubeconfig.yaml kubectl get nodes

Using the Makefile#

To make it easier to try out, you can use the included Makefile instead of the native commands above:

Terminal window
make deploy # builds the project and runs `pulumi up -y`
make exportconfig # writes the cluster kubeconfig to kubeconfig.yaml

To list all make targets, run:

Terminal window
make help

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

Cleaning up#

Once you are done, destroy the stack and remove it. With the Makefile:

Terminal window
make destroy
make rmstack

Or with the native commands:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.