码迷,mamicode.com
首页 > 其他好文 > 详细

helm 安装prometheus operator 并监控ingress

时间:2019-04-16 17:45:53      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:bind   meta   metrics   end   point   pts   yaml   release   creation   

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

[root@iZrj969udf3fibvyz4dlieZ ~]# 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

标签:bind   meta   metrics   end   point   pts   yaml   release   creation   

原文地址:https://www.cnblogs.com/Jt00/p/10718549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!