prometheusによるkubernetesのクラスタ監視
Kubernetes Setup for Prometheus and Grafana
The following comment was executed referring to
kubectl apply \
--filename https://raw.githubusercontent.com/giantswarm/kubernetes-prometheus/master/manifests-all.yaml
[root@instance-1 ~]# kubectl get pods --namespace=monitoring
NAME READY STATUS RESTARTS AGE
alertmanager-78cbf8f796-crk8k 1/1 Running 0 42m
grafana-core-7f65444f84-2rg6q 1/1 Running 0 42m
grafana-import-dashboards-h4bp5 0/1 Completed 0 42m
kube-state-metrics-5f4c7f9d47-s2ndv 1/1 Running 0 42m
node-directory-size-metrics-57lm5 2/2 Running 0 42m
node-directory-size-metrics-5ncxd 2/2 Running 0 42m
prometheus-core-5c96ddd598-srk4l 1/1 Running 0 42m
prometheus-node-exporter-b8wfz 1/1 Running 0 42m
prometheus-node-exporter-rbfkh 1/1 Running 0 42m
[root@instance-1 ~]# kubectl get svc --namespace=monitoring
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
alertmanager NodePort 10.19.254.177 <none> 9093:30576/TCP 44m
grafana NodePort 10.19.244.179 <none> 3000:31362/TCP 44m
kube-state-metrics ClusterIP 10.19.241.158 <none> 8080/TCP 44m
prometheus NodePort 10.19.241.218 <none> 9090:30472/TCP 44m
prometheus-node-exporter ClusterIP None <none> 9100/TCP 44m
I did, but I can not see the GUI of prometheus and grafana. You will not be able to access this site. Please tell me how to use GUI.
If the necessary part is not enough, add it. Thank you.
Cluster setting method
[root@instance-1 ~]curl https://sdk.cloud.google.com | bash
[root@instance-1 ~]gcloud init
[root@instance-1 ~]sudo yum update kubectl
[root@instance-1 ~]cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
yum install -y kubectl
[root@instance-1 ~]gcloud container clusters create cluster-1 \
--num-nodes 1 \
--machine-type n1-standard-2
after that
[root@instance-1 ~]kubectl apply \
--filename https://raw.githubusercontent.com/giantswarm/kubernetes-prometheus/master/manifests-all.yaml
[root@instance-1 ~]# kubectl get pods --namespace=monitoring
[root@instance-1 ~]# kubectl get svc --namespace=monitoring
[root@instance-1 ~]#kubectl port-forward svc/prometheus 9090:9090 -n monitoring
[root@instance-1 ~]# kubectl get svc --namespace=monitoring← I tried setting without using this command, but it was useless.
Browser screen
I can not access this site Connection denied on localhost.
Please try the following
Check connection
Check proxy and firewall
ERR_CONNECTION_REFUSED