首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用Rancher 1.5.1干净安装Kubernetes 1.5.0之后,如何访问Heapster的Grafana仪表板

在使用Rancher 1.5.1干净安装Kubernetes 1.5.0之后,如何访问Heapster的Grafana仪表板
EN

Stack Overflow用户
提问于 2017-03-16 07:18:17
回答 2查看 1.3K关注 0票数 1

我正在使用Rancher 1.5.1在AWS上部署测试Kubernetes集群。

我首先部署Rancher,并确保在主机注册后没有错误。然后,我使用Rancher目录中的" Kubernetes“条目安装Kubernetes。这似乎成功了,没有任何错误,我可以访问我的1.5.0 Kubernetes:

代码语言:javascript
复制
kubectl version
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.4", GitCommit:"7243c69eb523aa4377bce883e7c0dd76b84709a1", GitTreeState:"clean", BuildDate:"2017-03-08T02:50:34Z", GoVersion:"go1.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"5+", GitVersion:"v1.5.0-115+611cbb22703182", GitCommit:"611cbb22703182611863beda17bf9f3e90afa148", GitTreeState:"clean", BuildDate:"2017-01-13T18:03:00Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}

据我所知,带有InfluxDB和Grafana仪表板的Heapster现在是默认Kubernetes安装的一部分。所有与Heapster、InfluxDB和Grafana相关的pod在日志和状态中都没有显示错误,并且似乎运行成功:

代码语言:javascript
复制
kubectl -n kube-system describe rs heapster-3467702493
Name:       heapster-3467702493
Namespace:  kube-system
Image(s):   gcr.io/google_containers/heapster:v1.2.0
Selector:   k8s-app=heapster,pod-template-hash=3467702493,version=v6
Labels:     k8s-app=heapster
        pod-template-hash=3467702493
        version=v6
Replicas:   1 current / 1 desired
Pods Status:    1 Running / 0 Waiting / 0 Succeeded / 0 Failed
No volumes.
No events.

kubectl -n kube-system get pods
NAME                                    READY     STATUS             RESTARTS   AGE
default-http-backend-w9td0              1/1       Running            0          1d
heapster-3467702493-b28jm               1/1       Running            0          1d
influxdb-grafana-876329878-5qpsd        2/2       Running            0          1d
kube-dns-1208858260-zb7d9               4/4       Running            0          1d
kubernetes-dashboard-2492700511-8g3bj   1/1       Running            0          1d


kubectl -n kube-system describe pod influxdb-grafana-876329878-5qpsd
Name:       influxdb-grafana-876329878-5qpsd
Namespace:  kube-system
Node:       euir1a-dclus11.qiotec-internal.com/10.11.4.172
Start Time: Tue, 14 Mar 2017 14:48:05 +0100
Labels:     name=influx-grafana
        pod-template-hash=876329878
Status:     Running
IP:     10.42.35.83
Controllers:    ReplicaSet/influxdb-grafana-876329878
Containers:
  influxdb:
    Container ID:   docker://49ad7e2033d9116cc98d1e7c8cd6e20c305179d68804b762bb19592fefa59b3e
    Image:      docker.io/kubernetes/heapster_influxdb:v0.5
    Image ID:       docker-pullable://kubernetes/heapster_influxdb@sha256:24de37030e0da01c39b8863231b70f359e1fe6d4449505da03e2e7543bb068cb
    Port:
    State:      Running
      Started:      Tue, 14 Mar 2017 14:48:29 +0100
    Ready:      True
    Restart Count:  0
    Volume Mounts:
      /data from influxdb-storage (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from io-rancher-system-token-zgrrs (ro)
    Environment Variables:  <none>
  grafana:
    Container ID:   docker://bdb4e381f0cd05df0a2d1c7dffb52b3e6e724a27999e039c5399fef391fd6d32
    Image:      gcr.io/google_containers/heapster_grafana:v2.6.0-2
    Image ID:       docker-pullable://gcr.io/google_containers/heapster_grafana@sha256:208c98b77d4e18ad7759c0958bf87d467a3243bf75b76f1240a577002e9de277
    Port:
    State:      Running
      Started:      Tue, 14 Mar 2017 14:48:41 +0100
    Ready:      True
    Restart Count:  0
    Volume Mounts:
      /var from grafana-storage (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from io-rancher-system-token-zgrrs (ro)
    Environment Variables:
      INFLUXDB_SERVICE_URL:     http://monitoring-influxdb.kube-system.svc.cluster.local:8086
      GF_AUTH_BASIC_ENABLED:        false
      GF_AUTH_ANONYMOUS_ENABLED:    true
      GF_AUTH_ANONYMOUS_ORG_ROLE:   Admin
      GF_SERVER_ROOT_URL:       /
Conditions:
  Type      Status
  Initialized   True
  Ready     True
  PodScheduled  True
Volumes:
  influxdb-storage:
    Type:   EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  grafana-storage:
    Type:   EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  io-rancher-system-token-zgrrs:
    Type:   Secret (a volume populated by a Secret)
    SecretName: io-rancher-system-token-zgrrs
QoS Class:  BestEffort
Tolerations:    <none>
No events.

奇怪的是,我只能在这里看到,"Port:“条目是空的(而不是像我期望的那样有一些值)。

这是influxdb grafana-876329878-5qpsd日志的一部分。它似乎在端口3000上成功启动:

代码语言:javascript
复制
....
2017/03/14 13:48:42 [I] Migrator: exec migration id: create index UQE_dashboard_snapshot_delete_key - v5
2017/03/14 13:48:42 [I] Migrator: exec migration id: create index IDX_dashboard_snapshot_user_id - v5
2017/03/14 13:48:42 [I] Migrator: exec migration id: alter dashboard_snapshot to mediumtext v2
2017/03/14 13:48:42 [I] Migrator: exec migration id: create quota table v1
2017/03/14 13:48:42 [I] Migrator: exec migration id: create index UQE_quota_org_id_user_id_target - v1
2017/03/14 13:48:42 [I] Created default admin user: admin
2017/03/14 13:48:42 [I] Listen: http://0.0.0.0:3000
.Grafana is up and running.
Creating default influxdb datasource...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   272  100    37  100   235   2972  18877 --:--:-- --:--:-- --:--:-- 19583
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8
Set-Cookie: grafana_sess=3063bf504a9ec00a; Path=/; HttpOnly
Date: Tue, 14 Mar 2017 13:48:43 GMT
Content-Length: 37

{"id":1,"message":"Datasource added"}
Importing default dashboards...
...

服务也在运行:

代码语言:javascript
复制
kubectl -n kube-system get services
NAME                       CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
default-http-backend       10.43.159.75    <none>        80/TCP              1d
heapster                   10.43.77.135    <none>        80/TCP              1d
kube-dns                   10.43.0.10      <none>        53/UDP,53/TCP       1d
kubernetes-dashboard       10.43.202.63    <none>        9090/TCP            1d
monitoring-grafana         10.43.186.82    <none>        80/TCP              1d
monitoring-influxdb        10.43.61.17     <none>        8086/TCP,8083/TCP   1d

最后,我既不能通过Rancher负载均衡器映射到监控Grafana端口80 (我得到503 "Service not found“错误),也不能通过Kubernetes端口转发(连接超时)连接到grafana仪表板。

我的cluster-info输出:

代码语言:javascript
复制
kubectl cluster-info
Kubernetes master is running at https://my-rancher-host:8080/r/projects/1a5/kubernetes
KubeDNS is running at https://my-rancher-host:8080/r/projects/1a5/kubernetes/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://my-rancher-host:8080/r/projects/1a5/kubernetes/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard

与这个希普斯特视频中演示的不同:https://www.youtube.com/watch?v=xSMNR2fcoLs

谁能给出一个提示,哪里可能是错误的,以及我如何连接到Heapster的Grafana仪表板?

EN

回答 2

Stack Overflow用户

发布于 2017-03-21 17:36:17

似乎我必须在系统中添加一个正确的入口:

代码语言:javascript
复制
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: monitoring-ingress
  annotations:
    kubernetes.io/ingress.class: "nginx"
spec:
  rules:
  - host: monitoring.kube-system.mykubernetes.host
    http:
      paths:
      - path:
        backend:
          serviceName: monitoring-grafana
          servicePort: 80
票数 3
EN

Stack Overflow用户

发布于 2017-04-03 05:48:45

是的,几乎所有HTTP服务都应该有一个入口资源

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42822519

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档