0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

kubernetesにkube-prometheusを構築する

Last updated at Posted at 2021-05-27

目的

kubernetesのclusterのmetric監視のためにkube-prometheusをkubernetes clusterにdeployする

Ref

Summary

上記Refのreadmeの通りやるだけ

環境

local-machine ----- internet ----- kubernetes on AWS

kube-prometheusをdeployする

bash
$ git clone https://github.com/prometheus-operator/kube-prometheus.git
$ cd kube-prometheus
$ kubectl create -f manifests/setup
$ until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
$ kubectl create -f manifests/

Grafanaにアクセスするport forwardを設定

bash
$ kubectl --namespace monitoring port-forward svc/grafana 3000

sshのport forwardを設定

bash
$ ssh -L 3000:localhost:3000 user@remote-machine

local machineからgrafanaにwebアクセス

localマシンからhttp://localhost:3000へアクセス

Prometheusにアクセスするport forwardを設定

bash
kubectl --namespace monitoring port-forward svc/prometheus-k8s 9090

sshのport forwardを設定

bash
$ ssh -L 9090:localhost:9090 user@remote-machine

local machineからprometheusにwebアクセス

localマシンからhttp://localhost:9090へアクセス

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?