helm 安装prometheus operator 并监控ingress

Posted jt00

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了helm 安装prometheus operator 并监控ingress相关的知识,希望对你有一定的参考价值。

1.helm安装

curl https://raw.githubusercontent.com/helm/helm/master/scripts/get > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
helm init --history-max 200
helm repo update
helm install stable/mysql
helm ls
kubectl -n kube-system create serviceaccount tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --upgrade
helm ls
kubectl --namespace kube-system patch deploy tiller-deploy -p ‘{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}‘
helm list
helm repo update

2.安装ingress

helm install stable/nginx-ingress --name my-release     --set controller.stats.enabled=true,controller.kind=DaemonSet,controller.daemonset.useHostPort=true,controller.publishService.enabled=true,controller.service.externalTrafficPolicy=Local,controller.service.type=NodePort,controller.stats.enabled=true,controller.metrics.enabled=true  helm安装最好用value文件更新要不然会抵消上一个版本的值。

3.安装prometheus operator

helm install stable/prometheus-operator

4.配置servicemonitors.monitoring.coreos.com

[[email protected] ~]# kubectl get servicemonitors.monitoring.coreos.com nginx-ingress-controller-metrics -oyaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
creationTimestamp: "2019-04-16T06:28:05Z"
generation: 3
labels:
app: nginx-ingress
release: my-prome
name: nginx-ingress-controller-metrics
namespace: default
resourceVersion: "251985"
selfLink: /apis/monitoring.coreos.com/v1/namespaces/default/servicemonitors/nginx-ingress-controller-metrics
uid: cb394d30-6010-11e9-b794-00163e004c35
spec:
endpoints:
- interval: 30s
port: metrics
namespaceSelector:
matchNames:
- default
selector:
matchLabels:
app: nginx-ingress
release: my-release

5.uI界面

技术图片

 



以上是关于helm 安装prometheus operator 并监控ingress的主要内容,如果未能解决你的问题,请参考以下文章

监控利器Prometheus——Prometheus简介与安装

监控利器Prometheus——Prometheus简介与安装

Prometheus 安装部署出图(使用grafana)

Prometheus安装部署(主体)

Prometheus安装

1.Prometheus快速入门,Prometheus+node_exporter安装