Code to deploy all necessary tools for the monitoring workshop.
-
A kubernetes cluster to deploy all elements. You can use one of the following local clusters:
- Minikube
- Install MacOS Docker-Desktop and configure Docker-Desktop Local Kubernetes Cluster (easiest way for MacOs Users)
- Kind cluster
-
kubectl installed and pointing to local cluster context. Installation tutorial here.
-
Helm installed locally. Installation tutorial here.
To deploy stack use the following script:
./deploy_stack.sh
To delete all the stack use the following script:
./delete_stack.sh
Once deployed stack, web interfaces can be exposed via port-forward (mapping the pod application port to a local port), to access the service via localhost:port
.
Note: This is the easiest way to expose a service locally. Another options to expose services involve using ingresses, Nodeport/LoadBalancer services, etc. More information about accesing apps in a cluster here.
-
Expose Prometheus port.
# Get Prometheus Pod Name export POD_NAME=$(kubectl get pods --namespace default -l "app=prometheus,component=server" -o jsonpath="{.items[0].metadata.name}") # Expose Prometheus port (9090) via port-forward kubectl --namespace default port-forward $POD_NAME 9090
-
Go to http://localhost:9090 in a web browser to access prometheus UI.
-
Get grafana 'admin' password:
kubectl get secret --namespace default grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
-
Expose Grafana port.
# Get Grafana Pod Name export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}") # Expose Grafana port (3000) via port-forward kubectl --namespace default port-forward $POD_NAME 3000
-
Go to http://localhost:3000 in a web browser to access grafana UI. Access using 'admin' and password from step 1.
-
Expose angular-app port.
# Get angular-app Pod Name export POD_NAME=$(kubectl get pods --namespace default -l "app=angular-app" -o jsonpath="{.items[0].metadata.name}") # Expose angular-app port (80) via port-forward to local port 8080 kubectl --namespace default port-forward $POD_NAME 8080:80
-
Go to http://localhost:8080 in a web browser to access angular-app UI.