utilitywarehouse / kube-summary-exporter

Exporter for the Kubernetes Summary API
MIT License
32 stars 7 forks source link

If the k8s deployment mode is used, node indicators cannot be obtained #75

Closed kubecto closed 2 months ago

kubecto commented 2 months ago

Using k8s mode deployment, the node's metrics cannot be obtained, I tried to use binary available to get

apiVersion: v1
kind: ServiceAccount
metadata:
  name: kube-summary-exporter
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: kube-summary-exporter
spec:
  selector:
    matchLabels:
      app: kube-summary-exporter
  template:
    metadata:
      labels:
        app: kube-summary-exporter
    spec:
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
        - effect: NoSchedule
          key: node-role.kubernetes.io/control-plane
          operator: Exists
      hostNetwork: true
      hostPID: true
      serviceAccountName: kube-summary-exporter
      containers:
      - name: kube-summary-exporter
        image: quay.io/utilitywarehouse/kube-summary-exporter:v0.4.3
        ports:
        - name: tcp
          containerPort: 9779
        volumeMounts:
        - mountPath: /host/root
          name: root
          readOnly: false
      volumes:
      - hostPath:
          path: /
        name: root
curl 10.102.20.67:9779/node/master1
Error querying /stats/summary for master1: unknown (get nodes master1)
george-angel commented 2 months ago

Please check the kube-summary-exporter Pod for logs. Does it have necessary RBAC permissions, have you applied https://github.com/utilitywarehouse/kube-summary-exporter/blob/master/manifests/cluster/clusterrole.yaml ?

Are there any netpols that might prevent it from talking with the apiserver?

kubecto commented 2 months ago

Ok, thank you, this program is too simple and there is no log, I wrote a new one myself, and this needs to specify the node name to get the indicator, I looped through all the nodes through the api, the whole data spit out

george-angel commented 2 months ago

Ok, going to close.