Deploy wasmCloud on Azure Kubernetes Service (AKS)
The wasmCloud docs include a growing collection of guides for deploying wasmCloud to Kubernetes clusters hosted by cloud providers, including AWS Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), and Akamai Linode Kubernetes Engine (LKE).
Now you can find guides for deploying to Microsoft's Azure Kubernetes Service in both the wasmCloud and Azure documentation.
In this blog, we'll walk through the basics of a wasmCloud deployment on AKS, including how it works, the tools you'll need to get started, and a quickstart for a simple deployment.
wasmCloud on AKS
When you deploy to Kubernetes, wasmCloud hosts run inside of Kubernetes pods, and WebAssembly components run on those hosts. wasmCloud's unique primitives are represented as Kubernetes custom resources, so you can manage them with kubectl
(or other tooling that uses the Kubernetes API) the same way you would with any other Kubernetes resource. You can also use port-forwarding to connect to the deployed wasmCloud environment with the wash
CLI on your local machine.
wasmCloud is deployed to Kubernetes using a Helm chart, so to get started deploying to AKS you'll need the following:
- A free Azure account
kubectl
- Helm
- An AKS cluster (you can create one with the Azure CLI for Mac/Linux, PowerShell, or the Azure web portal)
Once you have all of your prerequisites squared away and kubectl
is set to work with your AKS cluster, you're ready to deploy.
For the purposes of this blog, we'll keep things simple and high-level—if you'd like a deeper dive on the patterns and elements of the deployment, including options and alternative approaches, see the Deploying wasmCloud on Kubernetes documentation.
First we'll use Helm to install the wasmcloud-platform
chart:
helm upgrade --install \
wasmcloud-platform \
--values https://raw.githubusercontent.com/wasmCloud/wasmcloud/main/charts/wasmcloud-platform/values.yaml \
oci://ghcr.io/wasmcloud/charts/wasmcloud-platform:0.1.2 \
--dependency-update
We can use kubectl rollout
and kubectl wait
to make sure all of the necessary pieces of the deployment are ready:
kubectl rollout status deploy,sts -l app.kubernetes.io/name=nats
kubectl wait --for=condition=available --timeout=600s deploy -l app.kubernetes.io/name=wadm
kubectl wait --for=condition=available --timeout=600s deploy -l app.kubernetes.io/name=wasmcloud-operator
Now we'll use Helm again to create a wasmCloud host:
helm upgrade --install wasmcloud-platform \
--values https://raw.githubusercontent.com/wasmCloud/wasmcloud/main/charts/wasmcloud-platform/values.yaml \
oci://ghcr.io/wasmcloud/charts/wasmcloud-platform \
--dependency-update \
--set "hostConfig.enabled=true"
When the deployment succeeds, you'll get this response:
✨ Congratulations! Your wasmCloud platform has been deployed successfully.
- 🛀 To use the wash cli with your new wasmCloud platform, run:
kubectl port-forward service/nats 4222:4222 4223:4223
- 🗺️ To launch the wasmCloud dashboard on http://localhost:3030, in a different terminal window, run:
wash ui
Now you're ready to run WebAssembly components on your cluster! Our Rust-based "Hello world" component makes a good test. We can deploy the manifest straight from GitHub using kubectl
:
kubectl apply -f https://raw.githubusercontent.com/wasmCloud/wasmcloud-operator/main/examples/quickstart/hello-world-application.yaml
You can verify that the deployment succeeded with the application
custom resource:
kubectl get application
APPLICATION DEPLOYED VERSION LATEST VERSION STATUS
hello-world v0.0.1 v0.0.1 Deployed
The component itself is running inside a host pod. Since the manifest uses a daemonscaler, your wasmCloud deployment automatically created a Kubernetes service to expose the component on the cluster. You can reach the component by port-forwarding the host pod:
WASMCLOUD_HOST_POD=$(kubectl get pods -o jsonpath="{.items[*].metadata.name}" -l app.kubernetes.io/instance=wasmcloud-host)
kubectl port-forward pods/$WASMCLOUD_HOST_POD 8000
Now we can curl
the application from our local machine:
curl http://localhost:8000
You should get the response:
Hello from Rust!
If you'd like to try deploying something a little more substantial, check out our examples in Go, Rust, and TypeScript—you could try...
When you're ready to delete the cluster, see the Clean up section of our AKS deployment guide.
Share your thoughts
Have questions about working with your AKS deployment? Want to see a deployment guide for another cloud? Join the wasmCloud Slack or a weekly community meeting and let us know!