KubeWatch is a web application that can be used to monitor and visualize a Kubernetes cluster. Additionally, notifications are triggered if a pod goes down, which are displayed on the website and delivered to the right people via email or SMS. This allows an optimal usage for Kubernetes cluster administrators. KubeWatch is targeted to technical users who have some experience with Kubernetes. However, even non-technical users can find their way around our application and be able to use it easily.
Authors:
- Benjamin Plattner
- Jan Untersander
- Olivier Lischer
- Pascal Lehmann
- Petra Heeb
- src: this folder contains the entire application
- Documentation: this folder contains the documentation
- Organisation: this folder contains files to help us with our work
Prerequisites:
- Access to a running Kubernetes cluster via
kubectl
- Access to this Gitlab container registry
Run the following commands:
https://github.com/KubeWatch-Monitoring/KubeWatch.git
cd KubeWatch
kubectl apply -f src/kubernetes-manifests/Database
kubectl apply -f src/kubernetes-manifests/prometheus
kubectl apply -f deployment/kubernetes-manifests
Requirements: WebStorm, NodeJS and npm
- Clone repo
- Open project with Webstorm
- Run npm install
- Install Docker
- Install kubectl
- Install Minikube
- Hint: Use
uname -a
on Linux to find your architecture ;)
- Hint: Use
- Install the WebStorm Cloud Code Plugin
Command | Description |
---|---|
minikube start | creates/starts kubernetes cluster |
minikube stop | stops running kubernetes cluster |
minikube pause/unpause | pause/unpause kubernetes cluster |
docker system prune | delete all not currently used docker resources |
kubectl get all (-A) | show all kubernetes resources in default namespace (-A=all-namespaces) |
kubectl get nodes | show all kubernetes nodes (not shown in get all) |
- Before launching the application locally enter the following commands in your shell:
systemctl start docker.service
minikube start
It might be necessary to add your user to the docker group:
sudo usermod -aG docker $USER && newgrp docker
and restart your computer afterwards.
- Start the application with the desired Web Storm running configuration
- After development, make sure to stop Minikube and Docker
minikube stop
systemctl stop docker.service
- To install the SonarQube instance use the following docker command in you console:
docker run -d --name sonarqube -e
SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000
sonarqube:latest
- If the instance is running, you can login to http://localhost:9000 and use the default credentials. After the first login you need to change them.
login: admin
password: admin
- Create a new project with the name KubeWatch
- Go to the KubeWatch Project and choose local analysation.
- Generate a token (only first time) and safe this token somewhere you'll find it again (need it in the SonarScanner section again).
- Choose continue and then choose other and your OS.
- Download the SonarScanner zip for your system from the following source: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
- Extract the SonarScanner zip
- Add the bin folder in the extracted folder to the path variable (the location from the SonnarScanner folder doesn't matter).
- Change in the sonarscanner/conf folder the sonar-project.properties file with the following lines:
#----- Local
sonar.host.url=http://localhost:9000
sonar.login=<your-sonar-qube-token>
- Start SonarScanner (scan) with the command:
sh /<dir-path-to-sonnar-scanner-folder>/bin/sonar-scanner
(no error should be there)
- After the scan is finished, there will be a link to the actual report of the scan in the console output.
- If everything works fine you'll get an scan overview like this: \newline ![Scan]{../Documentation/src/resources/scan.png}
After using SonarQube stop the local server with the following command
docker stop sonarqube
To use the server again use the following command to restart the docker container:
docker restart sonarqube