- Open the repo in a terminal
- Start minikube:
minikube start
- Configure kubectl:
minikube kubectl -- get po -A
- Install the app:
helm install hello-rust ./hello-rust/
- Install dashboard addon:
minikube addons enable metrics-server
- Launch dashboard:
minikube dashboard
- Execute testing script:
./script-test.sh
You can check in 2 or 3 minutes how the replicaset start to scale up, adding more pods.
To scale down, just stop terminal with script execution and in 2 or 3 minutes, the replicaset is going to delete some pods.
This could be checked in the Replica Sets section in the dashboard.
For testing the rust application in your local machine, please install Rust.
- Debug the app:
cargo run
- Check the result in your browser, entering the url: 0.0.0.0:8000
For testing the docker image generation, please install Docker.
- Generate local image:
docker build -t test-1 .
In case you get stucked with the kubernetes app resources in the cluster, you can allways remove them and start fresh: helm uninstall hello-rust
The CI process consists of 3 jobs:
-
Build and Test: In a more complex scenario a common build process would require to run a linter, the builder and the unit testing in adition to other tasks (integration tests, for example). This step mimics this barebone just to ilustrate how it could be if the app wasn't a 'Hello World'.
-
SonarCloud: It is a complete scan of the app according to the specifications of the Sonar company. the app dashboard review could be checked here
-
Build and Publish Docker Image: Step required to generate a docker image and publish it into Dokcer Hub after previous quality steps were succesful.