Skip to content

Commit

Permalink
Merge pull request #54 from spinkube/spin-plugin-kube
Browse files Browse the repository at this point in the history
rename to `spin kube`
  • Loading branch information
bacongobbler committed Mar 6, 2024
2 parents 170d1a1 + 28aef0a commit ce3e837
Show file tree
Hide file tree
Showing 17 changed files with 108 additions and 116 deletions.
30 changes: 13 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ The [Containerd Shim Spin repository](https://github.com/spinkube/containerd-shi

The [Runtime Class Manager, also known as the Containerd Shim Lifecycle Operator](https://github.com/spinkube/runtime-class-manager), is designed to automate and manage the lifecycle of containerd shims in a Kubernetes environment. This includes tasks like installation, update, removal, and configuration of shims, reducing manual errors and improving reliability in managing WebAssembly (Wasm) workloads and other containerd extensions.

## Spin Kubernetes (k8s) Plugin
## Spin plugin for Kubernetes (spin kube)

The [Spin k8s plugin](https://github.com/spinkube/spin-plugin-k8s) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.
The [Spin plugin for Kubernetes](https://github.com/spinkube/spin-plugin-kube) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.

## Spin Operator

Expand All @@ -30,26 +30,26 @@ $ npm start

Watching for changes in documentation/{assets,content,layouts,package.json}
Watching for config changes in documentation/hugo.toml, documentation/go.mod
Start building sites …
Start building sites …
hugo v0.122.0-b9a03bd59d5f71a529acb3e33f995e0ef332b3aa+extended darwin/amd64 BuildDate=2024-01-26T15:54:24Z VendorInfo=brew


| NO | EN
| NO | EN
-------------------+----+------
Pages | 95 | 114
Paginator pages | 0 | 0
Non-page files | 1 | 3
Static files | 30 | 30
Processed images | 2 | 9
Aliases | 1 | 3
Sitemaps | 2 | 1
Cleaned | 0 | 0
Pages | 95 | 114
Paginator pages | 0 | 0
Non-page files | 1 | 3
Static files | 30 | 30
Processed images | 2 | 9
Aliases | 1 | 3
Sitemaps | 2 | 1
Cleaned | 0 | 0

Built in 1121 ms
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Web Server is available at //localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
```
Expand All @@ -60,7 +60,3 @@ View the website at [localhost:1313](http://localhost:1313/docs/overview/)
---
![Screenshot 2024-02-19 at 14 51 24](https://github.com/spinkube/documentation/assets/9831342/98fef78c-3770-42c4-be1c-88d7282130e7)
4 changes: 2 additions & 2 deletions content/en/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ The [Runtime Class Manager, also known as the Containerd Shim Lifecycle Operator
<br />
<br />

<u>**Spin Kubernetes (k8s) Plugin**</u>
<u>**Spin Plugin for Kubernetes**</u>

The [Spin k8s plugin](https://github.com/spinkube/spin-plugin-k8s) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.
The [Spin plugin for Kubernetes](https://github.com/spinkube/spin-plugin-kube) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.

<br />
<br />
Expand Down
4 changes: 2 additions & 2 deletions content/en/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ The [Runtime Class Manager, also known as the Containerd Shim Lifecycle Operator
<br />
<br />

<u>**Spin Kubernetes (k8s) Plugin**</u>
<u>**Spin Plugin for Kubernetes**</u>

The [Spin k8s plugin](https://github.com/spinkube/spin-plugin-k8s) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.
The [Spin plugin for Kubernetes](https://github.com/spinkube/spin-plugin-kube) is designed to enhance Kubernetes by enabling the execution of Wasm modules directly within a Kubernetes cluster. This plugin works by integrating with containerd shims, allowing Kubernetes to manage and run Wasm workloads in a way similar to traditional container workloads.

<br />
<br />
Expand Down
7 changes: 3 additions & 4 deletions content/en/docs/contribution-guidelines/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags: [Contributing]
If you've just spotted something you'd like to change while using the docs, Docsy has a shortcut for you:

1. Click **Edit this page** in the top right-hand corner of the page.
2. If you don't already have an up-to-date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up-to-date version of the project to edit.
2. If you don't already have an up-to-date fork of the project repo, you are prompted to get one - click **Fork this repository and propose changes** or **Update your Fork** to get an up-to-date version of the project to edit.

### Previewing your changes locally

Expand Down Expand Up @@ -40,7 +40,6 @@ For information about contributing to the Spin Operator project visit the [runti

For information about contributing to the Spin Operator project visit the [Spin Operator Contributing](../spin-operator/contributing/_index.md) page.

## Contributing to the Spin k8s Plugin project

For information about contributing to the Spin k8s Plugin project visit the [spin-plugin-k8s GitHub repository](https://github.com/spinkube/spin-plugin-k8s).
## Contributing to the spin kube Plugin project

For information about contributing to the spin kube Plugin project visit the [spin-plugin-kube GitHub repository](https://github.com/spinkube/spin-plugin-kube).
5 changes: 2 additions & 3 deletions content/en/docs/glossary/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Helm is a package manager for Kubernetes that simplifies the deployment and mana

In the context of Kubernetes, an image refers to a packaged and executable software artifact that contains all the necessary dependencies and configurations to run a specific application or service. It is typically built from a Dockerfile and stored in a container registry. Images are used as the basis for creating containers, which are lightweight and isolated runtime environments. Kubernetes pulls the required images from the registry and deploys them onto the cluster's worker nodes. Images play a crucial role in ensuring consistent and reproducible deployments of applications in Kubernetes.

## Kubernetes (K8s)
## Kubernetes

Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It provides a framework for running and coordinating containers across a cluster of nodes. Kubernetes abstracts the underlying infrastructure and provides features like load balancing, service discovery, and self-healing capabilities. It enables organizations to efficiently manage and scale their applications, ensuring high availability and resilience.

Expand Down Expand Up @@ -108,5 +108,4 @@ However, the `SpinApp` manifest currently supports configuring options such as:

## Spin Operator

Spin Operator is a Kubernetes (K8s) operator in charge of handling the lifecycle of Spin applications based on their SpinApp resources.

Spin Operator is a Kubernetes operator in charge of handling the lifecycle of Spin applications based on their SpinApp resources.
3 changes: 1 addition & 2 deletions content/en/docs/spin-operator/prerequisites/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ Please install the latest version of [Spin](https://developer.fermyon.com/spin/v

## Bombardier

Installing [Bombardier](https://pkg.go.dev/github.com/codesenberg/bombardier) is **not** required to use Spin Operator. Bombardier is used in tutorials like [Scaling Spinapps on k8s With HPA](./scaling-spinapp-on-k8s-with-hpa.md) to generate load to test autoscaling.
Installing [Bombardier](https://pkg.go.dev/github.com/codesenberg/bombardier) is **not** required to use Spin Operator. Bombardier is used in tutorials like [Scaling Spin App With Horizontal Pod Autoscaling](./scaling-with-hpa.md) to generate load to test autoscaling.

## Azure CLI

Installing [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) is **not** required to use Spin Operator. Azure CLI is used to provision Azure Kubernetes Service (AKS) and necessary Azure resources as part of the [Running Spin Operator on Azure Kubernetes Service](./running-on-azure-kubernetes-service.md) tutorial.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ weight: 100
---


By using variables, you can alter application behavior without recompiling your SpinApp. When running in Kubernetes (k8s), you can either provide constant values for variables, or reference them from Kubernetes primitives such as `ConfigMaps` and `Secrets`. This tutorial guides your through the process of assigning variables to your `SpinApp`.
By using variables, you can alter application behavior without recompiling your SpinApp. When running in Kubernetes, you can either provide constant values for variables, or reference them from Kubernetes primitives such as `ConfigMaps` and `Secrets`. This tutorial guides your through the process of assigning variables to your `SpinApp`.

## Prerequisites

Expand Down
18 changes: 9 additions & 9 deletions content/en/docs/spin-operator/tutorials/package-and-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For this tutorial in particular, you need
- [TinyGo]({{< ref "prerequisites#tinygo" >}}) - for building the Spin app
- [kubectl]({{< ref "prerequisites#kubectl" >}}) - the Kubernetes CLI
- [spin]({{< ref "prerequisites#spin-cli" >}}) - the Spin CLI
- [spin plugin k8s](/docs/spin-plugin-k8s/installation) - the Kubernetes plugin for `spin`
- [spin kube](/docs/spin-plugin-kube/installation) - the Kubernetes plugin for `spin`

## Creating a new Spin App

Expand Down Expand Up @@ -80,21 +80,21 @@ spin registry push --build ttl.sh/hello-spin:24h
## Deploying Spin Apps

To deploy Spin Apps to a Kubernetes cluster which has Spin Operator running, you use the `k8s` plugin for `spin`. Use the `spin k8s deploy` command as shown here to deploy the `hello-spin` app to your Kubernetes cluster:
To deploy Spin Apps to a Kubernetes cluster which has Spin Operator running, you use the `kube` plugin for `spin`. Use the `spin kube deploy` command as shown here to deploy the `hello-spin` app to your Kubernetes cluster:

```shell
# Deploy the hello-spin app to your Kubernetes Cluster
spin k8s deploy --from ttl.sh/hello-spin:24h
spin kube deploy --from ttl.sh/hello-spin:24h

spinapp.core.spinoperator.dev/hello-spin created
```

## Scaffolding Spin Apps

In the previous section, you deployed the `hello-spin` app using the `spin k8s deploy` command. Although this is handy, you may want to inspect, or alter the Kubernetes manifests before applying them. You use the `spin k8s scaffold` command to generate Kubernetes manifests:
In the previous section, you deployed the `hello-spin` app using the `spin kube deploy` command. Although this is handy, you may want to inspect, or alter the Kubernetes manifests before applying them. You use the `spin kube scaffold` command to generate Kubernetes manifests:

```shell
spin k8s scaffold --from ttl.sh/hello-spin:24h
spin kube scaffold --from ttl.sh/hello-spin:24h
apiVersion: core.spinoperator.dev/v1
kind: SpinApp
metadata:
Expand All @@ -108,7 +108,7 @@ By default, the command will print all Kubernetes menifests to `STDOUT`. Alterna

```shell
# Scaffold manifests to spinapp.yaml
spin k8s scaffold --from ttl.sh/hello-spin:24h \
spin kube scaffold --from ttl.sh/hello-spin:24h \
--out spinapp.yaml

# Print contents of spinapp.yaml
Expand Down Expand Up @@ -161,11 +161,11 @@ kubectl create secret docker-registry ghcr \
secret/ghcr created
```

Scaffold the necessary `SpinApp` Custom Resource (CR) using `spin k8s scaffold`:
Scaffold the necessary `SpinApp` Custom Resource (CR) using `spin kube scaffold`:

```shell
# Scaffold the SpinApp manifest
spin k8s scaffold --from ghcr.io/$GH_USER/hello-spin:0.0.1 \
spin kube scaffold --from ghcr.io/$GH_USER/hello-spin:0.0.1 \
--out spinapp.yaml
```

Expand All @@ -186,7 +186,7 @@ spec:

> `$GH_USER` should match the actual username provided while running through the previous sections of this article
Finally, you can deploy the app using `kubectl apply`:
Finally, you can deploy the app using `kubectl apply`:

```shell
# Deploy the spinapp.yaml using kubectl
Expand Down
12 changes: 6 additions & 6 deletions content/en/docs/spin-operator/tutorials/scaling-with-hpa.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ tags: [Tutorials]
weight: 100
---

Horizontal scaling, in the k8s sense, means deploying more pods to meet demand (different from vertical scaling whereby more memory and CPU resources are assigned to already running pods). In this tutorial, we configure [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) to dynamically scale the instance count of our SpinApps to meet the demand.
Horizontal scaling, in the Kubernetes sense, means deploying more pods to meet demand (different from vertical scaling whereby more memory and CPU resources are assigned to already running pods). In this tutorial, we configure [HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/) to dynamically scale the instance count of our SpinApps to meet the demand.

## Prerequisites

> We use k3d to run a k8s cluster locally as part of this tutorial, but you can follow these steps to configure HPA autoscaling on your desired k8s environment.
> We use k3d to run a Kubernetes cluster locally as part of this tutorial, but you can follow these steps to configure HPA autoscaling on your desired Kubernetes environment.
Please see the following sections in the [Prerequisites]({{< ref "prerequisites" >}}) page and fulfil those prerequisite requirements before continuing:

Expand All @@ -31,9 +31,9 @@ git clone https://github.com/spinkube/spin-operator.git
cd spin-operator
```

## Setting Up k8s Cluster
## Setting Up Kubernetes Cluster

Run the following command to create a k8s k3d cluster that has [the containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims) pre-requisites installed: If you have a k3d cluster already, please feel free to use it:
Run the following command to create a Kubernetes cluster that has [the containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims) pre-requisites installed: If you have a Kubernetes cluster already, please feel free to use it:

```console
k3d cluster create wasm-cluster-scale --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.11.0 -p "8081:80@loadbalancer" --agents 2
Expand All @@ -56,7 +56,7 @@ Great, now you have Spin Operator up and running on your cluster. This means you

## Set Up Ingress

Use the following command to set up ingress on your k8s cluster. This ensures traffic can reach your SpinApp once we’ve created it in future steps:
Use the following command to set up ingress on your Kubernetes cluster. This ensures traffic can reach your SpinApp once we’ve created it in future steps:

```console
# Setup ingress following this tutorial https://k3d.io/v5.4.6/usage/exposing_services/
Expand Down Expand Up @@ -146,7 +146,7 @@ spec:

</aside>

The k8s documentation is the place to learn more about [limits and requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) and [other metrics supported by HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#container-resource-metrics).
The Kubernetes documentation is the place to learn more about [limits and requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits) and [other metrics supported by HPA](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#container-resource-metrics).

Let’s deploy the SpinApp and the HPA instance onto our cluster with the following command:

Expand Down
13 changes: 6 additions & 7 deletions content/en/docs/spin-operator/tutorials/scaling-with-keda.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ weight: 100

## Prerequisites

> We use k3d to run a k8s cluster locally as part of this tutorial, but you can follow these steps to configure KEDA autoscaling on your desired k8s environment.
> We use k3d to run a Kubernetes cluster locally as part of this tutorial, but you can follow these steps to configure KEDA autoscaling on your desired Kubernetes environment.
Please see the following sections in the [Prerequisites]({{< ref "prerequisites" >}}) page and fulfil those prerequisite requirements before continuing:

Expand All @@ -36,9 +36,9 @@ Change into the Spin Operator directory:
cd spin-operator
```

## Setting Up k8s Cluster
## Setting Up Kubernetes Cluster

Run the following command to create a k8s k3d cluster that has [the containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims) pre-requisites installed: If you have a k3d cluster already, please feel free to use it:
Run the following command to create a Kubernetes cluster that has [the containerd-wasm-shims](https://github.com/deislabs/containerd-wasm-shims) pre-requisites installed: If you have a Kubernetes cluster already, please feel free to use it:

```console
k3d cluster create wasm-cluster-scale --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.11.0 -p "8081:80@loadbalancer" --agents 2
Expand All @@ -61,7 +61,7 @@ Great, now you have Spin Operator up and running on your cluster. This means you

## Setting Up Ingress

Use the following command to set up ingress on your k8s cluster. This ensures traffic can reach your SpinApp once we’ve created it in future steps:
Use the following command to set up ingress on your Kubernetes cluster. This ensures traffic can reach your SpinApp once we’ve created it in future steps:

```console
# Setup ingress following this tutorial https://k3d.io/v5.4.6/usage/exposing_services/
Expand Down Expand Up @@ -90,7 +90,7 @@ Hit enter to create the ingress resource.

## Setting Up KEDA

Use the following command to setup KEDA on your k8s cluster using Helm. Different deployment methods are described at [Deploying KEDA on keda.sh](https://keda.sh/docs/2.13/deploy/):
Use the following command to setup KEDA on your Kubernetes cluster using Helm. Different deployment methods are described at [Deploying KEDA on keda.sh](https://keda.sh/docs/2.13/deploy/):

```console
# Add the Helm repository
Expand Down Expand Up @@ -162,7 +162,7 @@ spec:
value: "50"
```

> The k8s documentation is the place to learn more about [limits and requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits). Consult the KEDA documentation to learn more about [ScaledObject](https://keda.sh/docs/2.13/concepts/scaling-deployments/#scaledobject-spec) and [KEDA's built-in scalers](https://keda.sh/docs/2.13/scalers/).
> The Kubernetes documentation is the place to learn more about [limits and requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits). Consult the KEDA documentation to learn more about [ScaledObject](https://keda.sh/docs/2.13/concepts/scaling-deployments/#scaledobject-spec) and [KEDA's built-in scalers](https://keda.sh/docs/2.13/scalers/).
Let’s deploy the SpinApp and the KEDA ScaledObject instance onto our cluster with the following command:

Expand Down Expand Up @@ -223,4 +223,3 @@ Events:
Normal ScalingReplicaSet 39s deployment-controller Scaled up replica set hpa-spinapp-76db5d7f9f to 16 from 8
Normal ScalingReplicaSet 24s deployment-controller Scaled up replica set hpa-spinapp-76db5d7f9f to 20 from 16
```

0 comments on commit ce3e837

Please sign in to comment.