kyosk Interview test project
The project tests creation of a HTTP service that handles crud operations for configs. This operations have to satisfy certain requirments
Following are the endpoints implemented:
| Name | Method | URL |
|---|---|---|
| List | GET |
api/configs |
| Create | POST |
api/configs |
| Get | GET |
api/configs/{name} |
| Update | PUT/PATCH |
api/configs/{name} |
| Delete | DELETE |
api/configs/{name} |
| Query | GET |
api/search?metadata.key=value |
##APP BULD AND RUN PROCESS > pre containerization
- Clone the repository
- Create the DB and table or auto create using schema.sql in resources folder
- Run app
- Open http://localhost:8080/kyosk//swagger-ui.html
To View apis documentation swagger-ui:2.6.1
##DB
##mysql
CREATE DATABASE
config/*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci / /!80016 DEFAULT ENCRYPTION='N' */;
CREATE TABLE
config(idbigint NOT NULL AUTO_INCREMENT,metadatajson DEFAULT NULL,namevarchar(255) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Change the credentils to match your db credentials in application.properties
##H2 Embedded DB
Uncomment the commented H2 Conneection properties application.properties
Note that H2 Does not have JSON_CONTAINS ability and thus search wont work . For this speecific api only MYSQL db will work.
-
Docker
-
Virtual box - To easily run Minikube with docker images in MacOS
-
Kubernetes Using (Minikube) -
brew install minikube minikube start — vm-driver=virtualbox
- Network gateways (Istio-ingress) - To expose our service Install & Setup -> https://istio.io/latest/docs/setup/getting-started/ Execute istio.yml Location -> ( kysokApp -> istio.yml)
kubectl apply -f istio.yml
- Create namespace for kyosk app
kubectl create namespace kyoskapp
- Create & injectistio gateway Excute kyoskapp-gateway.yml
kubectl apply -f myapp-gateway.yml kubectl label namespace kyoskapp istio-injection=enabled
- Create docker image
docker build -t kysokapp .
- Deploy Location -> (kyoskApp -> kyoskapp.yml)
kubectl apply -f kyoskapp.yml
- Forward port
kubectl port-forward services/kyoskapp 8080:8080 -n kysokapp


