taikun.cloud

Guide to deploy SpinKube with WASM on Taikun CloudWorks

In this tutorial, we’ll walk through the process of deploying SpinKube on the Taikun CloudWorks platform and enabling WebAssembly (WASM) support. This will allow you to run WASM-based applications on your Kubernetes cluster.

Prerequisites

Step 1: Set up your Taikun CloudWorks Project

  1. Log in to your Taikun CloudWorks account.
  2. Create a new project or select an existing one.
  3. Navigate to the project dashboard.
Screenshot 2024-09-03 at 12.44.54

Step 2: Create a Kubernetes Cluster

  1. In your project, click on “Add Server” to create a new Kubernetes cluster.
  2. Choose your desired configuration (e.g., number of nodes, node size).
  3. “Enable the WASM” feature when creating the project for your new Kubernetes cluster within the Kubernetes profile in Taikun CloudWorks.
    wasm
  4. Deploy the cluster and wait for it to be ready.
image alt

Step 3: Install SpinKube

Now that we have our cluster ready with WASM support, let’s install SpinKube.

  1. Connect to your cluster using kubectl.
  2. Install the Spin CLI if you haven’t already:
Bash
curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash
sudo mv spin /usr/local/bin/
  1. Install the SpinKube plugin:
Bash
spin plugins update
spin plugins install kube
image alt

Step 4: Deploy a Sample Spin Application

Let’s deploy a simple “Hello, World!” Spin application to test our setup.

  1. Create a new Spin application:
Bash
spin new http-rust hello-spin
cd hello-spin
  1. Build the application:
Bash
spin build
  1. Deploy the application to your cluster:
Bash
spin deploy
image alt

Step 5: Verify the Deployment

  1. Check the status of your deployment:
Bash
kubectl get pods
  1. You should see your Spin application running.
  2. To access your application, you may need to set up port-forwarding or create an Ingress rule, depending on your cluster configuration.
Bash
kubectl port-forward deployment/hello-spin 8080:80
  1. Open a web browser and navigate to http://localhost:8080 to see your Spin application running.
hello-spin

Conclusion

Congratulations! You’ve successfully deployed SpinKube on the Taikun CloudWorks platform with WASM support enabled. You can now develop and deploy WebAssembly applications on your Kubernetes cluster using Spin.

This setup opens up a world of possibilities for running efficient, secure, and portable applications in your Kubernetes environment. Feel free to explore more complex Spin applications and take advantage of the WASM ecosystem in your projects.

Remember to clean up your resources when you’re done experimenting to avoid unnecessary costs.

Taikun CloudWorks is a one-stop solution for your Kubernetes workloads that enables WASM. Try Taikun CloudWorks today. Book your free demo today, and let our team simplify, enhance, and streamline your infrastructure management.