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

[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界面

 



转载于:https://www.cnblogs.com/Jt00/p/10718549.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值