|
| 1 | +--- |
| 2 | +date: 2024-11-08 |
| 3 | +title: Five New Things in SpinKube |
| 4 | +linkTitle: Five New Things in SpinKube |
| 5 | +description: > |
| 6 | + Catching up on what's new in SpinKube |
| 7 | +author: The SpinKube Team ([@SpinKube](https://mastodon.social/@SpinKube)) |
| 8 | +resources: |
| 9 | + - src: "**.{png,jpg}" |
| 10 | + title: "Image #:counter" |
| 11 | +--- |
| 12 | + |
| 13 | +Since we publicly [released](/blog/2024/03/13/introducing-spinkube/) SpinKube in March we've been hard at work steadily making it better. Spin Operator [`v0.4.0`](https://github.com/spinkube/spin-operator/releases/tag/v0.4.0), ContainerD shim for Spin [`v0.17.0`](TODO), and `spin kube` plugin [`v0.3.0`](https://github.com/spinkube/spin-plugin-kube/releases/tag/v0.3.0) have all just been released. To celebrate that, here's five new things in SpinKube you should know about. |
| 14 | + |
| 15 | +## Selective Deployments |
| 16 | + |
| 17 | +SpinKube now supports selectively deploying a subset of a Spin apps components. Here's an example of what the YAML for a selectively deployed app might look like: |
| 18 | + |
| 19 | +```yaml |
| 20 | +apiVersion: core.spinkube.dev/v1alpha1 |
| 21 | +kind: SpinApp |
| 22 | +metadata: |
| 23 | + name: salutations |
| 24 | +spec: |
| 25 | + image: "ghcr.io/spinkube/spin-operator/salutations:20241105-223428-g4da3171" |
| 26 | + executor: containerd-shim-spin |
| 27 | + replicas: 1 |
| 28 | + components: |
| 29 | + - hello |
| 30 | +``` |
| 31 | +
|
| 32 | +We're really excited about this feature because it makes developing microservices easier. Locally keep your whole app together and develop it as a monolith. When you go to production selectively split your app based on the characteristics of each component. For example you might run one component on nodes with GPUs and another on nodes that are closer to the end user. |
| 33 | +
|
| 34 | +If you want to learn more about how to use selective deployments in SpinKube checkout this [tutorial](TODO). |
| 35 | +
|
| 36 | +## OpenTelemetry Support |
| 37 | +
|
| 38 | +Spin has [supported OpenTelemetry](https://www.fermyon.com/blog/spin-v24#experimental-support-for-opentelemetry-observability) for a while now, and it's now available in SpinKube. OpenTelemetry is an observability standard that makes understanding your applications running production much easier via traces and metrics. |
| 39 | +
|
| 40 | +To configure a `SpinApp` to send telemetry data to an OpenTelemetry collector you need to modify the `SpinAppExecutor`. |
| 41 | + |
| 42 | +```yaml |
| 43 | +apiVersion: core.spinkube.dev/v1alpha1 |
| 44 | +kind: SpinAppExecutor |
| 45 | +metadata: |
| 46 | + name: otel-shim-executor |
| 47 | +spec: |
| 48 | + createDeployment: true |
| 49 | + deploymentConfig: |
| 50 | + runtimeClassName: wasmtime-spin-v2 |
| 51 | + installDefaultCACerts: true |
| 52 | + otel: |
| 53 | + exporter_otlp_endpoint: http://otel-collector.default.svc.cluster.local:4318 |
| 54 | +``` |
| 55 | + |
| 56 | +Now any Spin apps using this executor will send telemetry to the collector at `otel-collector.default.svc.cluster.local:4318`. For full details on how to use OpenTelemetry in SpinKube checkout this [tutorial](/docs/topics/monitoring-your-app). |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +## MQTT Trigger Support |
| 61 | + |
| 62 | +The ContainerD Shim for Spin has added support for [MQTT triggers](https://github.com/spinkube/spin-trigger-mqtt). [MQTT](https://mqtt.org/) is a lightweight, publish-subscribe messaging protocol that enables devices to send and receive messages through a broker. It's used all over the place to enable Internet of Things (IoT) designs. |
| 63 | + |
| 64 | +If you want to learn more about how to use this new trigger checkout this [blog post](https://www.fermyon.com/blog/mqtt_trigger_spinkube) by Kate Goldenring. |
| 65 | + |
| 66 | +## Spintainer Executor |
| 67 | + |
| 68 | +In SpinKube there is a concept of an executor. An executor is defined by the `SpinAppExecutor` CRD and it configures how a `SpinApp` is executed. Typically you'll want to define an executor that uses the ContainerD shim for Spin. |
| 69 | + |
| 70 | +```yaml |
| 71 | +apiVersion: core.spinkube.dev/v1alpha1 |
| 72 | +kind: SpinAppExecutor |
| 73 | +metadata: |
| 74 | + name: containerd-shim-spin |
| 75 | +spec: |
| 76 | + createDeployment: true |
| 77 | + deploymentConfig: |
| 78 | + runtimeClassName: wasmtime-spin-v2 |
| 79 | + installDefaultCACerts: true |
| 80 | +``` |
| 81 | + |
| 82 | +However, it can also be useful to run your Spin application directly in a container. You might want to: |
| 83 | + |
| 84 | +- Use a specific version of Spin. |
| 85 | +- Use a custom trigger or plugin. |
| 86 | +- Workaround a lack of cluster permissions to install the shim. |
| 87 | + |
| 88 | +This is enabled by the new Spintainer executor. |
| 89 | + |
| 90 | +```yaml |
| 91 | +apiVersion: core.spinkube.dev/v1alpha1 |
| 92 | +kind: SpinAppExecutor |
| 93 | +metadata: |
| 94 | + name: spintainer |
| 95 | +spec: |
| 96 | + createDeployment: true |
| 97 | + deploymentConfig: |
| 98 | + installDefaultCACerts: true |
| 99 | + spinImage: ghcr.io/fermyon/spin:v3.0.0 |
| 100 | +``` |
| 101 | + |
| 102 | +Learn more about the Spintainer executor [here](/docs/misc/spintainer-executor). |
| 103 | + |
| 104 | +## Growing Stability |
| 105 | + |
| 106 | +SpinKube and its constituent sub-projects are all still in alpha as we leave room to iron out the kinks. However, SpinKube has made great leaps and strides in improving its stability and polish. In the number of releases we've cut for each sub-project we've squashed many bugs and sanded off plenty of rough corners. |
| 107 | + |
| 108 | +One more example of SpinKube's growing stability is the domain migration we've completed in Spin Operator. As of the `v0.4.0` release we have migrated the Spin Operator CRDs from the `spinoperator.dev` domain to `spinkube.dev`[^1]. This change was made to better align the Spin Operator with the overall SpinKube project. While this is a breaking change (upgrade steps can be found [here](/docs/misc/upgrading-to-v0.4.0/)) we're now in a better position to support this domain going forward. This is just one step towards SpinKube eventually moving out of alpha. |
| 109 | + |
| 110 | +## More To Come |
| 111 | + |
| 112 | +We hope this has gotten you as excited about SpinKube as we are. Stay tuned as we continue to make SpinKube better. If you'd like to get involved in the community we'd love to have you — check out our [community page](https://www.spinkube.dev/community/). |
| 113 | + |
| 114 | +[^1]: This was also a great opportunity to exercise the [SKIP](https://github.com/spinkube/skips/tree/main/proposals/004-crd-domains) (SpinKube Improvement Proposal) process. |
0 commit comments