This repository contains sample code for Customer promotions for an e-commerce web site. This shows how to create a REST API with subordinate resources.
These are the RESTful routes for promotions
Endpoint Methods Rule
---------------- ------- -----------------------------------------------------
index GET /
list_promotions GET /promotions
create_promotion POST /promotions
get_promotion GET /promotions/<promotion_id>
update_promotion PUT /promotions/<promotion_id>
delete_promotion DELETE /promotions/<promotion_id>
The test cases have 95% test coverage and can be run with nosetests
- Open in DevContainer
make login
Logs into ibmcloud (you must have your api key in your host ~/.bluemix/apikey.json to be mounted by dev container)
kubectl get all
See everything thats running
kubectl get svc
See services
ibmcloud ks workers --cluster nyu-devops
Get public ip of Kube worker node
Runs on WORKERNODE_PUBLIC_IP:31000
make build
kubectl apply -f deploy/postgresql.yaml
Deploys postgres db
kubectl create -f deploy/deployment.yaml
Deploys app using our promotions image, creates deployment, replicaset and pods
kubectl create -f deploy/service.yaml
Make accessible through service