dev-resources.site
for different kinds of informations.
How to build and run SpinApp on Azure Kubernetes Services (AKS) with SpinKube in 3 steps
Published at
4/19/2024
Categories
webassembly
serverless
tutorial
kubernetes
Author
Thang Chung
This tutorial guides you to run SpinApp on AKS with SpinKube in just 3 simple steps.
Let's get started.
Step 1: Create AKS cluster
az login --use-device-code
az account set --subscription <your subscription id>
az account show
Now you are ready to create the AKS cluster as below:
az group create --name globalazure24 --location southeastasia
az aks create \
--resource-group globalazure24 \
--name spinkube-aks \
--node-count 1
--generate-ssh-keys
az aks get-credentials --resource-group globalazure24 --name spinkube-aks
Step 2: Install Spinkube on AKS
# SpinKube needs cert-manager for provisioning and managing TLS certificates that are used by the admission webhook system of the Spin Operator
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.crds.yaml
# Add Helm repositories jetstack and KWasm
helm repo add jetstack https://charts.jetstack.io
helm repo add kwasm http://kwasm.sh/kwasm-operator
# Update Helm repositories
helm repo update
# Install cert-manager using Helm
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.14.4
# Install KWasm operator
helm install \
kwasm-operator kwasm/kwasm-operator \
--namespace kwasm \
--create-namespace \
--set kwasmOperator.installerImage=ghcr.io/spinkube/containerd-shim-spin/node-installer:v0.13.1
# For demo, making all nodes can run wasm workload, kwasm-operator will create containerd-shim-spin on these nodes
kubectl annotate node --all kwasm.sh/kwasm-node=true
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.1.0/spin-operator.runtime-class.yaml
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.1.0/spin-operator.crds.yaml
kubectl apply -f https://github.com/spinkube/spin-operator/releases/download/v0.1.0/spin-operator.shim-executor.yaml
Step 3: Build and run SpinApp on AKS
git clone https://github.com/thangchung/coffeeshop-on-spinkube
git checkout feat/global-azure-2024
cd coffeeshop-on-spinkube/product-api
export IMAGE_NAME=ttl.sh/coffeeshop-product-api-spin:24h
spin registry push --build $IMAGE_NAME
spin kube scaffold -f $IMAGE_NAME > app.yaml
kubectl apply -f app.yaml
Now you're ready to curl
:
curl http://localhost/v1-get-items-by-types/1,2,3 | jq .
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 280 0 280 0 0 2788 0 --:--:-- --:--:-- --:--:-- 2800
[
{
"image": "img/COFFEE_BLACK.png",
"item_type": "CoffeeBlack",
"name": "COFFEE_BLACK",
"price": 3
},
{
"image": "img/COFFEE_WITH_ROOM.png",
"item_type": "CoffeeWithRoom",
"name": "COFFEE_WITH_ROOM",
"price": 3
},
{
"image": "img/ESPRESSO.png",
"item_type": "Espresso",
"name": "ESPRESSO",
"price": 3.5
}
]
Happy hacking SpinKube on AKS!
Articles
12 articles in total
Orchestrating Distributed Apps (Spin/Rust and .NET/C#) with .NET Aspire/Dapr
read article
CoffeeShop App Infused with AI - Intelligent Apps Development
read article
How to build and run SpinApp on Azure Kubernetes Services (AKS) with SpinKube in 3 steps
currently reading
SpinKube - the first look at WebAssembly/WASI application (SpinApp) on Kubernetes
read article
.NET on OPA Wasm - moving on the edge
read article
.NET 8 Integration Tests on Podman Desktop (Windows 11 - WSL2 Ubuntu 23)
read article
WebAssembly, Docker container, Dapr, and Kubernetes better together - Part 4: Package and deploy to Kubernetes
read article
WebAssembly, Docker container, Dapr, and Kubernetes better together - Part 3: Daprize the coffee backend services
read article
WebAssembly, Docker container, Dapr, and Kubernetes better together - Part 2: Build and run the coffee shop backend services
read article
WebAssembly, Docker container, Dapr, and Kubernetes better together - Part 1: Demo scenario with coffeeshop application
read article
How to run WebAssembly/WASI application (Spin) with Dapr on Kubernetes
read article
Start Podman on WSL2 in 4 steps
read article
Featured ones: