knative-source-mongodb

module
v0.0.0-...-25e0b32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0

README

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
    

Directories

Path Synopsis
cmd
Package config is a placeholder that allows us to pull in config files via go mod vendor.
Package config is a placeholder that allows us to pull in config files via go mod vendor.
pkg
apis/sources/v1alpha1
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:deepcopy-gen=package +groupName=sources.google.com
Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:deepcopy-gen=package +groupName=sources.google.com
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/sources/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/sources/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL