Install knative and WASMEdge on IBM Cloud
-
Create a cluster called
knawd-k8s
on IBM Cloud. For full instructions see https://cloud.ibm.com/docs/containers?topic=containers-getting-started -
Install the IBM Cloud Cli. The instructions please ensure you install the https://cloud.ibm.com/docs/cli?topic=cli-getting-started
-
Install the kubernetes service plugin https://cloud.ibm.com/docs/cli?topic=cli-install-devtools-manually#idt-install-kube
-
Once the cluster is complete login with the ibmcloud cli
ibm cloud login
-
Now configure the kubectl connection
ibmcloud ks cluster config -c knawd-k8s
-
We are going to follow a summary of the instructions for the knative website.
-
Install the custom resource definitions which are the objects such as
service
that you will use to deploy an app.kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.8.3/serving-crds.yaml
-
Then install the knative serving core
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.8.3/serving-core.yaml
-
Now we install the networking layer
kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.8.1/kourier.yaml
-
And Patch the knative space
kubectl patch configmap/config-network \ --namespace knative-serving \ --type merge \ --patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
-
Finally configure dns
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.8.3/serving-default-domain.yaml
-
Patch the knative service to allow for the crun runtime to be specified as an attribute in the service.
kubectl patch configmap/config-features -n knative-serving --type merge --patch '{"data":{"kubernetes.podspec-runtimeclassname":"enabled"}}'
-
Now run install the deployment project
git clone https://github.com/uirlis/wasi-crun-deployer cd wasi-crun-deployer/charts/wasi-crun-deployer helm install wasi-crun-deployer . --create-namespace --namespace knawd --set job.autoRestart=true
-
Finally run the tempate helloworld service.
git clone https://github.com/uirlis/helloworld-rust-wasi cd helloworld-rust-wasi kubectl apply -f service.yaml
-
Get the external IP of the kourier network
kubectl get svc kourier -n kourier-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE kourier LoadBalancer 172.21.191.127 159.122.80.147 80:32294/TCP,443:31406/TCP 44m
-
Visit the endpoint generated buy sslip.io - http://helloworld-rust-wasi.default.
.sslip.io/ curl http://helloworld-rust-wasi.default.159.122.80.147.sslip.io/ Hello Rust Sample v1