NATS subjects act as event sources for gateway
apiVersion: v1
kind: ConfigMap
metadata:
name: nats-gateway-configmap
data:
foo: |-
url: nats://nats.argo-events:4222 # nats service
subject: foo # subject to listen to
Create gateway event sources
kubectl -n argo-events create -f https://github.com/argoproj/argo-events/blob/master/examples/gateways/nats-gateway-configmap.yaml
-
Create gateway
kubectl -n argo-events create -f https://github.com/argoproj/argo-events/blob/master/examples/gateways/nats.yaml
-
Check the status of the gateway
kubectl -n argo-events describe gateway nats-gateway
Make sure the gateway is in active state and all the event sources are in running state.
kubectl -n argo-events create -f https://github.com/argoproj/argo-events/blob/master/examples/sensors/nats.yaml
Publish message to subject foo
. You might find this useful https://github.com/nats-io/go-nats/tree/master/examples/nats-pub