Coder Social home page Coder Social logo

ocopea / k8s-mongodsb Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 1.0 885 KB

Ocopea MongoDB Data Service Broker implementation running on Kubernetes

License: Other

Shell 0.50% Go 99.50%
dsb mongodb swagger docker-image kubernetes cloud-native cloud-native-microservices

k8s-mongodsb's Introduction

Ocopea Kubernetes mongodsb

Ocopea MongoDB Data Service Broker implementation for running MongoDB on Kubernetes

For more information about Ocopea for Kubernetes, visit the Ocopea Kubernetes repo.

This DSB supports a single plan named "standard" that runs the Mongo Docker image on Kubernetes and supports taking a service copy using mongodump and mongorestore.

How to build

  • clone the repo under GOPATH/src/ocopea/
  • run the buildImage.sh script

How to run

The easiest and the recommended way to run the mongodsb is by using the Ocopea Kubernetes deployer using the deploy-mongodsb command. for example for running the DSB on minikube into a namespace called "testing":

$ go run deployer.go deploy-mongodsb -namespace=testing -local-cluster-ip=$(minikube ip)

If you wish to run the container yourself using Kubernetes deployment all you have to do is make sure you supply Kubernetes credentials if required using both environment variables: K8S_USERNAME, K8S_PASSWORD.

Once running you can attach the DSB to an Ocopea site using the site config screen in the UI, or directly via the Ocopea API.

Tests

The project uses the go-swagger server code generator when building the Docker image. In order to build the project, debug or run the tests locally you'll have to run the swagger tool locally. The swagger generator version we use is 0.10.0. Find installation instructions here.

$ swagger generate server -f dsb-swagger.yaml -A k8s-mongodsb

To run the unit test:

$ cd restapi/impl
$ go test

To run end to end tests on a Kubernetes cluster use the Kubernetes tester project.

Contribution

k8s-mongodsb's People

Contributors

rpellows avatar shpandrak avatar vjtirumalai avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

rhodie27

k8s-mongodsb's Issues

Tests fail to run

#1 When trying to run the tests, I get the following:
$ go test
../../../../../src/ocopea/k8s-mongodsb/restapi/impl/copy_service_instance.go:10:2: cannot find package "ocopea/k8s-mongodsb/models" in any of:
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/vendor/ocopea/k8s-mongodsb/models (vendor tree)
/usr/local/go/src/ocopea/k8s-mongodsb/models (from $GOROOT)
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/models (from $GOPATH)
../../../../../src/ocopea/k8s-mongodsb/restapi/impl/copy_service_instance.go:12:2: cannot find package "ocopea/k8s-mongodsb/restapi/operations/dsb_web" in any of:
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/vendor/ocopea/k8s-mongodsb/restapi/operations/dsb_web (vendor tree)
/usr/local/go/src/ocopea/k8s-mongodsb/restapi/operations/dsb_web (from $GOROOT)
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/restapi/operations/dsb_web (from $GOPATH)

So I went to a path referenced by my GOPATH:
$ set | grep GO
GOPATH=/home/mmccarth/cndp
GOROOT=/usr/local/go

And retried and saw

$ cd /cndp/src/ocopea/k8s-mongodsb/restapi/impl/
mmccarth@ubuntu:
/cndp/src/ocopea/k8s-mongodsb/restapi/impl$ go test
copy_service_instance.go:10:2: cannot find package "ocopea/k8s-mongodsb/models" in any of:
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/vendor/ocopea/k8s-mongodsb/models (vendor tree)
/usr/local/go/src/ocopea/k8s-mongodsb/models (from $GOROOT)
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/models (from $GOPATH)
copy_service_instance.go:12:2: cannot find package "ocopea/k8s-mongodsb/restapi/operations/dsb_web" in any of:
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/vendor/ocopea/k8s-mongodsb/restapi/operations/dsb_web (vendor tree)
/usr/local/go/src/ocopea/k8s-mongodsb/restapi/operations/dsb_web (from $GOROOT)
/home/mmccarth/cndp/src/ocopea/k8s-mongodsb/restapi/operations/dsb_web (from $GOPATH)

This is based on a straight clone of this repo, without specifying a directory name for the repo.

Is there a restriction we need to document?

Godeps and vendor folder contents don't match.

Try deleting vendor folder and issue godep restore and see the command fail. But we can see the code build with the vendor contents. Quite clearly this means things have diverged. Need to fix this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.