This generated README.md file loosely follows a popular template.
One paragraph of project description goes here.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Install go dep
go get -u github.com/golang/dep/cmd/dep
Need postgresql
installed locally or running inside docker container within contacts
database created.
You can change the name of database in dsn
parameter in server
app.
Table creation in this example is omitted as it will be done autmotically by gorm
.
make vendor
make
If this process finished with errors it's likely that docker doesn't allow to mount host directory in its container.
Therefore you are proposed to run su -c "setenforce 0"
command to fix this issue.
Please note that you should have the following ports opened on you local workstation: :8080 :9090 :8088 :8089
.
If they are busy - please change them via corresponding parameters of gateway
and server
binaries.
Run GRPC server:
./bin/server -dsn "host=localhost port=5432 user=postgres password=postgres sslmode=disable dbname=contacts"
Run GRPC gateway:
./bin/gateway
curl http://localhost:8080/atlas-contacts-app/v1/contacts -d '{"first_name": "Mike", "email_address": "[email protected]"}'
curl http://localhost:8080/atlas-contacts-app/v1/contacts -d '{"first_name": "Bob", "email_address": "[email protected]"}'
curl http://localhost:8080/atlas-contacts-app/v1/contacts?_filter='first_name=="Mike"'
Make sure nginx is deployed in you K8s. Otherwise you can deploy it using
make nginx-up
or by running
kubectl apply -f kube/nginx.yaml
If you launching atlas-contacts-app for the first time you need to create contacts
namespace for it in Kubernetes. This can be done by running
kubectl apply -f kube/ns.yaml
or
kubectl create ns contacts
To deploy atlas-contacts-app use
make up
or as alternative you can run
kubectl apply -f kube/kube.yaml
Try it out by executing following curl commangs:
curl https://minikube/atlas-contacts-app/v1/contacts -d '{"first_name": "Mike", "email_address": "[email protected]"}'
curl https://minikube/atlas-contacts-app/v1/contacts -d '{"first_name": "Bob", "email_address": "[email protected]"}'
curl https://minikube/atlas-contacts-app/v1/contacts?_filter='first_name=="Mike"'
Add additional notes about how to deploy this application. Maybe list some common pitfalls or debugging strategies.
Explain how to run the automated tests for this system.
Give an example
We use SemVer for versioning. For the versions available, see the tags on this repository.