Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

googleinterns/knative-source-mongodb

Repository files navigation

This is not an officially supported Google product.

GoDoc Go Report Card LICENSE Build Status

Knative Source - MongoDB

The MongoDb Event Source adds support of MongoDB resources to Knative Eventing.

Prerequisites

  1. Install Knative Eventing in your Kubernetes Cluster.

  2. Either:

    • Install MongoDb on your Kubernetes Cluster and create a Replica Set. Instructions available here.

    • Create a MongoDb Cluster on Atlas, through GCP for example. Link available here.

  3. Install ko and then execute:

    ko apply -f ./config
    

Usage

  1. Create a secret containing the data needed to access your MongoDb service. For example:

     apiVersion: v1
     kind: Secret
     metadata:
         name: my-mongo-secret
         namespace: default
     stringData:
         URI: mongodb://USERNAME:PASSWORD@IP:PORT/USERDB

    The URI is the connection string of your Mongo Database or Cluster. USERDB is the database your user account pertains to (can be admin).

  2. Create the MongoDbSource custom object: provide the required database field, provide the collection field (optional), and reference the secret just created as well as the destination sink. For example, with a Knative Service as a sink:

     apiVersion: sources.google.com/v1alpha1
     kind: MongoDbSource
     metadata:
         name: mongodb-example-source
         namespace: default
     spec:
         database: db1
         collection: coll1  # optional
         secret:
             name: my-mongo-secret
     sink:
         ref:
           apiVersion: serving.knative.dev/v1
           kind: Service
           name: event-display

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published