Kuberenets Web UI (Dashboard) missing graphs

2019-07-20 18:57发布

I have installed Docker v1.13 and Kubernetes with Kubeadm v1.6. Then I installed Web UI (Dashboard). I can access it but its missing CPU/Memory usage graphs... Why could this happen?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-07-20 19:18

For me the usage graphs worked once I installed heapster as an addon. Heapster requires an influxdb as data sink for the metric storage. Luckily you can deploy all those easily in k8s with the following definitions in the kube-system namespace (tested it with k8s 1.4.6):

heapster-service.yml:

apiVersion: v1
kind: Service
metadata:
  labels:
    task: monitoring
    # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
    # If you are NOT using this as an addon, you should comment out this line.
    kubernetes.io/cluster-service: 'true'
    kubernetes.io/name: Heapster
  name: heapster
  namespace: kube-system
spec:
  ports:
  - port: 80
    targetPort: 8082
  selector:
    k8s-app: heapster

heapster-deployment.yml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: heapster
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        task: monitoring
        k8s-app: heapster
        version: v6
    spec:
      containers:
      - name: heapster
        image: kubernetes/heapster:canary
        imagePullPolicy: Always
        command:
        - /heapster
        - --source=kubernetes:https://kubernetes.default
        - --sink=influxdb:http://monitoring-influxdb:8086

influxdb-service.yml:

apiVersion: v1
kind: Service
metadata:
  labels:
    task: monitoring
    # For use as a Cluster add-on (https://github.com/kubernetes/kubernetes/tree/master/cluster/addons)
    # If you are NOT using this as an addon, you should comment out this line.
    kubernetes.io/cluster-service: 'true'
    kubernetes.io/name: monitoring-influxdb
  name: monitoring-influxdb
  namespace: kube-system
spec:
  # type: NodePort
  ports:
  - name: api 
    port: 8086
    targetPort: 8086
  selector:
    k8s-app: influxdb

infuxdb-deployment.yml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: monitoring-influxdb
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        task: monitoring
        k8s-app: influxdb
    spec:
      volumes:
      - name: influxdb-storage
        emptyDir: {}
      containers:
      - name: influxdb
        image: kubernetes/heapster_influxdb:v0.6
        resources:
          requests:
            memory: "256M"
            cpu: "0.1"
          limits:
            memory: "1G"
            cpu: "1.0"
        volumeMounts:
        - mountPath: /data
          name: influxdb-storage
查看更多
登录 后发表回答