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的主要内容,如果未能解决你的问题,请参考以下文章
helm 安装prometheus operator 并监控ingress
如何配置 kube-prometheus-stack helm 安装来抓取 Kubernetes 服务?
当我尝试安装 Prometheus helm chart 时,出现此错误
如何将抓取目标添加到使用 Kubernetes-Helm 安装的 Prometheus 服务器?
已安装 prometheus-community / helm-charts 但我无法获取“默认”命名空间的指标
Kubernetes集群监控解决方案kube-prometheus-stack(prometheus-operator)helm安装