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:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set classic-azure-fs-akscd pulumi-examples/classic-azure-fs-aksStands up an Azure Kubernetes Service (AKS) cluster.
Prerequisite#
Configure the environment:
pulumi config set azure:location westeuropepulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>az loginDeploying the App (short version)#
To make it easier to try out you can use the available Makefile, like:
make deployThis 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 exportconfigWith the config exported you can now test to access the kubernetes cluster
KUBECONFIG=./kubeconfig.yaml kubectl get nodesIf you want to cleanup when you are done you can run
make destroymake rmstackTo list all make targets run
make helpThe 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 --yesThis 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.yamland then test the deployment with
KUBECONFIG=./kubeconfig.yaml kubectl get nodesIf you want to cleanup the cloud resources when you are done you can run
pulumi destroy -ypulumi stack rm -y