### Make request to Spin App Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Makes an HTTP GET request to the locally forwarded port (8083) to interact with the deployed Spin application. It expects a 'Hello world from Spin!' response. ```bash curl localhost:8083/hello ``` -------------------------------- ### Install cert-manager and wait for webhook Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Applies the cert-manager YAML manifest to install the cert-manager component in Kubernetes. It then waits for the cert-manager-webhook deployment to become available, ensuring the certificate management is ready. ```bash kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.3/cert-manager.yaml kubectl wait --for=condition=available --timeout=300s deployment/cert-manager-webhook -n cert-manager ``` -------------------------------- ### Install Microk8s Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Installs Microk8s using snap, which is the recommended method on Ubuntu. This command installs Microk8s in classic confinement mode and starts the service. ```console $ sudo snap install microk8s --classic ``` -------------------------------- ### Install Spin Operator using Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Installs the Spin Operator into the Kubernetes cluster using Helm. It specifies the namespace, creates it if it doesn't exist, uses a specific chart version, and waits for the installation to complete. ```bash # Install Spin Operator with Helm helm install spin-operator \ --namespace spin-operator \ --create-namespace \ --version 0.6.1 \ --wait \ oci://ghcr.io/spinframework/charts/spin-operator ``` -------------------------------- ### Run spinkube.dev Locally Source: https://github.com/spinframework/spinkube-docs/blob/main/README.md Instructions to set up and run the spinkube.dev website locally. This involves installing Node.js dependencies, building the project, and starting the development server. The website will be accessible at http://localhost:1313. ```shell npm install npm run build npm start ``` -------------------------------- ### Apply Spin Runtime Class Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Applies the Spin Runtime Class Kubernetes resource definition. This resource is used for scheduling Spin applications onto nodes that have the containerd-shim-spin installed. ```bash kubectl apply -f https://github.com/spinframework/spin-operator/releases/download/v0.6.1/spin-operator.runtime-class.yaml ``` -------------------------------- ### Clone and Build Spin Key/Value App Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/using-a-key-value-store.md Clones the Spin Go SDK examples repository and navigates to the key-value example. It then builds the Spin application and pushes it to a container registry. ```bash git clone git@github.com:fermyon/spin-go-sdk.git cd examples/key-value export IMAGE_NAME=ttl.sh/$(uuidgen):1h spin build spin registry push ${IMAGE_NAME} ``` -------------------------------- ### List Installed Spin Plugins Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/spin-kube-plugin.md Lists all currently installed Spin plugins, showing their names, versions, and installation status. This is used to verify the successful installation of the 'kube' plugin. ```sh # List all installed Spin plugins spin plugins list --installed cloud 0.7.0 [installed] cloud-gpu 0.1.0 [installed] kube 0.1.1 [installed] pluginify 0.6.1 [installed] ``` -------------------------------- ### Build and Push Spin Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/rancher-desktop.md Installs project dependencies, builds the Spin application for deployment, and pushes the resulting container image to a specified registry. Replace `ttl.sh/hello-k3s:0.1.0` with your actual registry URL and tag. ```bash npm install spin build spin registry push ttl.sh/hello-k3s:0.1.0 ``` -------------------------------- ### SpinApp Resource Definition Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Example YAML definition for a SpinApp Kubernetes resource. It specifies the container image, replica count, and executor for the Spin application. ```yaml apiVersion: core.spinkube.dev/v1alpha1 kind: SpinApp metadata: name: simple-spinapp spec: image: "ghcr.io/spinkube/containerd-shim-spin/examples/spin-rust-hello:v0.13.0" replicas: 1 executor: containerd-shim-spin ``` -------------------------------- ### Deploy Sample Spin App Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Deploys a sample Spin application to the Kubernetes cluster by applying a YAML manifest. This is the first application to be run after setting up the Spin Operator. ```bash kubectl apply -f https://raw.githubusercontent.com/spinframework/spin-operator/main/config/samples/simple.yaml ``` -------------------------------- ### Test Spin App Endpoint Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Sends an HTTP GET request to the locally forwarded port to test the Spin application's `/hello` endpoint. This verifies that the application is running and responding correctly. ```console $ curl localhost:8080/hello ``` -------------------------------- ### Install Kube Plugin Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/spin-kube-plugin.md Installs the 'kube' plugin for the Spin CLI using the plugin manager. This command fetches and installs the latest version of the plugin. ```sh # Install the latest kube plugin spin plugins install kube ``` -------------------------------- ### Get Spin Kubernetes CLI Version Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/reference/cli-reference.md Displays the version information for the Spin Kubernetes CLI tool. This is a simple command used to verify the installed version. ```bash spin kube version ``` -------------------------------- ### Apply SpinApp Resource Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Applies a SpinApp Kubernetes resource definition from a remote URL to deploy a Spin application. This is the initial step to get a Spin app running in Microk8s. ```console $ microk8s kubectl apply -f https://raw.githubusercontent.com/spinframework/spin-operator/main/config/samples/simple.yaml ``` -------------------------------- ### Install Spin CLI Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Installs the latest version of the Spin CLI using a curl command. It's recommended to move the 'spin' executable to a directory in your system's PATH, such as /usr/local/bin. ```console $ curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash ``` ```console $ sudo mv spin /usr/local/bin/spin ``` -------------------------------- ### Install Valkey using Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/using-a-key-value-store.md Installs the Valkey key-value store in a Kubernetes cluster using the Bitnami Helm chart. This command creates a new namespace 'valkey' if it doesn't exist. ```bash helm install valkey --namespace valkey --create-namespace oci://registry-1.docker.io/bitnamicharts/valkey ``` -------------------------------- ### Update Spin Plugins Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/spin-kube-plugin.md Updates the list of available Spin plugins from the repository. This is a prerequisite before installing new plugins. ```sh # Update the list of latest Spin plugins spin plugins update Plugin information updated successfully ``` -------------------------------- ### Install Spin Operator with Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Installs the Spin Operator chart using Helm, specifying the release name, namespace, and version. The `--wait` flag ensures the command waits for resources to be ready. ```shell helm install spin-operator \ --namespace spin-operator \ --create-namespace \ --version 0.6.1 \ --wait \ oci://ghcr.io/spinframework/charts/spin-operator ``` -------------------------------- ### Create Spin Shim Executor Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Applies the Spin Shim Executor Kubernetes resource definition. This resource configures the necessary components for the Spin Operator to manage Spin applications. ```bash kubectl apply -f https://github.com/spinframework/spin-operator/releases/download/v0.6.1/spin-operator.shim-executor.yaml ``` -------------------------------- ### Install KEDA using Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/autoscaling/scaling-with-keda.md Steps to add the KEDA Helm repository, update repositories, and install the KEDA Helm chart into a dedicated namespace. ```console # Add the Helm repository helm repo add kedacore https://kedacore.github.io/charts # Update your Helm repositories helm repo update # Install the keda Helm chart into the keda namespace helm install keda kedacore/keda --namespace keda --create-namespace ``` -------------------------------- ### Port-forward to Spin App Service Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Forwards a local port (8083) to the Spin application's service (simple-spinapp) on port 80. This allows local access to the deployed application. ```bash kubectl port-forward svc/simple-spinapp 8083:80 ``` -------------------------------- ### Install ingress-nginx Controller Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/routing.md Installs or upgrades the ingress-nginx controller using Helm. This is a prerequisite for using Ingress resources to expose applications externally. It ensures the necessary components are deployed to manage ingress traffic. ```shell helm upgrade --install ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace ingress-nginx --create-namespace ``` -------------------------------- ### Add kwasm Helm repository Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Adds the kwasm Helm repository to your local Helm configuration. This command is necessary to fetch the kwasm-operator chart for installation. ```shell helm repo add kwasm http://kwasm.sh/kwasm-operator/ ``` -------------------------------- ### Install Spin Operator SpinAppExecutor Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Applies a SpinAppExecutor CRD that specifies the 'containerd-spin-shim' and links it to the previously created RuntimeClass. This configures the Spin Operator to run Spin Apps using the defined runtime. ```shell kubectl apply -f https://github.com/spinframework/spin-operator/releases/download/v0.6.1/spin-operator.shim-executor.yaml ``` -------------------------------- ### Get Operator Logs Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Fetches logs from the kwasm-operator pods, which is helpful for troubleshooting when the Spin application's pods get stuck in `ContainerCreating` status. This command targets pods labeled with `app.kubernetes.io/name=kwasm-operator` in the `kwasm` namespace. ```console $ microk8s kubectl logs -n kwasm -l app.kubernetes.io/name=kwasm-operator ``` -------------------------------- ### Local Preview Workflow Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/contrib/writing-documentation.md Steps to set up a local development environment to preview documentation changes. This involves forking the repository, cloning it, and following instructions in the README for building the site from source. ```Shell git clone https://github.com/spinframework/spinkube-docs.git # Follow README.md for build instructions ``` -------------------------------- ### Clone and Navigate to Sample App Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/connecting-to-a-sqlite-database.md Clones the enterprise-architectures-and-patterns repository and navigates into the http-crud-go-sqlite directory. This is the first step to obtain the sample application code for the tutorial. ```bash git clone git@github.com:fermyon/enterprise-architectures-and-patterns.git cd enterprise-architectures-and-patterns/http-crud-go-sqlite ``` -------------------------------- ### Create and Navigate Spin Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/rancher-desktop.md Creates a new Spin application using the http-js template and navigates into the application's directory. This is the initial step for developing a Spin application. ```bash spin new -t http-js hello-k3s --accept-defaults cd hello-k3s ``` -------------------------------- ### Create k3d cluster with containerd-shim-spin Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/quickstart.md Creates a k3d Kubernetes cluster using a specific image that includes the containerd-shim-spin prerequisite. This command sets up the cluster with a load balancer port and two agents. ```console k3d cluster create wasm-cluster \ --image ghcr.io/spinframework/containerd-shim-spin/k3d:v0.19.0 \ --port "8081:80@loadbalancer" \ --agents 2 ``` -------------------------------- ### Get Pod Status Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Retrieves the status of Kubernetes pods, useful for verifying if the deployed Spin application is running correctly. It lists pods and their readiness, status, restarts, and age. ```console $ microk8s kubectl get po ``` -------------------------------- ### Deploy Sample Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/routing.md Applies a sample application manifest to the Kubernetes cluster to demonstrate connectivity. This is a prerequisite for testing connection methods. ```shell kubectl apply -f https://raw.githubusercontent.com/spinkube/spin-operator/main/config/samples/simple.yaml ``` -------------------------------- ### Send HTTP Request to Spin App Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/azure-kubernetes-service.md Sends an HTTP GET request to the Spin App via the established port-forward. This verifies that the application is running and responding correctly. ```shell # Send an HTTP GET request to the Spin App curl -iX GET http://localhost:8080/hello HTTP/1.1 200 OK transfer-encoding: chunked date: Mon, 12 Feb 2024 12:23:52 GMT Hello world from Spin!% ``` -------------------------------- ### Create a new Spin App using spin CLI Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/packaging.md Creates a new Spin application using the `spin` CLI with a specified template. This command initializes the project structure, including the `spin.toml` manifest and the application's source code. ```shell # Create a new Spin App using the http-go template spin new --accept-defaults -t http-go hello-spin # Navigate into the hello-spin directory cd hello-spin ``` -------------------------------- ### Deploying a Spin Application to Kubernetes Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/blog/news/first-post/index.md This snippet demonstrates the command-line workflow for creating, building, pushing, scaffolding Kubernetes manifests, and deploying a Spin application to Kubernetes using the `spin` CLI. ```bash # Create a new Spin App spin new -t http-rust --accept-defaults spin-kube-app cd spin-kube-app # Build the Spin App spin build # Push the Spin App to an OCI registry export IMAGE_NAME=ttl.sh/spin-app-$(uuidgen):1h spin registry push $IMAGE_NAME # Scaffold Kubernetes manifests spin kube scaffold -f $IMAGE_NAME > app.yaml # Deploy to Kubernetes kubectl apply -f app.yaml ``` -------------------------------- ### Get NodeBalancer External IP Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/linode-kubernetes-engine.md Retrieves the details of the Kubernetes `Service` of type `LoadBalancer` to obtain the assigned external IP address of the provisioned NodeBalancer. This IP is used to access the application over the internet. ```console $ get service spin-rust-hello-nodebalancer NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE spin-rust-hello-nodebalancer LoadBalancer 10.128.235.253 172.234.210.123 80:31083/TCP 40s ``` -------------------------------- ### Install kwasm operator with Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Installs the kwasm-operator using Helm, specifying the namespace and the installer image. The kwasm operator is required to install WebAssembly shims on Kubernetes nodes. ```shell helm install \ kwasm-operator kwasm/kwasm-operator \ --namespace kwasm \ --create-namespace \ --set kwasmOperator.installerImage=ghcr.io/spinframework/containerd-shim-spin/node-installer:v0.19.0 ``` -------------------------------- ### Install Spin Operator Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Installs the Spin operator using Helm, which manages the lifecycle of Spin applications. This command ensures the operator is installed with version 0.6.1 and waits for it to become ready. ```console $ microk8s helm install spin-operator --namespace spin-operator --create-namespace --version 0.6.1 --wait oci://ghcr.io/spinframework/charts/spin-operator ``` -------------------------------- ### Install Cert-Manager using Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/azure-kubernetes-service.md Installs cert-manager using the Helm package manager. This includes adding the Jetstack repository, updating it, and installing the cert-manager chart into a dedicated namespace. ```helm helm repo add jetstack https://charts.jetstack.io helm repo update helm install cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.14.3 ``` -------------------------------- ### SpinKube Scaling Workflow Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/blog/news/first-post/index.md Illustrates the lifecycle phases of scaling a WebAssembly application on Kubernetes using SpinKube, from initial scheduling to receiving traffic. ```video spinkube-scaling.mp4 ``` -------------------------------- ### Install KWasm Operator Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Installs the KWasm operator, which is required for running WebAssembly workloads on Microk8s. This involves adding the KWasm Helm repository, installing the operator, and annotating nodes to enable KWasm. ```console $ microk8s helm repo add kwasm http://kwasm.sh/kwasm-operator/ ``` ```console $ microk8s helm install kwasm-operator kwasm/kwasm-operator --namespace kwasm --create-namespace --set kwasmOperator.installerImage=ghcr.io/spinframework/containerd-shim-spin/node-installer:v0.19.0 ``` ```console $ microk8s kubectl annotate node --all kwasm.sh/kwasm-node=true ``` -------------------------------- ### Package and Push Spin App to OCI Registry Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/packaging.md Packages the Spin application and pushes it as an OCI artifact to a specified registry. The `--build` flag is recommended to ensure the latest version of the app is built before pushing. ```shell # Package and Distribute the hello-spin app spin registry push --build ttl.sh/hello-spin:24h ``` -------------------------------- ### Spin App Go Implementation Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/packaging.md This Go code implements a simple HTTP handler for a Spin application. It uses the Spin SDK to register an HTTP handler that responds to incoming requests with a 'Hello Fermyon!' message. ```go package main import ( "fmt" "net/http" spinhttp "github.com/fermyon/spin/sdk/go/v2/http" ) func init() { spinhttp.Handle(func(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "text/plain") fmt.Fprintln(w, "Hello Fermyon!") }) } func main() {} ``` -------------------------------- ### Install Kwasm Operator and Configure Nodes Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/azure-kubernetes-service.md Installs the Kwasm operator and configures Kubernetes nodes to use the containerd shim for WebAssembly runtimes. This involves adding the Kwasm Helm repository, installing the operator, and annotating nodes. ```helm helm repo add kwasm http://kwasm.sh/kwasm-operator/ helm repo update helm install \ kwasm-operator kwasm/kwasm-operator \ --namespace kwasm \ --create-namespace \ --set kwasmOperator.installerImage=ghcr.io/spinframework/containerd-shim-spin/node-installer:v0.19.0 kubectl annotate node --all kwasm.sh/kwasm-node=true ``` -------------------------------- ### Helm install name in use error Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/contrib/troubleshooting.md Addresses the Helm error 'INSTALLATION FAILED: cannot re-use a name that is still in use' when attempting to install a chart with a name that already exists in the cluster. The recommended solution is to use `helm upgrade --install` for idempotent deployments. ```bash helm install \ kwasm-operator kwasm/kwasm-operator \ --namespace kwasm \ --create-namespace \ --set kwasmOperator.installerImage=ghcr.io/spinkube/containerd-shim-spin/node-installer:v0.14.0 Error: INSTALLATION FAILED: cannot re-use a name that is still in use helm upgrade --install \ kwasm-operator kwasm/kwasm-operator \ --namespace kwasm \ --create-namespace \ --set kwasmOperator.installerImage=ghcr.io/spinframework/containerd-shim-spin/node-installer:v0.19.0 ``` -------------------------------- ### Deploy Sample Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/blog/community/spinkube-kind-rd/index.md Deploys a sample SpinKube application to the cluster and sets up port forwarding to access it. This demonstrates running a basic application after SpinKube is deployed. ```shell # Deploy the application kubectl apply -f https://raw.githubusercontent.com/spinframework/spin-operator/main/config/samples/simple.yaml # Port forwarding kubectl port-forward svc/simple-spinapp 8083:80 # Open a webpage at http://localhost:8083/hello ``` -------------------------------- ### Install Spin Operator Chart Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/azure-kubernetes-service.md Installs the Spin Operator Helm chart with a specified version and namespace. The `--wait` flag ensures the command blocks until the release is in a ready state. ```shell helm install spin-operator \ --namespace spin-operator \ --create-namespace \ --version 0.6.1 \ --wait \ oci://ghcr.io/spinframework/charts/spin-operator ``` -------------------------------- ### Making Quick Documentation Changes Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/contrib/writing-documentation.md A shortcut for users to quickly propose changes to existing documentation pages directly from the website. This process guides users through forking the repository or updating an existing fork. ```APIDOC User Action: Click 'Edit this page' button (top right corner). System Prompt: - 'Fork this repository and propose changes' - 'Update your Fork' Outcome: Opens a pre-configured branch in a fork for editing. ``` -------------------------------- ### Deploy SpinApp Manifest Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/packaging.md Applies the generated `SpinApp` Kubernetes manifest file to the cluster using `kubectl`. This command initiates the deployment of the Spin application. ```shell # Deploy the spinapp.yaml using kubectl kubectl apply -f spinapp.yaml spinapp.core.spinkube.dev/hello-spin created ``` -------------------------------- ### Install cert-manager with kubectl Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Installs the cert-manager component using its official YAML manifest. Cert-manager is required for automatic TLS certificate provisioning and management, essential for the spin-operator's admission webhook system. ```shell kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.5/cert-manager.yaml ``` -------------------------------- ### spin kube help Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/reference/cli-reference.md Provides general help and information about the 'spin kube' command, which is used to manage applications running on Kubernetes. It lists available sub-commands and global flags. ```bash spin kube --help Manage apps running on Kubernetes Usage: kube [command] Available Commands: completion Generate the autocompletion script for the specified shell help Help about any command scaffold scaffold SpinApp manifest version Display version information Flags: -h, --help help for kube --kubeconfig string the path to the kubeconfig file -n, --namespace string the namespace scope -v, --version version for kube ``` -------------------------------- ### Install cert-manager for TLS Certificates Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/autoscaling/scaling-with-keda.md Installs cert-manager, a Kubernetes add-on for managing TLS certificates. This involves applying CRDs, adding the Jetstack Helm repository, and installing the cert-manager Helm chart into a dedicated namespace. ```kubectl kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.3/cert-manager.crds.yaml ``` ```helm helm repo add jetstack https://charts.jetstack.io helm repo update helm install \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --version v1.14.3 ``` -------------------------------- ### Test Deployed Spin Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/rancher-desktop.md Makes an HTTP request to the locally forwarded port to test the deployed Spin application. This verifies that the application is running correctly and returning the expected response. ```bash curl localhost:8083 ``` -------------------------------- ### Build KinD Binary from Source Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/blog/community/spinkube-kind-rd/index.md Compiles the KinD binary from its source repository. This process involves cloning the repository, navigating into the directory, building the executable using Go, and placing it in a system-accessible path. ```powershell # Clone the KinD repository git clone https://github.com/kubernetes-sigs/kind.git # Change to the KinD directory cd kind # Build the KinD binary $env:GOOS="windows"; go build -buildvcs=false -o kind.exe # Move the binary to a directory in your PATH mv kind.exe ${env:USERPROFILE}\bin # Check the KinD version kind version ``` ```bash # Clone the KinD repository git clone https://github.com/kubernetes-sigs/kind.git # Change to the KinD directory cd kind # Build the KinD binary go build -buildvcs=false -o kind # Move the binary to a directory in your PATH sudo mv kind /usr/local/bin # Check the KinD version kind version ``` -------------------------------- ### Install Spin Operator with Helm Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/misc/upgrading-to-v0.4.0.md Installs or upgrades the Spin Operator using Helm, specifying the version, namespace, and waiting for the deployment to complete. ```sh helm install spin-operator \ --namespace spin-operator \ --create-namespace \ --version 0.4.0 \ --wait \ oci://ghcr.io/spinkube/charts/spin-operator ``` -------------------------------- ### Enable Microk8s Add-ons Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/microk8s.md Enables necessary add-ons for Microk8s, specifically the cert-manager for certificate management. It's also important to check Microk8s status after installation. ```console $ microk8s enable cert-manager ``` -------------------------------- ### SpinApp Readiness HTTP GET Probe Configuration Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/reference/spin-app.md Describes a health check performed using an HTTP GET request for readiness probes, including the path and optional HTTP headers. ```APIDOC SpinApp.spec.checks.readiness.httpGet: description: HTTPGet describes a health check that should be performed using a GET request. fields: path: type: string description: Path is the path that should be used when calling the application for a health check, e.g /healthz. required: true httpHeaders: type: array items: type: object description: HTTPHeaders are headers that should be included in the health check request. required: false ``` -------------------------------- ### Install Spin Operator RuntimeClass Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/install/installing-with-helm.md Applies a RuntimeClass resource that configures the 'spin' handler, named 'wasmtime-spin-v2'. This allows Kubernetes to schedule Spin applications using the appropriate runtime. ```shell kubectl apply -f https://github.com/spinframework/spin-operator/releases/download/v0.6.1/spin-operator.runtime-class.yaml ``` -------------------------------- ### Get current items via HTTP Request Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/connecting-to-a-sqlite-database.md Retrieves the current list of items stored in the application's database. This is done by sending a GET request to the '/items' endpoint. ```bash $ curl -X GET http://localhost:8080/items ``` ```json [ { "id": "8b933c84-ee60-45a1-848d-428ad3259e2b", "name": "Full Self Driving (FSD)", "active": true }, { "id": "d660b9b2-0406-46d6-9efe-b40b4cca59fc", "name": "Sentry Mode", "active": true } ] ``` -------------------------------- ### Build and Push Spin Application Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/connecting-to-a-sqlite-database.md Builds the Spin application using the 'spin build' command and pushes the resulting container image to a registry (e.g., ttl.sh) using 'spin registry push'. An environment variable IMAGE_NAME is set to specify the image destination and tag. ```bash export IMAGE_NAME=ttl.sh/$(uuidgen):1h spin build spin registry push ${IMAGE_NAME} ``` -------------------------------- ### Establish Port Forwarding Source: https://github.com/spinframework/spinkube-docs/blob/main/content/en/docs/topics/using-a-key-value-store.md Sets up a connection from your local machine to the Kubernetes service, allowing direct HTTP requests to the application. This is a prerequisite for testing. ```bash kubectl port-forward services/kv-app 8080:80 Forwarding from 127.0.0.1:8080 -> 80 Forwarding from [::1]:8080 -> 80 ```