如何在具有默认 istio beta 功能的 GKE 中安装带有 prometheus 的 Kiali Dashboard?

Posted

技术标签:

【中文标题】如何在具有默认 istio beta 功能的 GKE 中安装带有 prometheus 的 Kiali Dashboard?【英文标题】:How to Install Kiali Dashboard with prometheus in place in GKE with default istio beta feature? 【发布时间】:2020-12-01 23:51:38 【问题描述】:

我一直在尝试在 启用 Istio (beta) 的 GKE 集群上安装 Kiali,我正在按照官方文档使用 this link 安装 Kiali,但由于 GCP 更改了 Prometheus,因此 Prometheus 以某种方式损坏了Prometheus 的名称从 "Prometheus" 到 "promsd" 并且 Kiali 仪表板一直指向 http://prometheus.istio-system.com:9090 而不是 http://promsd.istio-system.com:9090。我应该如何在 default ISTIO ENABLED GKE Cluster 中解决这个问题?

【问题讨论】:

只是我的一个想法,我建议使用 istio on-prem 而不是插件,插件与 on-prem 版本相比是旧的,你可以install on-prem 版本istioctl 在 3 分钟内。然后安装 kiali 和 prometheus 插件,如 here 所述。使用 istio 1.6+,您可以使用 prometheus 来抓取指标,例如使用 prometheus helm,更多信息here。 知道了,谢谢,我去看看。 【参考方案1】:

您可以检查命名空间 istio-system 中的 kiali configmap(假设您使用默认命名空间进行 istio 安装)。 外部服务下面应该有一个 prometheus 标签。更改它并重新启动 kiali pod。

更新 20200821:我们的配置图(通过 istioctl 安装的 Istio (v1.5.6))

kind: ConfigMap
apiVersion: v1
metadata:
  name: kiali
  namespace: istio-system
  selfLink: /api/v1/namespaces/istio-system/configmaps/kiali
  uid: 660a2bfe-c71b-45ab-a438-ed61532dd8e3
  resourceVersion: '31024421'
  creationTimestamp: '2020-07-24T10:18:24Z'
  labels:
    app: kiali
    operator.istio.io/component: AddonComponents
    operator.istio.io/managed: Reconcile
    operator.istio.io/version: 1.5.6
    release: istio
  annotations:

data:
  config.yaml: |
    istio_component_namespaces:
      grafana: istio-system
      tracing: istio-system
      pilot: istio-system
      prometheus: istio-system
    istio_namespace: istio-system
    auth:
      strategy: login
    deployment:
      accessible_namespaces: ['**']
    login_token:
      signing_key: "xxxxxxxxxxxxxxxxxx"
    server:
      port: 20001
      web_root: /kiali
    external_services:
      istio:
        url_service_version: http://istio-pilot.istio-system:8080/version
      tracing:
        url: 
        in_cluster_url: http://tracing/jaeger
      grafana:
        url: 
        in_cluster_url: http://grafana:3000
      prometheus:
        url: http://prometheus.istio-system:9090

【讨论】:

Peter,我试过这种方法,但似乎在 kiali 的 Configmap 中没有设置 Prometheus URL。请在此处找到配置图--> notepad.pw/41oe8i2l. 你是如何安装 istio 的?你安装了哪个版本的 istio? 彼得,我按照以下说明进行操作-cloud.google.com/istio/docs/istio-on-gke/installing 因为我使用的是 GKE 1.16,所以 Istio 版本是 Istio 1.4.6-cloud.google.com/istio/docs/istio-on-gke/versions 也许您可以添加“外部服务”部分? (并重新启动 kiali)【参考方案2】:

为了使它工作,我必须在 istio-system 命名空间内编辑名为 kialiConfigMap。我在external_services 部分下添加了这一行:

prometheus:
  url: http://my-prometheus-kube-prometh-prometheus.default.svc.cluster.local:9090/

【讨论】:

我知道 - 这是旧帖子,现在您可能会找到解决方案。但我认为普罗米修斯没有安装,这就是它不存在的原因。使用 kubectl apply -f raw.githubusercontent.com/istio/istio/release-1.12/samples/… 安装它,然后重启 istio-egresgateway 和其他 pod

以上是关于如何在具有默认 istio beta 功能的 GKE 中安装带有 prometheus 的 Kiali Dashboard?的主要内容,如果未能解决你的问题,请参考以下文章

idou老师教你学istio 21:基于角色的访问控制

315 · Istio1.1 功能预告,真的假不了

基于GogRPC和Protobuf的微服务的Istio可观察性

十五分钟过下ISTIO

Istio是啥?

Istio如何同时实现Hytrix|Ribbon|Zuul|微服务安全的功能?:为微服务引入Istio服务网格(下)