Requirement:
To monitor and get metrics of containerized environment managed by K8S, we are going to use Prometheus and Grafana. They can provide a visualized dashboard for K8S systems with useful charts.
We also update the Prometheus kind to use storageclass "oci" where TSDB data of Prometheus would be stored
Prometheus is a statefulset with replicas = 2 by default which provides high availability
Kubernetes version needs to be at least v1.14.0
You would need cluster-admin role to proceed
Installation Steps:
- git clone https://github.com/HenryXie1/Prometheus-Granafa-Ingress-OKE.git
- cd Prometheus-Granafa-Ingress-OKE
- kubectl create -f manifests/setup
- kubectl create -f manifests/
- Storage section of yaml to ask Prometheus to use block storage of OCI. In the future, we need to adopt CSI for storageclass of OKE "oci-bv".
- Typical output is
Test Access the Dashboards
$ kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
$ kubectl --namespace monitoring port-forward svc/grafana 3000
$ kubectl --namespace monitoring port-forward svc/alertmanager-main 9093
Integrate Ingress with Prometheus :
Uninstallation Steps:
- kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup