zoukankan      html  css  js  c++  java
  • istio部署-istio prometheus

    参考

    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}'
    
  • 相关阅读:
    最短路
    shell中奇怪的s文件状态判断
    诡异的PHPUnit安装
    安装ulipad的一点建议
    有关商业计算机的一点历史——引子
    Axure 不同菜单 页面不同位置
    Axure 选择不同内容, 跳转页面中加载不同内容
    Axure 侧边工具悬浮且位置固定
    Axure 多选和取消多选
    晒晒最近所做项目的总结
  • 原文地址:https://www.cnblogs.com/netonline/p/12219168.html
Copyright © 2011-2022 走看看