Skip to content
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

Tutorial: Document using Redis trigger Spin App with spin-operator #40

Open
macolso opened this issue Feb 29, 2024 · 1 comment
Open

Comments

@macolso
Copy link
Contributor

macolso commented Feb 29, 2024

@calebschoepp shows using Redis trigger app with spin-operator here:

# Setup cluster in one terminal
k3d cluster create wasm-cluster --image ghcr.io/deislabs/containerd-wasm-shims/examples/k3d:v0.10.0 -p "8081:80@loadbalancer" --agents 2x
k apply -f spin-runtime-class.yaml
make install
make run

# Install Redis
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install redis bitnami/redis
export REDIS_PASSWORD=$(kubectl get secret --namespace default redis -o jsonpath="{.data.redis-password}" | base64 -d)
echo $REDIS_PASSWORD

# Build and push app (make sure to change password in redis address of spin.toml
cd apps/order-processor
spin build
spin registry push ttl.sh/your-unique-name:1h

# Apply spinapp (make sure to update image)
k apply -f config/samples/redis.yaml

# Publish message to redis channel
kubectl run --namespace default redis-client --restart='Never'  --env REDIS_PASSWORD=$REDIS_PASSWORD  --image docker.io/bitnami/redis:7.2.4-debian-11-r0 --command -- sleep infinity
kubectl exec --tty -i redis-client --namespace default -- bash
REDISCLI_AUTH="$REDIS_PASSWORD" redis-cli -h redis-master
PUBLISH orders "hello world"

# Then go look at the logs of the spin app to see that it received the Redis message

The steps provided can be written up as a new file in the documentation/content folder and join the queue for approval/review.

@vdice
Copy link
Contributor

vdice commented Apr 16, 2024

Relevant PR: #136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants