-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Valkey trigger application tutorial #136
Add Valkey trigger application tutorial #136
Conversation
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went through the article one and added a couple of suggestions. However, I didn't run the sample so far (conference wifi isn't the best TBH)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes as I went through the tutorial today. Would be great to get a version of this in soon!
|
||
```bash | ||
my-redis-master:6379> PUBLISH channel-one message-one | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lastly, shall we show the redis app pod logs printing receipt of the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @vdice
I made it all the way to the end of this document on my machine, but I get integer 0
when I publish the message on channel-one. There are no error messages; everything seems to be running, and the prompts are in a ready state.
I feel like I am missing something; should I be writing any Rust code after the // Implement me
comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tpmccallum, that's all good on the publishing side. What I meant here was to then show the logs from the consuming side, eg the Spin app that is subscribing to messages published to the channel-one
channel. For example, here are the logs for a redis SpinAapp when I published "HELLO" to the messages
channel:
$ kubectl logs -f -l core.spinoperator.dev/app-name=redis-spinapp
Active Channels on redis://:DTatx2DV4p@redis-master.redis.svc.cluster.local:6379:
messages: [redis-rust]
HELLO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, nice one @vdice!
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
@@ -0,0 +1,219 @@ | |||
--- | |||
title: Publish-Subscribe With Redis | |||
description: Learn how to create a Spin App that responds to messages on pub-sub Redis channels and runs in Kubernetes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should update this to use Valkey rather than Redis now that Redis is no-longer open source software.
```toml | ||
# --snip -- | ||
[application.trigger.redis] | ||
address = "redis://:password@my-redis-master.default.svc.cluster.local:6379" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't ship this as an example - this should use secrets via the Spin App manifest rather than pushing them in plaintext to an OCI registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With spinkube/containerd-shim-spin#78 merged, I think we can treat the address as a variable as well.
Signed-off-by: tpmccallum <tim.mccallum@fermyon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updating step by step:
- change Redis to Valkey where possible (some template prompts and manifest configuration can't change unless the SDK is changed or a new SDK is written specifically for Valkey)
- Install Valkey (instead of Redis via Bitnami) - see the #TODO inline
- Use secrets instead of password in plain text in config or commands
closing as stale. |
Add an end-to-end Valkey trigger example.