$ kubectl apply -f namespace.yml
google cloud - Role-Based Access Control
$ kubectl create clusterrolebinding cluster-admin-binding \
--clusterrole cluster-admin \
--user $(gcloud config get-value account)
$ kubectl create serviceaccount monitor --namespace monitoring
$ kubectl apply -f https://github.com/seo-3/prometheus-gke/role.yml
$ kubectl create clusterrolebinding monitor --clusterrole=all-reader --serviceaccount=monitoring:monitor
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/prometheus-configmap.yml
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/alertmanager-configmap.yaml
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/volume.yml
set grafana admin user password.
$ kubectl create secret generic gf-security-admin-password --from-literal=password=<YOUR_ADMIN_PASSWORD> -n=monitoring
Include grafana and prometheus in deployment.
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/prometheus-deployment.yml
set node-exporter.
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/daemonset.yaml
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/prometheus-service.yml
$ kubectl -n monitoring apply -f https://github.com/seo-3/prometheus-gke/ingress.yml