Skip to content

Instantly share code, notes, and snippets.

@markito
Last active May 14, 2020 21:50
Show Gist options
  • Select an option

  • Save markito/be6933ac5d6bc4c2e710d98357a6c178 to your computer and use it in GitHub Desktop.

Select an option

Save markito/be6933ac5d6bc4c2e710d98357a6c178 to your computer and use it in GitHub Desktop.

Consuming SQS Events in OpenShift Serverless

Requirements

  • [GOPATH/ROOT setup]
  • [CLONE EVENTCONTRIB]
  • [Install KO]
  • [Install Serverless Operator]
  • [Create your SQS Queue]

Enable an event broker on the namespace

kubectl label namespace serverless-demo knative-eventing-injection=enabled

Create the AWS SQS Event Source

ko apply -f config/

Create Secrets (with AWS credentials)

kubectl -n serverless-demo create secret generic aws-credentials --from-file=credentials=/Users/markito/go/src/knative.dev/eventing-contrib/awssqs/samples/credentials.txt

Configure the Source to use your SQS Queue

Replace the value of queueUrl in awssqs-source.yaml with your Queue address. Something like https://sqs.us-west-2.amazonaws.com/123456789/knative-queue

queueURL: https://sqs.us-west-2.amazonaws.com/123456789/knative-queue

Create the application that will consume the Event

kn service create awssqs-event-display --image rhsummit2020/event-display --autoscale-window 6s --concurrency-target=1

Connect the Knative Broker with Event Consumer

kn trigger create aws-sqs-trigger --sink svc:awssqs-event-display --broker default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment