This repo is a summary for my recent work.
My work is to monitorer k8s metrics using prometheus and auto-scaling resources, especially the storage resources.
I have wasted so much time on setting up the environment and related tools. And this is a summary I made.
So:
-
This is a summary for Kubernetes setup and installing kube-prometheus quickly(Actually, in just one step).
-
Apart from that, this repo also includes storage auto-scaling quick setup yml.
-
In the future, I will include more summary in this repo.
Ubuntu18.04 is OK. No try on other system.
./k8s_setup.sh
After that, the K8s is set up. Run kubectl get po
to test that.
cd my-kube-prometheus/manifests
kubectl apply -f .
kuebctl apply -f .
cd ../..
cd custom-metrics-adapter/deploy/manifests/
k apply -f .
cd ../../..
k apply -f my-kube-prometheus/manifests/
Note: Some resources may not create correctly, just because of the wrong setup sequence. So running the upper command twice will solve problem.
And how to access the kube-prometheus? The following:
Prometheus, Grafana和Alertmanager dashboards可以通过kubectl port-forward快速访问: (1) Prometheus
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090
然后可以通过 http://localhost:9090访问Prometheus。
(2) Grafana
kubectl --namespace monitoring port-forward svc/grafana 3000
然后可以通过 http://localhost:3000访问Grafana,默认的用户名和密码是 admin:admin
(3) Alert Manager
kubectl --namespace monitoring port-forward svc/alertmanager-main 9093
然后可以通过 http://localhost:9093来访问。
./lvm/csi_setup.sh
So, csi-related resources are set up.
The directory example
show an example of creating pv dynamicly.