After deploying both the Spin app and Redis, expose the Spin app locally using kubectl port-forward svc/redis-spinapp 3000:80. You can then interact with Redis using curl commands by passing the desired key in the x-key header.
Place a key-value pair
Use a PUT request with --data-binary to store a value.
Retrieve a value
Perform a standard GET request (default) to fetch the value associated with the key.
Delete a value
Use a DELETE request to remove the key.
# 1. Port-forward the service
kubectl port-forward svc/redis-spinapp 3000:80
# 2. In a new terminal, perform operations:
# Place a key-value pair
curl --request PUT --data-binary "Hello, world\!" -H 'x-key: helloKey' localhost:3000
# Retrieve a value
curl -H 'x-key: helloKey' localhost:3000
# Delete a value
curl --request DELETE -H 'x-key: helloKey' localhost:3000