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/depNeed 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
makeIf 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/gatewaycurl http://localhost:8080/atlas-contacts-app/v1/contacts -d '{"first_name": "Mike", "email_address": "mike@gmail.com"}'curl http://localhost:8080/atlas-contacts-app/v1/contacts -d '{"first_name": "Bob", "email_address": "john@gmail.com"}'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-upor by running
kubectl apply -f kube/nginx.yamlIf 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.yamlor
kubectl create ns contactsTo deploy atlas-contacts-app use
make upor as alternative you can run
kubectl apply -f kube/kube.yamlTry it out by executing following curl commangs:
curl https://minikube/atlas-contacts-app/v1/contacts -d '{"first_name": "Mike", "email_address": "mike@gmail.com"}'curl https://minikube/atlas-contacts-app/v1/contacts -d '{"first_name": "Bob", "email_address": "john@gmail.com"}'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.