Skip to content

Commit ce23e9b

Browse files
committed
Write another SpinKube blogpost
Signed-off-by: Caleb Schoepp <[email protected]>
1 parent dafc880 commit ce23e9b

File tree

3 files changed

+114
-0
lines changed

3 files changed

+114
-0
lines changed
90 KB
Loading
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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`](https://github.com/spinkube/containerd-shim-spin/releases/tag/v0.17.0), 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. Consider this simple example Spin application (named salutation in the [example repo](https://github.com/spinkube/spin-operator/tree/main/apps/salutations)) composed of two HTTP-triggered components: `hello` and `goodbye`. In the newly added `components` field you can select which components you would like to be a part of the deployment. 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 develop your application in one code base. Then, when you go to production, you can split your app based on the characteristics of each component. For example you run your front end closer to the end user while keeping your backend colocated with your database.
33+
34+
If you want to learn more about how to use selective deployments in SpinKube checkout this [tutorial](https://www.spinkube.dev/docs/topics/selective-deployments/).
35+
36+
## OpenTelemetry Support
37+
38+
Spin has had [OpenTelemetry](https://opentelemetry.io/) support 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` custom resource.
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+
![OpenTelemetry](/otel.png)
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 run. 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 executor we've dubbed 'Spintainer'.
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+
## Gaining Stability
105+
106+
SpinKube and its constituent sub-projects are all still in alpha as we iron out the kinks. However, SpinKube has made great leaps and bounds 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 down plenty of rough edges.
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.
156 KB
Loading

0 commit comments

Comments
 (0)