---
title: "Azure Kubernetes Service (AKS) Cluster"
description: "Creates an Azure Kubernetes Service (AKS) cluster using F#"
url: "https://www.pulumi.com/dev/examples/classic-azure-fs-aks/"
image: "https://www.pulumi.com/assets/og/dev/examples/classic-azure-fs-aks.png"
---

# Azure Kubernetes Service (AKS) Cluster

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

- Source on GitHub: https://github.com/pulumi/examples/tree/master/classic-azure-fs-aks

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/classic-azure-fs-aks) repo. Pull down just this directory to follow along:

```bash
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](https://azure.microsoft.com/en-us/services/kubernetes-service/) (AKS) cluster.

## Prerequisite

1. [Install Pulumi](https://www.pulumi.com/docs/get-started/install/)
2. [Install .NET Core 3.1+](https://dotnet.microsoft.com/download)
3. [Install Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)

Configure the environment:

```bash
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](https://github.com/pulumi/examples/tree/master/classic-azure-fs-aks/Makefile), like:

```bash
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

```bash
make exportconfig
```

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

```bash
KUBECONFIG=./kubeconfig.yaml kubectl get nodes
```

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

```bash
make destroy
make rmstack
```

To list all make targets run

```bash
make help
```

The [Makefile](https://github.com/pulumi/examples/tree/master/classic-azure-fs-aks/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

```bash
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

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

and then test the deployment with

```bash
KUBECONFIG=./kubeconfig.yaml kubectl get nodes
```

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

```bash
pulumi destroy -y
pulumi stack rm -y
```
