Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/raymasson/go-mongodb-minikube-kubectl-helm

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/raymasson/go-mongodb-minikube-kubectl-helm

  • v0.0.0-20180323135329-e20fd85c2df4
  • Source
  • Go
  • Socket score

Version published
Created
Source

Deployment of a persisted mongodb replica set and a golang api in kubernetes

An example project demonstrating the deployment of a mongodb replica set and a Golang API in Kubernetes. Minikube is used to run k8s locally. kubectl is used to deploy the mongodb replica set. helm is used to deploy the golang API.

1 - Deploy the mongodb replica set

Follow the mongodb readme

2 - Deploy the golang API

Follow the api readme

3 - Test the API

First of all, let's get the API service URL out of minikube.

$ minikube service  person-api --url

Use the outputted URL in your internet browser (e.g.: http://192.168.99.100:31518). You should see Welcome to the person API! displayed

Get persons out of the person API. The expected output is a HTTP status 200 OK and a [] of persons.

$ curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://192.168.99.100:31518/persons

Now, let's insert our first person. The expected output is a HTTP status 201 Created.

$ curl -i -H "Accept: application/json" -H "Content-Type: application/json" -d '{"first_name":"ray", "last_name":"masson"}'  -X POST http://192.168.99.100:31518/persons

Run again the first curl command. The output should now be something like [{"id":"5ab505c424e8f10001f047b5","first_name":"ray","last_name":"masson"}]

FAQs

Package last updated on 23 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc