参考

1. 使用 Prometheus

1.1 访问 Prometheus

1.1.1 端口转发

  • Prometheus 服务默认启用。
# option1:本地 localhost 端口转发
kubectl -n istio-system port-forward \
$(kubectl -n istio-system get pod -l app=prometheus -o jsonpath='{.items[0].metadata.name}') \
9090:9090 & # option2:kube-proxy 端口转发
kubectl proxy --address='100.64.198.131' --port=9090 --accept-hosts='^*$'
URL:http://100.64.198.131:9090/api/v1/namespaces/istio-system/services/http:prometheus:9090/proxy

1.1.2 开放 Prometheus 服务

1.1.2.1 定制 prometheus values.yaml
  • 同 Grafana 一致,通过定制 values.yaml,可以开放 Promethehs 的 Service 服务。
vim install/kubernetes/helm/istio/charts/prometheus/values.yaml

# "ingress" 资源的 "spec.rules.host.http.paths.path" 字段,即 "subpath"
contextPath: / ingress:
# 启用 "ingress"
enabled: enable
## Used to create an Ingress record.
hosts:
# 修改 "domain"
- prometheus.istio
annotations:
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
tls:
# Secrets must be manually created in the namespace.
# - secretName: prometheus-tls
# hosts:
# - prometheus.local

注意:定制 values.yaml 文件后,需要利用 helm template 重新生成部署清单。

1.1.2.2 自定义 prometheus ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
labels:
app: prometheus
chart: prometheus
heritage: Tiller
release: istio
name: prometheus
namespace: istio-system
spec:
rules:
- host: prometheus.istio
http:
paths:
- backend:
serviceName: prometheus
servicePort: 9090
path: /

1.2 Prometheus 配置文件

  • 配置文件保存在名为 prometheusConfigMap 对象中,获取如下:
kubectl get cm prometheus -n istio-system -o jsonpath='{.data.prometheus\.yml}'

最新文章

  1. iOS之initialize与load
  2. Netbeans导入Nutch1.2
  3. [UCSD白板题 ]Small Fibonacci Number
  4. JS判断客户端系统 让ipad iphone 等手持设备自动跳到手机版
  5. Kafka实战系列--Kafka API使用体验
  6. KVM 基础使用(一)
  7. css3 animation动画技巧
  8. zw版【转发·台湾nvp系列Delphi例程】HALCON FillUpShape1
  9. 【c++内存分布系列】虚基类表
  10. java 5 ReadWriteLock
  11. imageNamed 与 initWithContentsOfFile 区别
  12. 在Azure Container Service创建Kubernetes(k8s)群集运行ASP.NET Core跨平台应用程序
  13. 【译】python configparser中默认值的设定
  14. LeetCode--020--括号匹配
  15. python3练习-装饰器
  16. JDK8 特性详解
  17. 01炼数成金TensorFlow基本概念
  18. NGUI的数据绑定
  19. centos7 安装pip+python3.6
  20. html5调用手机本地摄像头和相册识别二维码详细实现过程

热门文章

  1. CSS小记录
  2. Django---Django安装数据库
  3. 手动部署:在eclipse导入web项目并更新包到本地部署
  4. .net mvc 多文件上传
  5. R ggplot学习笔记1
  6. stringstream使用小结
  7. 为什么文件无法用wps打开,甚至wps.exe本身都无法打开?
  8. prach 839滤波系数
  9. 树莓派中安装ubuntu及相关设置
  10. springboot整合PageHelper