This project was generated with Kubectl
Kubernetes CLI in order to orchestrate two containers:
-
UserSearchApp: An angular app that searches for users provided by a mocked server (a Json Server web app)
-
JsonServer app: https://github.com/typicode/json-server: a mocked http server created with data generated on: https://next.json-generator.com/
Run docker build -t usersearchapp -f Dockerfile .
located on DOCKER\UserSearchApp
. It will generate the UserSearchApp docker image.
Run docker build -t jsonserver -f json-server-dockerfile .
located on DOCKER\JsonServer
. It will generate the JsonServer docker image.
Run docker run --name usersearch-app -dp 4200:80 usersearchapp
to instantiate the container.
Run docker run -d --rm -it --name jsonserver-container -p 3000:3000 jsonserver
to instantiate the container.
Test the application http://localhost:4200/ and then stop containers to proceed with the next steps. :)
Those images are being pulled from docker hub and refers to repository: docker.io/fredsena/usersearchapp
hint: you can pull your own images to docker hub and modify the the kubernetes deployment files
Run kubectl apply -f deploy-usersearchapp.yml
Run kubectl apply -f deploy-jsonserver.yml
Run kubectl apply -f deploy-usersearchapp-loadbalancer-service.yml
Run kubectl apply -f deploy-jsonserver-loadbalancer-service.yml
and then test the application http://localhost:4200/
Feel free to contact me to get further details.