For Ubuntu
- Clone the repo
- Install and configure microk8s
- Enable metallb
- Run the DB deployment
- Run the API deployment
git clone https://github.com/NelsonLopez69/API-Kubernetes.git
Install MicroK8s from the command line:
sudo snap install microk8s --classic
Add the user [yourUser] to the 'microk8s' group:
sudo usermod -a -G microk8s [yourUser]
sudo chown -f -R [yourUser] ~/.kube
Restart or update de microk8s group
newgrp microk8s
microk8s enable metallb:10.64.140.43-10.64.140.49
microk8s kubectl apply -f deployment-db.yml
microk8s kubectl apply -f deployment-api.yml
Now you can use the app. Try inserting 10.64.140.44 in your browser. Routes:
- /
- /health
Example: http://10.64.140.44/health
-
For a productive environment, it would ne nice to have a DNS so we can redirect de traffic to the public IP of the load balancer.
-
If the implementation takes place in an on premise environment an Horizontal Autoscaler could help improve the scalability. In the cloud there are tools that already help with it.
-
The deployment could be moved to the cloud for cost reduction and more disponibility.
-
Of course, in a productive environment we always have to test the product. So test implementation is necessary.
-
Would ne nice to have a pipeline that automates the building and deployment of the app so it don't need the manual push to docker-hub.