3
votes

I have a new Kubernetes cluster on AWS that was built using the kube-up script from v1.1.1. I can successfully access the Elasticsearch/Kibana/KubeUI/Grafana endpoints, but cannot access Heapster/KubeDNS/InfluxDB from my machine, through the API proxy. I have seen some ancillary issues related to this on the K8S project, but no clear identification as to what's going on. From what I can gather, everything is running fine so I'm not sure what is wrong here? I'd really like to use the embedded monitoring of Grafana/Influx/Heapster but the Grafana dashboard is just blank with an series error.

Kubernetes version

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.1", GitCommit:"92635e23dfafb2ddc828c8ac6c03c7a7205a84d8", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"1", GitVersion:"v1.1.1", GitCommit:"92635e23dfafb2ddc828c8ac6c03c7a7205a84d8", GitTreeState:"clean"}

Cluster-info

$ kubectl cluster-info
Kubernetes master is running at https://MASTER_IP
Elasticsearch is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/elasticsearch-logging
Heapster is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/heapster
Kibana is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/kibana-logging
KubeDNS is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/kube-dns
KubeUI is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/kube-ui
Grafana is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana
InfluxDB is running at https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb

Accessing influxDB from the API proxy URL above

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {},
  "status": "Failure",
  "message": "no endpoints available for service \"monitoring-influxdb\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

Endpoint details from the Host

$ curl http://localhost:8080/api/v1/namespaces/kube-system/endpoints/monitoring-influxdb
{
  "kind": "Endpoints",
  "apiVersion": "v1",
  "metadata": {
    "name": "monitoring-influxdb",
    "namespace": "kube-system",
    "selfLink": "/api/v1/namespaces/kube-system/endpoints/monitoring-influxdb",
    "uid": "2f75b259-8a22-11e5-b248-028ff74b9b1b",
    "resourceVersion": "131",
    "creationTimestamp": "2015-11-13T16:18:33Z",
    "labels": {
      "kubernetes.io/cluster-service": "true",
      "kubernetes.io/name": "InfluxDB"
    }
  },
  "subsets": [
    {
      "addresses": [
        {
          "ip": "10.244.1.4",
          "targetRef": {
            "kind": "Pod",
            "namespace": "kube-system",
            "name": "monitoring-influxdb-grafana-v2-n6jx1",
            "uid": "2f31ed90-8a22-11e5-b248-028ff74b9b1b",
            "resourceVersion": "127"
          }
        }
      ],
      "ports": [
        {
          "name": "http",
          "port": 8083,
          "protocol": "TCP"
        },
        {
          "name": "api",
          "port": 8086,
          "protocol": "TCP"
        }
      ]
    }
  ]
}

Querying the service from the Host

$ curl -IL 10.244.1.4:8083
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Length: 13751
Content-Type: text/html; charset=utf-8
Last-Modified: Fri, 14 Nov 2014 21:55:58 GMT
Date: Tue, 17 Nov 2015 21:31:48 GMT

Monitoring-InfluxDB Service

$ curl http://localhost:8080/api/v1/namespaces/kube-system/services/monitoring-influxdb
{
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "monitoring-influxdb",
    "namespace": "kube-system",
    "selfLink": "/api/v1/namespaces/kube-system/services/monitoring-influxdb",
    "uid": "2f715831-8a22-11e5-b248-028ff74b9b1b",
    "resourceVersion": "60",
    "creationTimestamp": "2015-11-13T16:18:33Z",
    "labels": {
      "kubernetes.io/cluster-service": "true",
      "kubernetes.io/name": "InfluxDB"
    }
  },
  "spec": {
    "ports": [
      {
        "name": "http",
        "protocol": "TCP",
        "port": 8083,
        "targetPort": 8083
      },
      {
        "name": "api",
        "protocol": "TCP",
        "port": 8086,
        "targetPort": 8086
      }
    ],
    "selector": {
      "k8s-app": "influxGrafana"
    },
    "clusterIP": "10.0.35.241",
    "type": "ClusterIP",
    "sessionAffinity": "None"
  },
  "status": {
    "loadBalancer": {}
  }
}

Pod Details

$ kubectl describe pod --namespace=kube-system monitoring-influxdb-grafana-v2-n6jx
Name:               monitoring-influxdb-grafana-v2-n6jx1
Namespace:          kube-system
Image(s):           gcr.io/google_containers/heapster_influxdb:v0.4,beta.gcr.io/google_containers/heapster_grafana:v2.1.1
Node:               ip-172-20-0-44.us-west-2.compute.internal/172.20.0.44
Start Time:         Fri, 13 Nov 2015 08:21:36 -0800
Labels:             k8s-app=influxGrafana,kubernetes.io/cluster-service=true,version=v2
Status:             Running
Reason:
Message:
IP:             10.244.1.4
Replication Controllers:    monitoring-influxdb-grafana-v2 (1/1 replicas created)
Containers:
  influxdb:
    Container ID:   docker://564724318ca81d33d6079978d24f78b3c6ff8eb08a9023c845e250eeb888aafd
    Image:      gcr.io/google_containers/heapster_influxdb:v0.4
    Image ID:       docker://8b8118c488e431cc43e7ff9060968d88402cc6c38a6390c4221352403aa7ac1b
    QoS Tier:
      memory:   Guaranteed
      cpu:  Guaranteed
    Limits:
      memory:   200Mi
      cpu:  100m
    Requests:
      memory:       200Mi
      cpu:      100m
    State:      Running
      Started:      Fri, 13 Nov 2015 08:22:55 -0800
    Ready:      True
    Restart Count:  0
    Environment Variables:
  grafana:
    Container ID:   docker://518dea564a0ee014345e9006da6113fb6584ff1ebc6d0cc9609a608abc995f45
    Image:      beta.gcr.io/google_containers/heapster_grafana:v2.1.1
    Image ID:       docker://200e77ba156a5a86879e49667b97afe84dca42b5bb67ab1e06217e6a19c5a6a6
    QoS Tier:
      cpu:  Guaranteed
      memory:   Guaranteed
    Limits:
      memory:   100Mi
      cpu:  100m
    Requests:
      cpu:      100m
      memory:       100Mi
    State:      Running
      Started:      Fri, 13 Nov 2015 08:22:35 -0800
    Ready:      True
    Restart Count:  0
    Environment Variables:
      INFLUXDB_SERVICE_URL:     http://monitoring-influxdb:8086
      GF_AUTH_BASIC_ENABLED:        false
      GF_AUTH_ANONYMOUS_ENABLED:    true
      GF_AUTH_ANONYMOUS_ORG_ROLE:   Admin
      GF_SERVER_ROOT_URL:       /api/v1/proxy/namespaces/kube-system/services/monitoring-grafana/
Conditions:
  Type      Status
  Ready     True
Volumes:
  influxdb-persistent-storage:
    Type:   EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  grafana-persistent-storage:
    Type:   EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:
  default-token-bo89c:
    Type:   Secret (a secret that should populate this volume)
    SecretName: default-token-bo89c
No events.
1
Could you run kubectl decribe pod --namespace=kube-system monitoring-influxdb-grafana-v2-n6jx to see the status of the pod (whether it's ready or not)?Yu-Ju Hong
You said that "Grafana dashboard is just blank with an series error." What is the error and how it looks like? I think by default, the dashboard shows nothing and you have to manually add graphs yourself. This will change in the next kubernetes release.Yu-Ju Hong
If I load Grafana, and navigate to the Kubernetes Cluster Dashboard, there are many graphs but they are all empty. They all have errors saying InfluxDB Error: Couldn't find series: <type/metric>. I was also trying to access the InfluxDB UI, and that is was throws the 503 above, and what I'm interested in.smugcloud
8083 is the port for the admin UI for InfluxDB. 8086 is the API port. Assuming this is InfluxDB 0.9, a better health check for InfluxDB is curl -i http://10.244.1.4:8086/ping, which should return the version number in the header.beckettsean
@beckettsean If i run your command, I get X-Influxdb-Version: InfluxDB v0.8.9 (git: 664b73e) (leveldb: 1.15). What does this tell us?smugcloud

1 Answers

7
votes

Unfortunately those URLs are incomplete. Influx's ports are named, so you need to say which port you want.

https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:http or https://MASTER_IP/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb:api

There's a bug open to give better errors for this.